svg-scroll-draw 2.24.0 → 2.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +174 -30
- package/dist/angular/index.cjs +3 -3
- package/dist/angular/index.d.mts +60 -6
- package/dist/angular/index.d.ts +60 -6
- package/dist/angular/index.mjs +1 -1
- package/dist/astro/index.cjs +2 -2
- package/dist/astro/index.d.mts +3 -3
- package/dist/astro/index.d.ts +3 -3
- package/dist/astro/index.mjs +1 -1
- package/dist/cdn/svg-scroll-draw.dev.global.js +69 -31
- package/dist/cdn/svg-scroll-draw.global.js +2 -2
- package/dist/chunk-5SJE7725.mjs +1 -0
- package/dist/{chunk-NX74KN5X.mjs → chunk-5U4JXBHR.mjs} +1 -1
- package/dist/chunk-7LDSB4FT.mjs +1 -0
- package/dist/chunk-ASCOHQQD.mjs +2 -0
- package/dist/chunk-GBFWTY5L.mjs +1 -0
- package/dist/chunk-HAGTU5EX.mjs +1 -0
- package/dist/chunk-HJTHOZK5.mjs +1 -0
- package/dist/chunk-IXR6RML7.mjs +1 -0
- package/dist/chunk-KN2YB54Z.mjs +1 -0
- package/dist/chunk-NJV6S5LD.mjs +1 -0
- package/dist/chunk-UBH4K5YD.mjs +1 -0
- package/dist/chunk-UF3MO5XQ.mjs +1 -0
- package/dist/chunk-XLXVGQ3P.mjs +3 -0
- package/dist/chunk-YOOPMYT6.mjs +1 -0
- package/dist/chunk-Z72TVDHY.mjs +1 -0
- package/dist/cinematic/index.cjs +2 -2
- package/dist/cinematic/index.d.mts +3 -1
- package/dist/cinematic/index.d.ts +3 -1
- package/dist/cinematic/index.mjs +1 -1
- package/dist/{engine-6VsjEwzb.d.ts → engine-Bi2x8-X-.d.mts} +2 -2
- package/dist/{engine-BLWKCfxC.d.mts → engine-DAlvk6i0.d.ts} +2 -2
- package/dist/frames/index.cjs +1 -1
- package/dist/frames/index.d.mts +2 -2
- package/dist/frames/index.d.ts +2 -2
- package/dist/frames/index.mjs +1 -1
- package/dist/group/index.cjs +3 -3
- package/dist/group/index.d.mts +3 -3
- package/dist/group/index.d.ts +3 -3
- package/dist/group/index.mjs +1 -1
- package/dist/horizontal/index.cjs +1 -1
- package/dist/horizontal/index.d.mts +2 -2
- package/dist/horizontal/index.d.ts +2 -2
- package/dist/horizontal/index.mjs +1 -1
- package/dist/{index-BN8yKeQ3.d.ts → index-BMMZ8aW7.d.mts} +2 -2
- package/dist/{index-hSQqLVbg.d.ts → index-CEMsUTEG.d.ts} +3 -3
- package/dist/{index-DAiRJgtF.d.mts → index-ClAFxNEp.d.mts} +3 -3
- package/dist/{index-DVjblK_4.d.mts → index-MdQ4ti_z.d.ts} +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.d.mts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.mjs +1 -1
- package/dist/lenis/index.cjs +1 -1
- package/dist/lenis/index.d.mts +15 -16
- package/dist/lenis/index.d.ts +15 -16
- package/dist/lenis/index.mjs +1 -1
- package/dist/nuxt/index.cjs +3 -3
- package/dist/nuxt/index.d.mts +8 -5
- package/dist/nuxt/index.d.ts +8 -5
- package/dist/nuxt/index.mjs +1 -1
- package/dist/progress/index.cjs +1 -1
- package/dist/progress/index.d.mts +2 -2
- package/dist/progress/index.d.ts +2 -2
- package/dist/progress/index.mjs +1 -1
- package/dist/react/index.cjs +3 -3
- package/dist/react/index.d.mts +21 -5
- package/dist/react/index.d.ts +21 -5
- package/dist/react/index.mjs +1 -1
- package/dist/reveal/index.cjs +1 -1
- package/dist/reveal/index.d.mts +2 -2
- package/dist/reveal/index.d.ts +2 -2
- package/dist/reveal/index.mjs +1 -1
- package/dist/{scroll-draw-Fzir8hlU.d.mts → scroll-draw-CKZysh22.d.mts} +1 -1
- package/dist/{scroll-draw-BsU_Ohmu.d.ts → scroll-draw-DbY8RUJE.d.ts} +1 -1
- package/dist/snap/index.cjs +1 -1
- package/dist/snap/index.d.mts +2 -2
- package/dist/snap/index.d.ts +2 -2
- package/dist/snap/index.mjs +1 -1
- package/dist/solid/index.cjs +3 -3
- package/dist/solid/index.d.mts +40 -4
- package/dist/solid/index.d.ts +40 -4
- package/dist/solid/index.mjs +1 -1
- package/dist/svelte/index.cjs +3 -3
- package/dist/svelte/index.d.mts +47 -4
- package/dist/svelte/index.d.ts +47 -4
- package/dist/svelte/index.mjs +1 -1
- package/dist/text/index.cjs +1 -1
- package/dist/text/index.d.mts +2 -2
- package/dist/text/index.d.ts +2 -2
- package/dist/text/index.mjs +1 -1
- package/dist/timeline/index.cjs +10 -10
- package/dist/timeline/index.d.mts +2 -2
- package/dist/timeline/index.d.ts +2 -2
- package/dist/timeline/index.mjs +2 -2
- package/dist/{types-9bcJdVcg.d.mts → types-iITMwrru.d.mts} +10 -2
- package/dist/{types-9bcJdVcg.d.ts → types-iITMwrru.d.ts} +10 -2
- package/dist/video/index.cjs +1 -1
- package/dist/video/index.d.mts +2 -2
- package/dist/video/index.d.ts +2 -2
- package/dist/video/index.mjs +1 -1
- package/dist/vue/index.cjs +3 -3
- package/dist/vue/index.d.mts +37 -4
- package/dist/vue/index.d.ts +37 -4
- package/dist/vue/index.mjs +1 -1
- package/dist/web-component/index.cjs +3 -3
- package/dist/web-component/index.mjs +1 -1
- package/dist/wrapper-BOHrDnBO.d.mts +8 -0
- package/dist/wrapper-Cm7JTIVl.d.ts +8 -0
- package/package.json +1 -1
- package/dist/chunk-32ZCSGFZ.mjs +0 -1
- package/dist/chunk-5SKWSPQT.mjs +0 -1
- package/dist/chunk-7USW2XFB.mjs +0 -1
- package/dist/chunk-7XOFQCQE.mjs +0 -3
- package/dist/chunk-BDXWPUBJ.mjs +0 -2
- package/dist/chunk-BRV2B2YW.mjs +0 -1
- package/dist/chunk-QZKYGS74.mjs +0 -1
- package/dist/chunk-THPTANES.mjs +0 -1
- package/dist/chunk-U5TKLHGW.mjs +0 -1
- package/dist/chunk-V3Z6G5JE.mjs +0 -1
- package/dist/chunk-XSVTHCLO.mjs +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';function
|
|
2
|
-
<div style="position:absolute;${m?`left:${
|
|
3
|
-
<div style="position:absolute;${m?`left:${u}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${u}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(n),window.addEventListener("scroll",s,{passive:true}),s(),{el:n,destroy(){window.removeEventListener("scroll",s),n.remove();}}}var jt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Yt=/[MmLlHhVvCcSsQqTtAaZz]/g;function vr(e,r,t){if(!_e)return;let n=(e.match(Yt)??[]).join("").toUpperCase(),s=(r.match(Yt)??[]).join("").toUpperCase(),i=(e.match(jt)??[]).length,l=(r.match(jt)??[]).length;if(n!==s){W(`morphTo: command sequence differs (${n||"\u2205"} \u2192 ${s||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,t);return}i!==l&&W(`morphTo: coordinate count differs (${i} \u2192 ${l}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,t);}function Er(e,r,t){let n=(r.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),s=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,i=>{let l=parseFloat(i),u=n[s++]??l;return String(+(l+(u-l)*t).toFixed(4))})}function Qt(e,r={}){return typeof window>"u"?{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0}:Ve(r,(t,n)=>Sr(e,t,n))}function Sr(e,r,t){let{preset:n,...s}=r,i=n?{...dt[n],...s}:s,{selector:l="path, polyline, line, polygon, rect, circle",speed:u=1,fade:m=false,easing:d="linear",trigger:v={},stagger:E=0,direction:y="forward",once:I=false,debug:se=false,axis:f="y",scrollContainer:w,autoReverse:h=false,delay:x=0,strokeColor:b,strokeWidth:L,fillOpacity:U,waypoints:z,velocityScale:N=false,threshold:J=0,rootMargin:Ge="0px",repeat:le=0,repeatDelay:de=0,morphTo:B,clip:ee,autoplay:Ae=false,duration:P=1e3,native:H=true,onProgress:Ce,onStart:X,onComplete:te,onEnter:ge,onLeave:Re,onEnterBack:ye,onLeaveBack:me}=i,Z=ee===true?"left":typeof ee=="string"?ee:false,q=typeof d=="function"?d:oe[d]??oe.linear,Ne=Te(v.start||"top bottom"),We=Te(v.end||"bottom top"),F=typeof w=="string"?document.querySelector(w):w??null,he=Array.isArray(b)?b[0]:null,be=Array.isArray(b)?b[1]:typeof b=="string"?b:null,ce=Array.isArray(L)?L[0]:null,Pe=Array.isArray(L)?L[1]:typeof L=="number"?L:null,we=Array.isArray(U)?U[0]:null,ue=Array.isArray(U)?U[1]:typeof U=="number"?U:null;function ve(o){let c=o*100;switch(Z){case "right":return `inset(0 0 0 ${100-c}%)`;case "top":return `inset(0 0 ${100-c}% 0)`;case "bottom":return `inset(${100-c}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-c}% 0 0)`}}let a=Z?[]:Array.from(e.querySelectorAll(l)),p=[],_=[],M=0,$=0,O=E,k=0,Le=0,V=false,Ee=false,Se=0,at=-1,Qe=[],Ue=-1,ie=false,fe=0,De=0,Oe,lt=false,ct=null;function bt(){ct?.destroy(),ct=null;}let Ie=new Set,wt=NaN,He=true,Xe=-1,vt=performance.now(),Fe=NaN;function Ze(){return F?f==="x"?F.scrollLeft:F.scrollTop:f==="x"?window.scrollX:window.scrollY}function Et(){return F?f==="x"?F.clientWidth:F.clientHeight:f==="x"?window.innerWidth:window.innerHeight}function St(){let o=Ke(e,F,f);return $e(o,o.scroll,Et(),Ne,We)}function or(){let o=$-M,c=a.length-1,g=F??document.documentElement,T=f==="x"?"Width":"Height";if(O=E,E>0&&c>0&&o>0){let j=g[`scroll${T}`]-g[`client${T}`]-1-M-o/u;j>=0&&(O=Math.min(E,j/(c*o)));}let G=Math.max(0,c)*O*o,re=o/Math.min(u,1);k=M+Math.min(0,G,re,G+re),Le=M+Math.max(0,G,re,G+re);}function xt(){(({tStart:M,tEnd:$}=St())),or(),se&&_e&&(bt(),ct=wr(M,$,f));}function ut(o,c=St){Me(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:c});let g=o.destroy;return o.destroy=()=>{g.call(o),pe(e);},o}function Tt(o,c){return I&&!h?Math.max(at,q(Qe[o]=Math.max(Qe[o]??0,c))):q(c)}function sr(o,c){if(e.style.setProperty("--scroll-draw-progress",String(o)),Z){let g=c==="reverse"?1-o:o;e.style.clipPath=ve(g);return}a.forEach((g,T)=>mt(g,T,o,c));}function mt(o,c,g,T){o.style.strokeDashoffset=T==="reverse"?`${p[c]*g}`:`${p[c]*(1-g)}`,m&&(o.style.opacity=T==="reverse"?`${1-g}`:`${g}`),he&&be?o.style.stroke=et(he,be,g):be&&(o.style.stroke=be),ce!==null&&Pe!==null?o.style.strokeWidth=`${ce+(Pe-ce)*g}`:Pe!==null&&(o.style.strokeWidth=`${Pe}`),we!==null&&ue!==null?o.style.fillOpacity=`${we+(ue-we)*g}`:ue!==null&&(o.style.fillOpacity=`${ue}`),B&&o.tagName.toLowerCase()==="path"&&_[c]&&o.setAttribute("d",Er(_[c],B,g));}function ft(){if(e.style.setProperty("--scroll-draw-progress","0"),Z){e.style.clipPath=ve(y==="reverse"?1:0);return}a.forEach((o,c)=>{o.style.strokeDasharray=`${p[c]}`,o.style.strokeDashoffset=y==="reverse"?"0":`${p[c]}`,m?o.style.opacity=y==="reverse"?"1":"0":o.style.opacity="",he&&(o.style.stroke=he),ce!==null&&(o.style.strokeWidth=`${ce}`),we!==null&&(o.style.fillOpacity=`${we}`),B&&o.tagName.toLowerCase()==="path"&&_[c]&&o.setAttribute("d",_[c]);});}function ze(o,c){let g=o.getAttribute("d"),T=Je(o);if(B&&_[c]){o.setAttribute("d",B);let G=Je(o);o.setAttribute("d",_[c]),T=Math.max(Je(o),G),o.setAttribute("d",g);}p[c]=T,o.style.strokeDasharray=`${T}`;}if(a.forEach((o,c)=>{br(o);let g=o.tagName.toLowerCase()==="path";g?_.push(o.getAttribute("d")??""):_.push(""),ze(o,c);let T=p[c];B&&(g?vr(_[_.length-1],B,o):W(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),t?(o.style.strokeDashoffset=y==="reverse"?`${T}`:"0",m&&(o.style.opacity="1"),be&&(o.style.stroke=be),Pe!==null&&(o.style.strokeWidth=`${Pe}`),ue!==null&&(o.style.fillOpacity=`${ue}`),B&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",B)):(o.style.strokeDashoffset=y==="reverse"?"0":`${T}`,m?o.style.opacity=y==="reverse"?"1":"0":o.style.opacity="",he&&(o.style.stroke=he),ce!==null&&(o.style.strokeWidth=`${ce}`),we!==null&&(o.style.fillOpacity=`${we}`));}),t)return Z&&(e.style.clipPath=ve(1)),te?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};Z&&(e.style.clipPath=ve(y==="reverse"?1:0));let Mt=typeof d=="string"?tt(d):null;function ir(){return !(H===false||Ae||se&&_e||!hr()||!a.length||!Mt||Z||f!=="y"||F||u!==1||E!==0||I||h||N!==false||B||z||le||x>0||Ce||X||te||ge||Re||ye||me||b!=null||L!=null||U!=null||(v.start||"top bottom").trim()!=="top bottom"||(v.end||"bottom top").trim()!=="bottom top")}function ar(){let o=++yr,c=`svg-scroll-draw-${o}`,g=`svg-scroll-draw-host-${o}`,T=`--svg-scroll-draw-${o}`,G=y==="reverse"?"0":"var(--ssd-len)",re=y==="reverse"?"var(--ssd-len)":"0",j=`stroke-dashoffset:${G};`,C=`stroke-dashoffset:${re};`;m&&(j+=`opacity:${y==="reverse"?1:0};`,C+=`opacity:${y==="reverse"?0:1};`);let D=document.createElement("style");D.setAttribute("data-svg-scroll-draw",""),D.textContent=`@keyframes ${c}{from{${j}}to{${C}}}.${g}{view-timeline-name:${T};view-timeline-axis:block;}.${c}{animation-name:${c};animation-duration:auto;animation-timing-function:${Mt};animation-fill-mode:both;animation-timeline:${T};animation-range:cover 0% cover 100%;}`,document.head.appendChild(D),e.classList.add(g);function K(S,A){S.style.setProperty("--ssd-len",String(p[A])),S.style.strokeDasharray=`${p[A]}`,S.style.strokeDashoffset="",S.style.opacity="",S.style.animationPlayState="",S.classList.add(c);}a.forEach(K);let Y=false,ne=-1;function ae(){if(ne>=0)return ne;let S=e.getBoundingClientRect(),{tStart:A,tEnd:Q}=$e({top:S.top,height:S.height},Ze(),Et(),Ne,We);return q(R(Ze(),A,Q,u))}return {destroy(){e.classList.remove(g),a.forEach(S=>{S.classList.remove(c),S.style.removeProperty("--ssd-len"),S.style.animationPlayState="";}),D.remove();},replay(){Y=false,ne=-1,a.forEach(K);},pause(){Y=true,a.forEach(S=>{S.style.animationPlayState="paused";});},resume(){Y&&(Y=false,a.forEach(S=>{S.style.animationPlayState="running";}));},seek(S){let A=Math.min(1,Math.max(0,S));ne=A,Y=true,a.forEach((Q,xe)=>{Q.classList.remove(c),Q.style.strokeDashoffset=y==="reverse"?`${p[xe]*A}`:`${p[xe]*(1-A)}`,m&&(Q.style.opacity=y==="reverse"?`${1-A}`:`${A}`);});},getProgress(){return ae()},refresh(){a.forEach((S,A)=>{ze(S,A),S.style.setProperty("--ssd-len",String(p[A]));});}}}if(ir())return ut(ar());function lr(){let o=Math.max(1,P),c=Z?o:o*(1+Math.max(0,a.length-1)*E),g=0,T=0,G=false;function re(ne){let ae=true,S=Math.min(1,Math.max(0,ne/c));if(Z){let A=Math.min(1,Math.max(0,ne/o)),Q=q(A);fe=Q,e.style.setProperty("--scroll-draw-progress",String(Q)),e.style.clipPath=ve(y==="reverse"?1-Q:Q),Ce?.(Q),A<1&&(ae=false);}else {a.forEach((Q,xe)=>{let ur=xe*E*o,kt=Math.min(1,Math.max(0,(ne-ur)/o));mt(Q,xe,q(kt),y),kt<1&&(ae=false);});let A=q(S);fe=A,Ce?.(A),e.style.setProperty("--scroll-draw-progress",String(A));}if(z){let A=q(S);for(let Q in z){let xe=parseFloat(Q);A>=xe&&!Ie.has(xe)&&(Ie.add(xe),z[Q]?.());}}return ae}function j(ne){if(ie)return;let ae=ne-g;Ee||(Ee=true,X?.());let S=re(ae);if(S&&!V){V=true,re(c),te?.(),De<(le==="infinite"?1/0:le??0)&&(De++,Oe=setTimeout(()=>{g=performance.now(),Ee=false,V=false,Ie.clear(),ft(),Se=requestAnimationFrame(j);},de));return}S||(Se=requestAnimationFrame(j));}function C(){cancelAnimationFrame(Se),clearTimeout(Oe),g=performance.now(),T=0,ie=false,Ee=false,V=false,De=0,G=true,fe=0,Ie.clear(),ft(),Se=requestAnimationFrame(j);}let D=new IntersectionObserver(ne=>{ne.forEach(ae=>{ae.isIntersecting&&!(I&&V)?C():!ae.isIntersecting&&!I&&!V&&(cancelAnimationFrame(Se),clearTimeout(Oe),G=false);});},{root:F??null,threshold:J,rootMargin:Ge}),K;function Y(){clearTimeout(K),K=setTimeout(()=>a.forEach(ze),150);}return window.addEventListener("resize",Y),window.addEventListener("orientationchange",Y),x>0?setTimeout(()=>D.observe(e),x):D.observe(e),{destroy(){cancelAnimationFrame(Se),clearTimeout(Oe),D.disconnect(),window.removeEventListener("resize",Y),window.removeEventListener("orientationchange",Y),clearTimeout(K);},replay(){De=0,C();},pause(){ie||!G||(ie=true,T=performance.now()-g,cancelAnimationFrame(Se));},resume(){ie&&(ie=false,G=true,g=performance.now()-T,Se=requestAnimationFrame(j));},seek(ne){let ae=Math.min(1,Math.max(0,ne));fe=ae,ie=true,T=ae*c,g=performance.now()-T,cancelAnimationFrame(Se),re(T);},getProgress(){return fe},refresh(){clearTimeout(K),a.forEach(ze);}}}if(Ae)return ut(lr());xt();let At=()=>R(Ze(),k,Le,1);function Pt(){V=true,te?.(),De<(le==="infinite"?1/0:le)&&(De++,Oe=setTimeout(()=>{lt=true;},de));}function Lt(){at=-1,Qe=[],Ee=false,V=false,lt=false,Ie.clear(),ft(),He=true;}function cr(){let o=performance.now(),c=Ze();if(lt&&At()%1&&Lt(),!He&&N===false&&c===wt)return;He=false,wt=c;let g=u;if(N!==false){let C=o-vt,D=C>0?Math.abs(c-(Xe<0?c:Xe))/C:0;g=u*Math.max(.2,1+D*(typeof N=="number"?N:1)*.04);}Xe=c,vt=o;let T=h?Ue===-1||c>=Ue?"forward":"reverse":y;Ue=c;let G=$-M,re=true,j=G===0?0:(c-M)/G;if(isNaN(Fe)||(Fe<=0&&j>0&&ge?.(),Fe<1&&j>=1&&Re?.(),Fe>=1&&j<1&&ye?.(),Fe>0&&j<=0&&me?.()),Fe=j,Z){let C=Tt(0,R(c,M,$,g));fe=C,e.style.setProperty("--scroll-draw-progress",String(C));let D=T==="reverse"?1-C:C;e.style.clipPath=ve(D),Ce?.(C),!Ee&&R(c,M,$,g)>0&&(Ee=true,X?.()),C>=1&&!V?Pt():C<1&&!I&&(V=false);return}if(a.forEach((C,D)=>{let K=D*O*G,Y=Tt(D,R(c,M+K,$+K,g));mt(C,D,Y,T),D===0&&(fe=Y,Ce?.(Y),e.style.setProperty("--scroll-draw-progress",String(Y))),Y<1&&(re=false);}),z){let C=q(R(c,M,$,g));for(let D in z){let K=parseFloat(D);C>=K&&!Ie.has(K)&&(Ie.add(K),z[D]?.());}}!Ee&&R(c,M,$,g)>0&&(Ee=true,X?.()),re&&!V?Pt():!re&&!I&&(V=false);}let Be=ke(F??window,[e],At,cr,()=>{let o=p.join();a.forEach(ze),xt(),He=true,p.join()!==o&&qe();}),pt=x>0;function qe(){Be.hold(ie||pt);}let $t;return pt&&($t=setTimeout(()=>{pt=false,qe();},x)),qe(),ut({destroy(){clearTimeout(Oe),clearTimeout($t),Be.off(),bt();},replay(){Lt(),Ue=-1,Xe=-1,De=0,ie=false,fe=0,clearTimeout(Oe),qe();},pause(){ie=true,Be.hold(true);},resume(){ie&&(ie=false,He=true,qe());},seek(o){let c=Math.min(1,Math.max(0,o));fe=c,at=c,Qe=[],ie=true,Be.hold(true),sr(c,y),He=true;},getProgress(){return fe},refresh:Be.remeasure},()=>({tStart:M,tEnd:$}))}function xr(e,r){let t={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return t;let n=typeof e=="string"?document.querySelector(e):e;return n?Qt(n,r):(W("Container not found:",e),t)}function Tr(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Ut(e){let r=[],t=/([\w]+)\(([^)]*)\)/g,n;for(;(n=t.exec(e))!==null;){let s=[],i=[],l=n[2].trim();if(l)for(let u of l.split(/[\s,]+/)){let m=u.match(/^([-+]?[\d.eE]+)(.*)$/);s.push(m?parseFloat(m[1]):0),i.push(m?m[2]:"");}r.push({fn:n[1],nums:s,units:i});}return r}function Mr(e,r,t){let n=Ut(e),s=Ut(r);return n.length===0||n.length!==s.length?t<1?e:r:n.map((i,l)=>{let u=s[l];return i.fn!==u.fn||i.nums.length!==u.nums.length?t<1?`${i.fn}(${i.nums.map((m,d)=>`${m}${i.units[d]}`).join(", ")})`:`${u.fn}(${u.nums.map((m,d)=>`${m}${u.units[d]}`).join(", ")})`:`${i.fn}(${i.nums.map((m,d)=>`${m+(u.nums[d]-m)*t}${i.units[d]}`).join(", ")})`}).join(" ")}function Xt(e,r,t){if(typeof e=="number"&&typeof r=="number")return String(e+(r-e)*t);let n=String(e),s=String(r);if(Tr(n))return et(n,s,t);if(n.includes("("))return Mr(n,s,t);let i=n.match(/^([-+]?[\d.]+)(.*)$/),l=s.match(/^([-+]?[\d.]+)(.*)$/);if(i&&l){let u=parseFloat(i[1]),m=parseFloat(l[1]);return `${u+(m-u)*t}${i[2]||l[2]}`}return t<1?n:s}function Ar(e){return e.replace(/([A-Z])/g,r=>`-${r.toLowerCase()}`)}var Pr=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Lr=0,Zt="--scroll-draw-progress";function $r(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var Jt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function gt(e,r){return typeof window>"u"?Jt:r.respectReducedMotion===false?Kt(e,r,false):Ve(r,(t,n)=>Kt(e,t,n))}function Kt(e,r,t){let{props:n,trigger:s={},easing:i="ease-out",speed:l=1,once:u=false,axis:m="y",scrollContainer:d,native:v=true,velocityScale:E=false,triggerElement:y,onProgress:I,onComplete:se,onEnter:f,onLeave:w,onEnterBack:h,onLeaveBack:x}=r,b=typeof i=="function"?i:oe[i]??oe["ease-out"],L=Te(s.start||"top bottom"),U=Te(s.end||"bottom top"),z=y??e,N=typeof d=="string"?document.querySelector(d):d??null,J=Object.entries(n).map(([a,p])=>({prop:Ar(a),from:Array.isArray(p)?p[0]:"",to:Array.isArray(p)?p[1]:p}));function Ge(){let a=window.getComputedStyle(e);for(let p of J)p.from===""&&(p.from=a.getPropertyValue(p.prop).trim()||"0");}function le(){for(let a of J)e.style.setProperty(a.prop,String(a.to));}let de=new Map;for(let a of [...J.map(p=>p.prop),Zt])de.set(a,e.style.getPropertyValue(a));function B(){for(let[a,p]of de)p?e.style.setProperty(a,p):e.style.removeProperty(a);}if(t)return le(),se?.(),{...Jt,destroy:B,getProgress:()=>1};Ge();let ee=()=>N?m==="x"?N.scrollLeft:N.scrollTop:m==="x"?window.scrollX:window.scrollY,Ae=()=>N?m==="x"?N.clientWidth:N.clientHeight:m==="x"?window.innerWidth:window.innerHeight,P=typeof i=="string"?tt(i):null;function H(){if(!v||!$r()||!P||m!=="y"||N||z!==e||u||l!==1||I||se||f||w||h||x||E!==false||(s.start||"top bottom").trim()!=="top bottom"||(s.end||"bottom top").trim()!=="bottom top")return false;for(let a of J)if(!Pr.has(a.prop))return false;return true}function Ce(){let a=`ssd-a-${++Lr}`,p=J.map(k=>`${k.prop}:${k.from}`).join(";"),_=J.map(k=>`${k.prop}:${k.to}`).join(";"),M=document.createElement("style");M.setAttribute("data-ssd-animate",""),M.textContent=`@keyframes ${a}{from{${p}}to{${_}}}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${P};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(M),e.classList.add(a);let $=()=>{let k=e.getBoundingClientRect();return $e({top:k.top,height:k.height},ee(),Ae(),L,U)};Me(e,{type:"animate",getProgress:()=>O.getProgress(),getTrigger:$});let O={refresh(){},destroy(){e.classList.remove(a),M.remove(),e.style.animationPlayState="",B(),pe(e);},replay(){e.classList.remove(a),e.offsetWidth,e.classList.add(a);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(k){let Le=Math.min(1,Math.max(0,k));e.classList.remove(a);for(let V of J)e.style.setProperty(V.prop,Xt(V.from,V.to,Le));},getProgress(){let{tStart:k,tEnd:Le}=$();return b(R(ee(),k,Le,l))}};return O}if(H())return Ce();let X=0,te=0,ge=false,Re=-1,ye=0,me=0,Z=false,q=NaN,Ne=-1,We=0,F=z===e?J:[],he=false;function be(){let a=e.style,p=F.map(O=>a.getPropertyValue(O.prop)),_=a.transition;F.length&&(a.transition="none"),F.forEach(O=>a.setProperty(O.prop,de.get(O.prop)??""));let M=Ke(z,N,m);F.forEach((O,k)=>a.setProperty(O.prop,p[k])),F.length&&(e.offsetWidth,a.transition=_);let $=$e(M,M.scroll,Ae(),L,U);he&&Math.abs($.tStart-X)<1&&Math.abs($.tEnd-te)<1||(he=true,X=$.tStart,te=$.tEnd);}function ce(a){e.style.setProperty(Zt,String(a));for(let p of J)e.style.setProperty(p.prop,Xt(p.from,p.to,a));I?.(a);}function Pe(a){if(isNaN(q)){q=a;return}q<=0&&a>0&&f?.(),q<1&&a>=1&&w?.(),q>=1&&a<1&&h?.(),q>0&&a<=0&&x?.(),q=a;}function we(){if(ge)return;let a=performance.now(),p=ee(),_=l;if(E!==false){let k=a-We,Le=k>0?Math.abs(p-(Ne<0?p:Ne))/k:0;_=l*Math.max(.2,1+Le*(typeof E=="number"?E:1)*.04);}Ne=p,We=a;let M=te===X?0:(p-X)/(te-X);Pe(M);let $=R(p,X,te,_),O=u?Math.max(Re,b(ye=Math.max(ye,$))):b($);me=O,ce(O),O>=1&&!Z?(Z=true,se?.()):O<1&&!u&&(Z=false);}let ue=ke(N??window,[z],()=>R(ee(),X,te,Math.min(l,1)),we,be);be(),te===X&&W("scrollAnimate: zero-length trigger window, so it never animates. In a sticky stage, set triggerElement.",e),ye=R(ee(),X,te,l),me=b(ye),ce(me),Me(e,{type:"animate",getProgress:()=>me,getTrigger:()=>({tStart:X,tEnd:te})});function ve(){ge=true,ue.hold(true);}return {destroy(){ge=true,ue.off(),B(),pe(e);},replay(){Re=-1,ye=0,Z=false,me=0,ge=false,ce(0),ue.hold(false);},pause:ve,resume(){ge&&(ge=false,ue.hold(false));},seek(a){let p=Math.min(1,Math.max(0,a));me=p,Re=p,ye=0,ve(),ce(p);},getProgress(){return me},refresh:ue.remeasure}}var st={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function kr(e,r){if(typeof window>"u")return st;let t=typeof e=="string"?document.querySelector(e):e;return t?gt(t,r):(W("scrollAnimate: element not found:",e),st)}function Cr(e,r={}){if(typeof window>"u")return st;let t=typeof e=="string"?document.querySelector(e):e;if(!t)return W("scrollParallax: element not found:",e),st;let{speed:n=.3,axis:s="y",easing:i="linear",trigger:l,onProgress:u}=r,m=-n*100,d=t.style,v=!!t.ownerSVGElement,E=d.getPropertyValue("transform-box");v&&d.setProperty("transform-box","fill-box");let y=gt(t,{props:s==="x"?{transform:["translateX(0%)",`translateX(${m}%)`]}:{transform:["translateY(0%)",`translateY(${m}%)`]},trigger:l??{start:"top bottom",end:"bottom top"},easing:i,native:false,onProgress:u});return v?{...y,destroy(){y.destroy(),d.setProperty("transform-box",E);}}:y}var yt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Dr(e,r){if(typeof window>"u")return yt;let t=typeof e=="string"?document.querySelector(e):e;return t?Ve(r,(n,s)=>Or(t,n,s)):(W("scrollCounter: element not found:",e),yt)}function Or(e,r,t){let{from:n=0,to:s,format:i,easing:l="ease-out",trigger:u={},once:m=true,decimals:d,onComplete:v}=r,E=d!==void 0?P=>P.toFixed(d):i??(P=>String(Math.round(P))),y=typeof l=="function"?l:oe[l]??oe["ease-out"],I=Te(u.start||"top 80%"),se=Te(u.end||"top 20%");if(t)return e.textContent=E(s),v?.(),{...yt,getProgress:()=>1};let f=0,w=0,h=false,x=-1,b=0,L=0,U=false,z=()=>window.scrollY,N=()=>window.innerHeight;function J(){let P=e.getBoundingClientRect(),H=$e({top:P.top,height:P.height},z(),N(),I,se);h&&Math.abs(H.tStart-f)<1&&Math.abs(H.tEnd-w)<1||(h=true,f=H.tStart,w=H.tEnd);}let Ge=e.style.getPropertyValue("--scroll-draw-progress");function le(P){e.textContent=E(n+(s-n)*P),e.style.setProperty("--scroll-draw-progress",String(P));}let de=()=>R(z(),f,w,1);function B(){let P=de(),H=m?Math.max(x,y(b=Math.max(b,P))):y(P);L=H,le(H),H>=1&&!U?(U=true,v?.()):H<1&&!m&&(U=false);}J();{b=R(z(),f,w,1);let P=y(b);L=P,le(P);}let ee=ke(window,[e],de,B,J);Me(e,{type:"counter",getProgress:()=>L,getTrigger:()=>({tStart:f,tEnd:w})});let Ae=()=>ee.hold(false);return {destroy(){ee.off(),e.style.setProperty("--scroll-draw-progress",Ge),pe(e);},replay(){x=-1,b=0,U=false,L=0,le(0),Ae();},pause:()=>ee.hold(true),resume:Ae,seek(P){let H=Math.min(1,Math.max(0,P));L=H,x=H,b=0,ee.hold(true),le(H);},getProgress(){return L}}}var er="http://www.w3.org/2000/svg",Ir="cinematic-photo",nr=e=>e<0?0:e>1?1:e;function it(e){let r=parseFloat(e);return Number.isFinite(r)?nr(r/100):0}function tr(e){return oe[e]??oe.linear}var rr=e=>({destroy(){},getProgress:()=>e}),ht=class{constructor(r){if(typeof document>"u"){this.mount=null;return}this.mount=typeof r.wrapper=="string"?document.querySelector(r.wrapper):r.wrapper,this.mount||W("Cinematic: wrapper not found:",r.wrapper);}loadStory(r){let t=this.mount;if(typeof window>"u"||!t)return rr(0);t.style.position="relative",t.style.height=r.totalHeight,t.style.display="block";let n=document.createElement("div");n.setAttribute("data-cinematic-stage",""),n.style.cssText="position:sticky;top:0;height:100vh;width:100%;overflow:hidden;display:block;",t.appendChild(n);let s=[];for(let f of r.scenes){if(f.background){let h=document.createElement("img");h.id=Ir,h.src=f.background,h.alt="",h.style.cssText="position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:0;pointer-events:none;",n.appendChild(h);}let w=f.animations.filter(h=>h.type==="draw");if(w.length){let h=document.createElementNS(er,"svg");h.setAttribute("viewBox",`0 0 ${r.canvas.width} ${r.canvas.height}`),h.setAttribute("preserveAspectRatio","xMidYMid meet"),h.style.cssText="position:absolute;inset:0;width:100%;height:100%;overflow:visible;",n.appendChild(h);for(let x of w){let b=document.createElementNS(er,"path");b.id=x.target.replace(/^#/,""),b.setAttribute("d",x.d),b.setAttribute("fill","none"),b.setAttribute("stroke",x.stroke),b.setAttribute("stroke-width",String(x.strokeWidth)),b.setAttribute("stroke-linecap","round"),b.setAttribute("stroke-linejoin","round");let L=x.length||b.getTotalLength?.()||0;b.style.strokeDasharray=String(L),b.style.strokeDashoffset=String(L),h.appendChild(b),s.push({kind:"draw",el:b,start:it(x.start),end:it(x.end),ease:tr(x.easing),length:L});}}for(let h of f.animations){if(h.type!=="fade")continue;let x=n.querySelector(h.target)??document.querySelector(h.target);x&&(x.style.opacity=String(h.from),s.push({kind:"fade",el:x,start:it(h.start),end:it(h.end),ease:tr("ease-in-out"),from:h.from,to:h.to}));}}let i=0,l=null;for(let f=t.parentElement;f?.parentElement;f=f.parentElement)if(/[ao]/.test(getComputedStyle(f).overflowY)&&f.scrollHeight>f.clientHeight&&(f!==document.body||/[aoh]/.test(getComputedStyle(f.parentElement).overflowY))){l=f;break}let u=0,m=0,d=()=>{let f=t.getBoundingClientRect().top;u=l?f-l.getBoundingClientRect().top-l.clientTop+l.scrollTop:f+window.scrollY,m=u+Math.max(0,t.offsetHeight-(l?l.clientHeight:window.innerHeight));},v=()=>{let f=l?l.scrollTop:window.scrollY;return m<=u?f>=u?1:0:R(f,u,m,1)},E=f=>{for(let w of s){let h=w.end-w.start,x=h<=0?f>=w.end?1:0:nr((f-w.start)/h),b=w.ease(x);w.kind==="draw"?w.el.style.strokeDashoffset=String(w.length*(1-b)):w.el.style.opacity=String(w.from+(w.to-w.from)*b);}};if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return E(1),rr(1);let y=()=>{i=v(),E(i);};d(),y();let I=ke(l||window,[t],v,y,d);Me(t,{type:"draw",getProgress:()=>i,getTrigger:()=>({tStart:u,tEnd:m})});let se=rt(f=>{f&&(se(),I.off(),pe(t),i=1,E(1));});return {destroy(){se(),I.off(),pe(t);},getProgress:()=>i}}};
|
|
4
|
-
exports.Cinematic=
|
|
1
|
+
'use strict';var _e=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function R(e,...r){_e&&console.warn(`[svg-scroll-draw] ${e}`,...r);}function It({tension:e=2.5,friction:r=2.2}={}){return t=>1-Math.cos(t*Math.PI*e)*Math.pow(1-t,r)}function Ht({bounces:e=3,decay:r=.5}={}){let t=Math.max(1,Math.round(e)),n=Math.max(.01,Math.min(.99,r)),s=Math.sqrt(n),i=0,a=[];for(let d=0;d<t;d++){let v=Math.pow(s,d);a.push(v),i+=v;}let u=[0],m=0;for(let d=0;d<t;d++)m+=a[d]/i,u.push(m);return d=>{if(d<=0)return 0;if(d>=1)return 1;for(let v=0;v<t;v++)if(d<=u[v+1]){let E=(d-u[v])/(u[v+1]-u[v]);if(v===0)return E*(2-E);let y=1-Math.pow(n,v);return y+(1-y)*(2*E-1)*(2*E-1)}return 1}}function Nt({amplitude:e=1,period:r=.4}={}){let t=Math.max(1,e),n=Math.max(.1,r),s=t<=1?n/4:n/(2*Math.PI)*Math.asin(1/t);return i=>i<=0?0:i>=1?1:t*Math.pow(2,-10*i)*Math.sin((i-s)*(2*Math.PI)/n)+1}var Ve={linear:e=>e,"ease-in":e=>e*e,"ease-out":e=>e*(2-e),"ease-in-out":e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:It(),bounce:Ht(),elastic:Nt()};function gr(e,r,t,n){let s=(i,a,u)=>((1+3*i-3*a)*u+3*a-6*i)*u*u+3*i*u;return i=>{if(i<=0||i>=1)return +(i>0);let a=i;for(let u=0;u<8;u++)a-=(s(e,t,a)-i)/((3*(1+3*e-3*t)*a+6*t-12*e)*a+3*e);if(!(a>=0&&a<=1&&Math.abs(s(e,t,a)-i)<1e-9))for(let u=0,m=0,d=1;u<30;u++)a=(m+d)/2,s(e,t,a)<i?m=a:d=a;return s(r,n,a)}}function yt(e){let r=/^cubic-bezier\((.*)\)$/.exec(e==="ease"?"cubic-bezier(.25,.1,.25,1)":e.trim()),t=r?r[1].split(",").map(parseFloat):[];if(t.length===4&&t.every(Number.isFinite)&&t[0]*(1-t[0])>=0&&t[2]*(1-t[2])>=0)return [gr(t[0],t[1],t[2],t[3]),`cubic-bezier(${t})`]}var Rt=new Set;function Le(e,r="linear"){if(typeof e=="function")return e;if(e==null)return Ve[r];if({}.hasOwnProperty.call(Ve,e))return Ve[e];let t=yt(String(e));return t?t[0]:(!Rt.has(e)&&Rt.add(e)&&R(`Unknown easing ${JSON.stringify(e)}: use a name, cubic-bezier() or a function.`),Ve[r])}function Ft(e,r,t){return Math.min(t,Math.max(r,e))}function xe(e="top bottom"){let r=e.trim();if(/^\d+(\.\d+)?%$/.test(r))return {element:"top",viewport:r};let[t="top",n="bottom"]=r.split(/\s+/).filter(Boolean);return {element:t,viewport:n}}var zt=(e,r)=>e==="top"?0:e==="center"?.5:e==="bottom"?1:r;function _t(e,r,t,n){return e+t+r*zt(n,0)}function Vt(e,r){return r*(/^\d+(\.\d+)?%$/.test(e)?parseFloat(e)/100:zt(e,1))}function H(e,r,t,n){return t===r?0:Ft((e-r)/(t-r)*n,0,1)}function $e(e,r,t,n,s){let i=_t(e.top,e.height,r,n.element)-Vt(n.viewport,t),a=_t(e.top,e.height,r,s.element)-Vt(s.viewport,t);return {tStart:i,tEnd:a}}function et(e,r,t){let n=e.getBoundingClientRect(),s=t==="x"?n.width:n.height;return r?{top:t==="x"?n.left-r.getBoundingClientRect().left-r.clientLeft+r.scrollLeft:n.top-r.getBoundingClientRect().top-r.clientTop+r.scrollTop,height:s,scroll:0}:{top:t==="x"?n.left:n.top,height:s,scroll:t==="x"?window.scrollX:window.scrollY}}function tt(e){let r=parseFloat(e.getAttribute("pathLength")??"");if(r>0)return r;let t=e.tagName.toLowerCase();if(t==="rect"){let n=parseFloat(e.getAttribute("width")??"0"),s=parseFloat(e.getAttribute("height")??"0");return 2*(n+s)}if(t==="circle"){let n=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*n}return e.getTotalLength()}function ze(e){return `${e} ${e*2}`}function Gt(e){let r=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(r)return [parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16)];let t=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(t)return [parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)];let n=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return n?[parseInt(n[1]),parseInt(n[2]),parseInt(n[3])]:null}function rt(e,r,t){let n=Gt(e),s=Gt(r);return !n||!s?e:`rgb(${Math.round(n[0]+(s[0]-n[0])*t)},${Math.round(n[1]+(s[1]-n[1])*t)},${Math.round(n[2]+(s[2]-n[2])*t)})`}var ht={sketch:{easing:"ease-in",stagger:.1,speed:.9,fade:false},reveal:{easing:"ease-out",fade:true,speed:1.2,once:true},typewriter:{easing:"linear",stagger:.05,speed:1.5},cinematic:{easing:"ease-in-out",fade:true,speed:.75},spring:{easing:"spring",speed:1.1}};var yr="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",hr="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Wt=33;function br(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function wr(e){let r=[];for(let t=0;t<Wt;t++){let n=t/(Wt-1);r.push(String(Math.round(e(n)*1e5)/1e5));}return `linear(${r.join(",")})`}function nt(e){switch(e){case "linear":return "linear";case "ease-in":return yr;case "ease-out":return hr;case "ease-in-out":return br()?wr(Ve["ease-in-out"]):null;default:return yt(e)?.[1]??null}}var Bt=Symbol.for("svg-scroll-draw.registry");function qt(){let e=globalThis;return e[Bt]||(e[Bt]=new Map)}function Te(e,r){qt().set(e,r);}function fe(e){qt().delete(e);}function ot(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let r=window.matchMedia("(prefers-reduced-motion: reduce)"),t=s=>e(!!s.matches);if(typeof r.addEventListener=="function")return r.addEventListener("change",t),()=>r.removeEventListener("change",t);let n=r;return n.addListener?.(t),()=>n.removeListener?.(t)}function Ge(e,r){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return r(e,true);let t=r(e,false),n=ot(i=>{if(!i)return;n();let a=(t.getProgress?.()??0)>=1;t.destroy(),t=r(a?{...e,onComplete:void 0}:e,true);}),s={};for(let i of Object.keys(t))s[i]=(...a)=>t[i]?.(...a);return s.destroy=()=>{n(),t.destroy();},s}var Qe,st=new Set,it=new WeakMap,Ue=new Map,jt=e=>{let r=e.getBoundingClientRect();return r.width+" "+r.height};function vr(e){let r=new Set;for(let t of e)for(;t&&t!==document.body;t=t.parentElement)for(let n=t;n;n=n.previousElementSibling)r.add(n);return r}function Yt(e,r){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let t=()=>r();Qe??(Qe=new ResizeObserver(s=>{let i=false;for(let{target:a}of s)it.get(a)!==jt(a)&&(i=true),it.set(a,"");i&&st.forEach(a=>a());})),st.add(t);let n=vr(e);return [document.body,document.documentElement].forEach(s=>s&&n.add(s)),n.forEach(s=>{it.has(s)||it.set(s,jt(s)),Ue.set(s,(Ue.get(s)??0)+1),Qe.observe(s);}),()=>{st.delete(t)&&(n.forEach(s=>{let i=(Ue.get(s)??1)-1;if(i)return void Ue.set(s,i);Ue.delete(s),Qe?.unobserve(s);}),st.size||(Qe?.disconnect(),Qe=void 0));}}function ke(e,r,t,n,s){let i,a=NaN,u,m,d=()=>{i=0,n(),!u&&!i&&(a=t())>0&&a<1&&(i=requestAnimationFrame(d));},v=()=>{!i&&!u&&t()!==a&&(i=requestAnimationFrame(d));},E=w=>{u=w,cancelAnimationFrame(i),i=a=NaN,v();},y=()=>{clearTimeout(m),s(),v();},I=()=>{clearTimeout(m),m=setTimeout(y,150);},oe=Yt(r,I),f=w=>{e[w]("scroll",v,{passive:true}),window[w]("resize",I),window[w]("orientationchange",I);};return f("addEventListener"),v(),{hold:E,remeasure:y,off(){E(true),f("removeEventListener"),oe(),clearTimeout(m);}}}var Er=0;function Sr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Qt(e,r){let t="";try{t=getComputedStyle(e).getPropertyValue(r).trim();}catch{}return t||(e.getAttribute(r)??"").trim()}var Ut=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function xr(e){if(!_e)return;let r=Qt(e,"stroke");if(!r||r==="none"){R("Element has no stroke \u2014 path will not be visible.",e);return}let t=(e.getAttribute("fill")??"").trim();t&&!Ut.has(t)&&!Ut.has(Qt(e,"fill"))&&R("Element has a fill \u2014 it may obscure the stroke animation.",e);}function Tr(e,r,t){let n=document.createElement("div");n.setAttribute("data-svg-scroll-draw-debug",""),n.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function s(){let i=t==="x"?window.scrollX:window.scrollY,a=e-i,u=r-i,m=t==="x";n.innerHTML=`
|
|
2
|
+
<div style="position:absolute;${m?`left:${a}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${a}px;left:0;right:0;border-top:2px dashed #22c55e;`}padding:2px 6px;color:#22c55e;background:rgba(0,0,0,.6)">\u25B6 start</div>
|
|
3
|
+
<div style="position:absolute;${m?`left:${u}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${u}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(n),window.addEventListener("scroll",s,{passive:true}),s(),{el:n,destroy(){window.removeEventListener("scroll",s),n.remove();}}}var Xt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Zt=/[MmLlHhVvCcSsQqTtAaZz]/g;function Mr(e,r,t){if(!_e)return;let n=(e.match(Zt)??[]).join("").toUpperCase(),s=(r.match(Zt)??[]).join("").toUpperCase(),i=(e.match(Xt)??[]).length,a=(r.match(Xt)??[]).length;if(n!==s){R(`morphTo: command sequence differs (${n||"\u2205"} \u2192 ${s||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,t);return}i!==a&&R(`morphTo: coordinate count differs (${i} \u2192 ${a}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,t);}function Ar(e,r,t){let n=(r.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),s=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,i=>{let a=parseFloat(i),u=n[s++]??a;return String(+(a+(u-a)*t).toFixed(4))})}function Jt(e,r={}){return typeof window>"u"?{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0}:Ge(r,(t,n)=>Pr(e,t,n))}function Pr(e,r,t){let{preset:n,...s}=r,i=n?{...ht[n],...s}:s,{selector:a="path, polyline, line, polygon, rect, circle",speed:u=1,fade:m=false,easing:d="linear",trigger:v={},stagger:E=0,direction:y="forward",once:I=false,debug:oe=false,axis:f="y",scrollContainer:w,autoReverse:h=false,delay:x=0,strokeColor:b,strokeWidth:L,fillOpacity:U,waypoints:W,velocityScale:N=false,threshold:K=0,rootMargin:We="0px",repeat:ae=0,repeatDelay:pe=0,morphTo:B,clip:ee,autoplay:Me=false,duration:P=1e3,native:F=true,onProgress:Ce,onStart:X,onComplete:te,onEnter:de,onLeave:Ie,onEnterBack:ge,onLeaveBack:ue}=i,Z=ee===true?"left":typeof ee=="string"?ee:false,q=Le(d),He=xe(v.start||"top bottom"),Be=xe(v.end||"bottom top"),_=typeof w=="string"?document.querySelector(w):w??null,ye=Array.isArray(b)?b[0]:null,he=Array.isArray(b)?b[1]:typeof b=="string"?b:null,le=Array.isArray(L)?L[0]:null,Ae=Array.isArray(L)?L[1]:typeof L=="number"?L:null,be=Array.isArray(U)?U[0]:null,ce=Array.isArray(U)?U[1]:typeof U=="number"?U:null;function we(o){let c=o*100;switch(Z){case "right":return `inset(0 0 0 ${100-c}%)`;case "top":return `inset(0 0 ${100-c}% 0)`;case "bottom":return `inset(${100-c}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-c}% 0 0)`}}let l=Z?[]:Array.from(e.querySelectorAll(a)),p=[],V=[],M=0,$=0,O=E,k=0,Pe=0,z=false,ve=false,Ee=0,ct=-1,Xe=[],Ze=-1,se=false,me=0,De=0,Oe,ut=false,mt=null;function Et(){mt?.destroy(),mt=null;}let Re=new Set,St=NaN,Ne=true,Je=-1,xt=performance.now(),Fe=NaN;function Ke(){return _?f==="x"?_.scrollLeft:_.scrollTop:f==="x"?window.scrollX:window.scrollY}function Tt(){return _?f==="x"?_.clientWidth:_.clientHeight:f==="x"?window.innerWidth:window.innerHeight}function Mt(){let o=et(e,_,f);return $e(o,o.scroll,Tt(),He,Be)}function lr(){let o=$-M,c=l.length-1,g=_??document.documentElement,T=f==="x"?"Width":"Height";if(O=E,E>0&&c>0&&o>0){let j=g[`scroll${T}`]-g[`client${T}`]-1-M-o/u;j>=0&&(O=Math.min(E,j/(c*o)));}let G=Math.max(0,c)*O*o,re=o/Math.min(u,1);k=M+Math.min(0,G,re,G+re),Pe=M+Math.max(0,G,re,G+re);}function At(){(({tStart:M,tEnd:$}=Mt())),lr(),oe&&_e&&(Et(),mt=Tr(M,$,f));}function ft(o,c=Mt){Te(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:c});let g=o.destroy;return o.destroy=()=>{g.call(o),fe(e);},o}function Pt(o,c){return I&&!h?Math.max(ct,q(Xe[o]=Math.max(Xe[o]??0,c))):q(c)}function cr(o,c){if(e.style.setProperty("--scroll-draw-progress",String(o)),Z){let g=c==="reverse"?1-o:o;e.style.clipPath=we(g);return}l.forEach((g,T)=>pt(g,T,o,c));}function pt(o,c,g,T){o.style.strokeDashoffset=T==="reverse"?`${p[c]*g}`:`${p[c]*(1-g)}`,m&&(o.style.opacity=T==="reverse"?`${1-g}`:`${g}`),ye&&he?o.style.stroke=rt(ye,he,g):he&&(o.style.stroke=he),le!==null&&Ae!==null?o.style.strokeWidth=`${le+(Ae-le)*g}`:Ae!==null&&(o.style.strokeWidth=`${Ae}`),be!==null&&ce!==null?o.style.fillOpacity=`${be+(ce-be)*g}`:ce!==null&&(o.style.fillOpacity=`${ce}`),B&&o.tagName.toLowerCase()==="path"&&V[c]&&o.setAttribute("d",Ar(V[c],B,g));}function dt(){if(e.style.setProperty("--scroll-draw-progress","0"),Z){e.style.clipPath=we(y==="reverse"?1:0);return}l.forEach((o,c)=>{o.style.strokeDasharray=ze(p[c]),o.style.strokeDashoffset=y==="reverse"?"0":`${p[c]}`,m?o.style.opacity=y==="reverse"?"1":"0":o.style.opacity="",ye&&(o.style.stroke=ye),le!==null&&(o.style.strokeWidth=`${le}`),be!==null&&(o.style.fillOpacity=`${be}`),B&&o.tagName.toLowerCase()==="path"&&V[c]&&o.setAttribute("d",V[c]);});}function qe(o,c){let g=o.getAttribute("d"),T=tt(o);if(B&&V[c]){o.setAttribute("d",B);let G=tt(o);o.setAttribute("d",V[c]),T=Math.max(tt(o),G),o.setAttribute("d",g);}p[c]=T,o.style.strokeDasharray=ze(T);}if(l.forEach((o,c)=>{xr(o);let g=o.tagName.toLowerCase()==="path";g?V.push(o.getAttribute("d")??""):V.push(""),qe(o,c);let T=p[c];B&&(g?Mr(V[V.length-1],B,o):R(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),t?(o.style.strokeDashoffset=y==="reverse"?`${T}`:"0",m&&(o.style.opacity="1"),he&&(o.style.stroke=he),Ae!==null&&(o.style.strokeWidth=`${Ae}`),ce!==null&&(o.style.fillOpacity=`${ce}`),B&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",B)):(o.style.strokeDashoffset=y==="reverse"?"0":`${T}`,m?o.style.opacity=y==="reverse"?"1":"0":o.style.opacity="",ye&&(o.style.stroke=ye),le!==null&&(o.style.strokeWidth=`${le}`),be!==null&&(o.style.fillOpacity=`${be}`));}),t)return Z&&(e.style.clipPath=we(1)),te?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};Z&&(e.style.clipPath=we(y==="reverse"?1:0));let Lt=typeof d=="string"?nt(d):null;function ur(){return !(F===false||Me||oe&&_e||!Sr()||!l.length||!Lt||Z||f!=="y"||_||u!==1||E!==0||I||h||N!==false||B||W||ae||x>0||Ce||X||te||de||Ie||ge||ue||b!=null||L!=null||U!=null||(v.start||"top bottom").trim()!=="top bottom"||(v.end||"bottom top").trim()!=="bottom top")}function mr(){let o=++Er,c=`svg-scroll-draw-${o}`,g=`svg-scroll-draw-host-${o}`,T=`--svg-scroll-draw-${o}`,G=y==="reverse"?"0":"var(--ssd-len)",re=y==="reverse"?"var(--ssd-len)":"0",j=`stroke-dashoffset:${G};`,C=`stroke-dashoffset:${re};`;m&&(j+=`opacity:${y==="reverse"?1:0};`,C+=`opacity:${y==="reverse"?0:1};`);let D=document.createElement("style");D.setAttribute("data-svg-scroll-draw",""),D.textContent=`@keyframes ${c}{from{${j}}to{${C}}}.${g}{view-timeline-name:${T};view-timeline-axis:block;}.${c}{animation-name:${c};animation-duration:auto;animation-timing-function:${Lt};animation-fill-mode:both;animation-timeline:${T};animation-range:cover 0% cover 100%;}`,document.head.appendChild(D),e.classList.add(g);function J(S,A){S.style.setProperty("--ssd-len",String(p[A])),S.style.strokeDasharray=ze(p[A]),S.style.strokeDashoffset="",S.style.opacity="",S.style.animationPlayState="",S.classList.add(c);}l.forEach(J);let Y=false,ne=-1;function ie(){if(ne>=0)return ne;let S=e.getBoundingClientRect(),{tStart:A,tEnd:Q}=$e({top:S.top,height:S.height},Ke(),Tt(),He,Be);return q(H(Ke(),A,Q,u))}return {destroy(){e.classList.remove(g),l.forEach(S=>{S.classList.remove(c),S.style.removeProperty("--ssd-len"),S.style.animationPlayState="";}),D.remove();},replay(){Y=false,ne=-1,l.forEach(J);},pause(){Y=true,l.forEach(S=>{S.style.animationPlayState="paused";});},resume(){Y&&(Y=false,l.forEach(S=>{S.style.animationPlayState="running";}));},seek(S){let A=Math.min(1,Math.max(0,S));ne=A,Y=true,l.forEach((Q,Se)=>{Q.classList.remove(c),Q.style.strokeDashoffset=y==="reverse"?`${p[Se]*A}`:`${p[Se]*(1-A)}`,m&&(Q.style.opacity=y==="reverse"?`${1-A}`:`${A}`);});},getProgress(){return ie()},refresh(){l.forEach((S,A)=>{qe(S,A),S.style.setProperty("--ssd-len",String(p[A]));});}}}if(ur())return ft(mr());function fr(){let o=Math.max(1,P),c=Z?o:o*(1+Math.max(0,l.length-1)*E),g=0,T=0,G=false;function re(ne){let ie=true,S=Math.min(1,Math.max(0,ne/c));if(Z){let A=Math.min(1,Math.max(0,ne/o)),Q=q(A);me=Q,e.style.setProperty("--scroll-draw-progress",String(Q)),e.style.clipPath=we(y==="reverse"?1-Q:Q),Ce?.(Q),A<1&&(ie=false);}else {l.forEach((Q,Se)=>{let dr=Se*E*o,Ot=Math.min(1,Math.max(0,(ne-dr)/o));pt(Q,Se,q(Ot),y),Ot<1&&(ie=false);});let A=q(S);me=A,Ce?.(A),e.style.setProperty("--scroll-draw-progress",String(A));}if(W){let A=q(S);for(let Q in W){let Se=parseFloat(Q);A>=Se&&!Re.has(Se)&&(Re.add(Se),W[Q]?.());}}return ie}function j(ne){if(se)return;let ie=ne-g;ve||(ve=true,X?.());let S=re(ie);if(S&&!z){z=true,re(c),te?.(),De<(ae==="infinite"?1/0:ae??0)&&(De++,Oe=setTimeout(()=>{g=performance.now(),ve=false,z=false,Re.clear(),dt(),Ee=requestAnimationFrame(j);},pe));return}S||(Ee=requestAnimationFrame(j));}function C(){cancelAnimationFrame(Ee),clearTimeout(Oe),g=performance.now(),T=0,se=false,ve=false,z=false,De=0,G=true,me=0,Re.clear(),dt(),Ee=requestAnimationFrame(j);}let D=new IntersectionObserver(ne=>{ne.forEach(ie=>{ie.isIntersecting&&!(I&&z)?C():!ie.isIntersecting&&!I&&!z&&(cancelAnimationFrame(Ee),clearTimeout(Oe),G=false);});},{root:_??null,threshold:K,rootMargin:We}),J;function Y(){clearTimeout(J),J=setTimeout(()=>l.forEach(qe),150);}return window.addEventListener("resize",Y),window.addEventListener("orientationchange",Y),x>0?setTimeout(()=>D.observe(e),x):D.observe(e),{destroy(){cancelAnimationFrame(Ee),clearTimeout(Oe),D.disconnect(),window.removeEventListener("resize",Y),window.removeEventListener("orientationchange",Y),clearTimeout(J);},replay(){De=0,C();},pause(){se||!G||(se=true,T=performance.now()-g,cancelAnimationFrame(Ee));},resume(){se&&(se=false,G=true,g=performance.now()-T,Ee=requestAnimationFrame(j));},seek(ne){let ie=Math.min(1,Math.max(0,ne));me=ie,se=true,T=ie*c,g=performance.now()-T,cancelAnimationFrame(Ee),re(T);},getProgress(){return me},refresh(){clearTimeout(J),l.forEach(qe);}}}if(Me)return ft(fr());At();let $t=()=>H(Ke(),k,Pe,1);function kt(){z=true,te?.(),De<(ae==="infinite"?1/0:ae)&&(De++,Oe=setTimeout(()=>{ut=true;},pe));}function Ct(){ct=-1,Xe=[],ve=false,z=false,ut=false,Re.clear(),dt(),Ne=true;}function pr(){let o=performance.now(),c=Ke();if(ut&&$t()%1&&Ct(),!Ne&&N===false&&c===St)return;Ne=false,St=c;let g=u;if(N!==false){let C=o-xt,D=C>0?Math.abs(c-(Je<0?c:Je))/C:0;g=u*Math.max(.2,1+D*(typeof N=="number"?N:1)*.04);}Je=c,xt=o;let T=h?Ze===-1||c>=Ze?"forward":"reverse":y;Ze=c;let G=$-M,re=true,j=G===0?0:(c-M)/G;if(isNaN(Fe)||(Fe<=0&&j>0&&de?.(),Fe<1&&j>=1&&Ie?.(),Fe>=1&&j<1&&ge?.(),Fe>0&&j<=0&&ue?.()),Fe=j,Z){let C=Pt(0,H(c,M,$,g));me=C,e.style.setProperty("--scroll-draw-progress",String(C));let D=T==="reverse"?1-C:C;e.style.clipPath=we(D),Ce?.(C),!ve&&H(c,M,$,g)>0&&(ve=true,X?.()),C>=1&&!z?kt():C<1&&!I&&(z=false);return}if(l.forEach((C,D)=>{let J=D*O*G,Y=Pt(D,H(c,M+J,$+J,g));pt(C,D,Y,T),D===0&&(me=Y,Ce?.(Y),e.style.setProperty("--scroll-draw-progress",String(Y))),Y<1&&(re=false);}),W){let C=q(H(c,M,$,g));for(let D in W){let J=parseFloat(D);C>=J&&!Re.has(J)&&(Re.add(J),W[D]?.());}}!ve&&H(c,M,$,g)>0&&(ve=true,X?.()),re&&!z?kt():!re&&!I&&(z=false);}let je=ke(_??window,[e],$t,pr,()=>{let o=p.join();l.forEach(qe),At(),Ne=true,p.join()!==o&&Ye();}),gt=x>0;function Ye(){je.hold(se||gt);}let Dt;return gt&&(Dt=setTimeout(()=>{gt=false,Ye();},x)),Ye(),ft({destroy(){clearTimeout(Oe),clearTimeout(Dt),je.off(),Et();},replay(){Ct(),Ze=-1,Je=-1,De=0,se=false,me=0,clearTimeout(Oe),Ye();},pause(){se=true,je.hold(true);},resume(){se&&(se=false,Ne=true,Ye());},seek(o){let c=Math.min(1,Math.max(0,o));me=c,ct=c,Xe=[],se=true,je.hold(true),cr(c,y),Ne=true;},getProgress(){return me},refresh:je.remeasure},()=>({tStart:M,tEnd:$}))}function Lr(e,r){let t={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return t;let n=typeof e=="string"?document.querySelector(e):e;return n?Jt(n,r):(R("Container not found:",e),t)}function $r(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Kt(e){let r=[],t=/([\w]+)\(([^)]*)\)/g,n;for(;(n=t.exec(e))!==null;){let s=[],i=[],a=n[2].trim();if(a)for(let u of a.split(/[\s,]+/)){let m=u.match(/^([-+]?[\d.eE]+)(.*)$/);s.push(m?parseFloat(m[1]):0),i.push(m?m[2]:"");}r.push({fn:n[1],nums:s,units:i});}return r}function kr(e,r,t){let n=Kt(e),s=Kt(r);return n.length===0||n.length!==s.length?t<1?e:r:n.map((i,a)=>{let u=s[a];return i.fn!==u.fn||i.nums.length!==u.nums.length?t<1?`${i.fn}(${i.nums.map((m,d)=>`${m}${i.units[d]}`).join(", ")})`:`${u.fn}(${u.nums.map((m,d)=>`${m}${u.units[d]}`).join(", ")})`:`${i.fn}(${i.nums.map((m,d)=>`${m+(u.nums[d]-m)*t}${i.units[d]}`).join(", ")})`}).join(" ")}function er(e,r,t){if(typeof e=="number"&&typeof r=="number")return String(e+(r-e)*t);let n=String(e),s=String(r);if($r(n))return rt(n,s,t);if(n.includes("("))return kr(n,s,t);let i=n.match(/^([-+]?[\d.]+)(.*)$/),a=s.match(/^([-+]?[\d.]+)(.*)$/);if(i&&a){let u=parseFloat(i[1]),m=parseFloat(a[1]);return `${u+(m-u)*t}${i[2]||a[2]}`}return t<1?n:s}function Cr(e){return e.replace(/([A-Z])/g,r=>`-${r.toLowerCase()}`)}var Dr=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Or=0,tr="--scroll-draw-progress";function Rr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var nr={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function bt(e,r){return typeof window>"u"?nr:r.respectReducedMotion===false?rr(e,r,false):Ge(r,(t,n)=>rr(e,t,n))}function rr(e,r,t){let{props:n,trigger:s={},easing:i="ease-out",speed:a=1,once:u=false,axis:m="y",scrollContainer:d,native:v=true,velocityScale:E=false,triggerElement:y,onProgress:I,onComplete:oe,onEnter:f,onLeave:w,onEnterBack:h,onLeaveBack:x}=r,b=Le(i,"ease-out"),L=xe(s.start||"top bottom"),U=xe(s.end||"bottom top"),W=y??e,N=typeof d=="string"?document.querySelector(d):d??null,K=Object.entries(n).map(([l,p])=>({prop:Cr(l),from:Array.isArray(p)?p[0]:"",to:Array.isArray(p)?p[1]:p}));function We(){let l=window.getComputedStyle(e);for(let p of K)p.from===""&&(p.from=l.getPropertyValue(p.prop).trim()||"0");}function ae(){for(let l of K)e.style.setProperty(l.prop,String(l.to));}let pe=new Map;for(let l of [...K.map(p=>p.prop),tr])pe.set(l,e.style.getPropertyValue(l));function B(){for(let[l,p]of pe)p?e.style.setProperty(l,p):e.style.removeProperty(l);}if(t)return ae(),oe?.(),{...nr,destroy:B,getProgress:()=>1};We();let ee=()=>N?m==="x"?N.scrollLeft:N.scrollTop:m==="x"?window.scrollX:window.scrollY,Me=()=>N?m==="x"?N.clientWidth:N.clientHeight:m==="x"?window.innerWidth:window.innerHeight,P=typeof i=="string"?nt(i):null;function F(){if(!v||!Rr()||!P||m!=="y"||N||W!==e||u||a!==1||I||oe||f||w||h||x||E!==false||(s.start||"top bottom").trim()!=="top bottom"||(s.end||"bottom top").trim()!=="bottom top")return false;for(let l of K)if(!Dr.has(l.prop))return false;return true}function Ce(){let l=`ssd-a-${++Or}`,p=K.map(k=>`${k.prop}:${k.from}`).join(";"),V=K.map(k=>`${k.prop}:${k.to}`).join(";"),M=document.createElement("style");M.setAttribute("data-ssd-animate",""),M.textContent=`@keyframes ${l}{from{${p}}to{${V}}}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${P};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(M),e.classList.add(l);let $=()=>{let k=e.getBoundingClientRect();return $e({top:k.top,height:k.height},ee(),Me(),L,U)};Te(e,{type:"animate",getProgress:()=>O.getProgress(),getTrigger:$});let O={refresh(){},destroy(){e.classList.remove(l),M.remove(),e.style.animationPlayState="",B(),fe(e);},replay(){e.classList.remove(l),e.offsetWidth,e.classList.add(l);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(k){let Pe=Math.min(1,Math.max(0,k));e.classList.remove(l);for(let z of K)e.style.setProperty(z.prop,er(z.from,z.to,Pe));},getProgress(){let{tStart:k,tEnd:Pe}=$();return b(H(ee(),k,Pe,a))}};return O}if(F())return Ce();let X=0,te=0,de=false,Ie=-1,ge=0,ue=0,Z=false,q=NaN,He=-1,Be=0,_=W===e?K:[],ye=false;function he(){let l=e.style,p=_.map(O=>l.getPropertyValue(O.prop)),V=l.transition;_.length&&(l.transition="none"),_.forEach(O=>l.setProperty(O.prop,pe.get(O.prop)??""));let M=et(W,N,m);_.forEach((O,k)=>l.setProperty(O.prop,p[k])),_.length&&(e.offsetWidth,l.transition=V);let $=$e(M,M.scroll,Me(),L,U);ye&&Math.abs($.tStart-X)<1&&Math.abs($.tEnd-te)<1||(ye=true,X=$.tStart,te=$.tEnd);}function le(l){e.style.setProperty(tr,String(l));for(let p of K)e.style.setProperty(p.prop,er(p.from,p.to,l));I?.(l);}function Ae(l){if(isNaN(q)){q=l;return}q<=0&&l>0&&f?.(),q<1&&l>=1&&w?.(),q>=1&&l<1&&h?.(),q>0&&l<=0&&x?.(),q=l;}function be(){if(de)return;let l=performance.now(),p=ee(),V=a;if(E!==false){let k=l-Be,Pe=k>0?Math.abs(p-(He<0?p:He))/k:0;V=a*Math.max(.2,1+Pe*(typeof E=="number"?E:1)*.04);}He=p,Be=l;let M=te===X?0:(p-X)/(te-X);Ae(M);let $=H(p,X,te,V),O=u?Math.max(Ie,b(ge=Math.max(ge,$))):b($);ue=O,le(O),O>=1&&!Z?(Z=true,oe?.()):O<1&&!u&&(Z=false);}let ce=ke(N??window,[W],()=>H(ee(),X,te,Math.min(a,1)),be,he);he(),te===X&&R("scrollAnimate: zero-length trigger window, so it never animates. In a sticky stage, set triggerElement.",e),ge=H(ee(),X,te,a),ue=b(ge),le(ue),Te(e,{type:"animate",getProgress:()=>ue,getTrigger:()=>({tStart:X,tEnd:te})});function we(){de=true,ce.hold(true);}return {destroy(){de=true,ce.off(),B(),fe(e);},replay(){Ie=-1,ge=0,Z=false,ue=0,de=false,le(0),ce.hold(false);},pause:we,resume(){de&&(de=false,ce.hold(false));},seek(l){let p=Math.min(1,Math.max(0,l));ue=p,Ie=p,ge=0,we(),le(p);},getProgress(){return ue},refresh:ce.remeasure}}var at={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Ir(e,r){if(typeof window>"u")return at;let t=typeof e=="string"?document.querySelector(e):e;return t?bt(t,r):(R("scrollAnimate: element not found:",e),at)}function Hr(e,r={}){if(typeof window>"u")return at;let t=typeof e=="string"?document.querySelector(e):e;if(!t)return R("scrollParallax: element not found:",e),at;let{speed:n=.3,axis:s="y",easing:i="linear",trigger:a,onProgress:u}=r,m=-n*100,d=t.style,v=!!t.ownerSVGElement,E=d.getPropertyValue("transform-box");v&&d.setProperty("transform-box","fill-box");let y=bt(t,{props:s==="x"?{transform:["translateX(0%)",`translateX(${m}%)`]}:{transform:["translateY(0%)",`translateY(${m}%)`]},trigger:a??{start:"top bottom",end:"bottom top"},easing:i,native:false,onProgress:u});return v?{...y,destroy(){y.destroy(),d.setProperty("transform-box",E);}}:y}var wt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Nr(e,r){if(typeof window>"u")return wt;let t=typeof e=="string"?document.querySelector(e):e;return t?Ge(r,(n,s)=>Fr(t,n,s)):(R("scrollCounter: element not found:",e),wt)}function Fr(e,r,t){let{from:n=0,to:s,format:i,easing:a="ease-out",trigger:u={},once:m=true,decimals:d,onComplete:v}=r,E=d!==void 0?P=>P.toFixed(d):i??(P=>String(Math.round(P))),y=Le(a,"ease-out"),I=xe(u.start||"top 80%"),oe=xe(u.end||"top 20%");if(t)return e.textContent=E(s),v?.(),{...wt,getProgress:()=>1};let f=0,w=0,h=false,x=-1,b=0,L=0,U=false,W=()=>window.scrollY,N=()=>window.innerHeight;function K(){let P=e.getBoundingClientRect(),F=$e({top:P.top,height:P.height},W(),N(),I,oe);h&&Math.abs(F.tStart-f)<1&&Math.abs(F.tEnd-w)<1||(h=true,f=F.tStart,w=F.tEnd);}let We=e.style.getPropertyValue("--scroll-draw-progress");function ae(P){e.textContent=E(n+(s-n)*P),e.style.setProperty("--scroll-draw-progress",String(P));}let pe=()=>H(W(),f,w,1);function B(){let P=pe(),F=m?Math.max(x,y(b=Math.max(b,P))):y(P);L=F,ae(F),F>=1&&!U?(U=true,v?.()):F<1&&!m&&(U=false);}K();{b=H(W(),f,w,1);let P=y(b);L=P,ae(P);}let ee=ke(window,[e],pe,B,K);Te(e,{type:"counter",getProgress:()=>L,getTrigger:()=>({tStart:f,tEnd:w})});let Me=()=>ee.hold(false);return {destroy(){ee.off(),e.style.setProperty("--scroll-draw-progress",We),fe(e);},replay(){x=-1,b=0,U=false,L=0,ae(0),Me();},pause:()=>ee.hold(true),resume:Me,seek(P){let F=Math.min(1,Math.max(0,P));L=F,x=F,b=0,ee.hold(true),ae(F);},getProgress(){return L}}}var or="http://www.w3.org/2000/svg",_r="cinematic-photo",ar=e=>e<0?0:e>1?1:e;function lt(e){let r=parseFloat(e);return Number.isFinite(r)?ar(r/100):0}function sr(e){return Le(e)}var ir=e=>({destroy(){},getProgress:()=>e}),vt=class{constructor(r){if(typeof document>"u"){this.mount=null;return}this.mount=typeof r.wrapper=="string"?document.querySelector(r.wrapper):r.wrapper,this.mount||R("Cinematic: wrapper not found:",r.wrapper);}loadStory(r){let t=this.mount;if(typeof window>"u"||!t)return ir(0);t.style.position="relative",t.style.height=r.totalHeight,t.style.display="block";let n=document.createElement("div");n.setAttribute("data-cinematic-stage",""),n.style.cssText="position:sticky;top:0;height:100vh;width:100%;overflow:hidden;display:block;",t.appendChild(n);let s=[];for(let f of r.scenes){if(f.background){let h=document.createElement("img");h.id=_r,h.src=f.background,h.alt="",h.style.cssText="position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:0;pointer-events:none;",n.appendChild(h);}let w=f.animations.filter(h=>h.type==="draw");if(w.length){let h=document.createElementNS(or,"svg");h.setAttribute("viewBox",`0 0 ${r.canvas.width} ${r.canvas.height}`),h.setAttribute("preserveAspectRatio","xMidYMid meet"),h.style.cssText="position:absolute;inset:0;width:100%;height:100%;overflow:visible;",n.appendChild(h);for(let x of w){let b=document.createElementNS(or,"path");b.id=x.target.replace(/^#/,""),b.setAttribute("d",x.d),b.setAttribute("fill","none"),b.setAttribute("stroke",x.stroke),b.setAttribute("stroke-width",String(x.strokeWidth)),b.setAttribute("stroke-linecap","round"),b.setAttribute("stroke-linejoin","round");let L=x.length||b.getTotalLength?.()||0;b.style.strokeDasharray=ze(L),b.style.strokeDashoffset=String(L),h.appendChild(b),s.push({kind:"draw",el:b,start:lt(x.start),end:lt(x.end),ease:sr(x.easing),length:L});}}for(let h of f.animations){if(h.type!=="fade")continue;let x=n.querySelector(h.target)??document.querySelector(h.target);x&&(x.style.opacity=String(h.from),s.push({kind:"fade",el:x,start:lt(h.start),end:lt(h.end),ease:sr("ease-in-out"),from:h.from,to:h.to}));}}let i=0,a=null;for(let f=t.parentElement;f?.parentElement;f=f.parentElement)if(/[ao]/.test(getComputedStyle(f).overflowY)&&f.scrollHeight>f.clientHeight&&(f!==document.body||/[aoh]/.test(getComputedStyle(f.parentElement).overflowY))){a=f;break}let u=0,m=0,d=()=>{let f=t.getBoundingClientRect().top;u=a?f-a.getBoundingClientRect().top-a.clientTop+a.scrollTop:f+window.scrollY,m=u+Math.max(0,t.offsetHeight-(a?a.clientHeight:window.innerHeight));},v=()=>{let f=a?a.scrollTop:window.scrollY;return m<=u?f>=u?1:0:H(f,u,m,1)},E=f=>{for(let w of s){let h=w.end-w.start,x=h<=0?f>=w.end?1:0:ar((f-w.start)/h),b=w.ease(x);w.kind==="draw"?w.el.style.strokeDashoffset=String(w.length*(1-b)):w.el.style.opacity=String(w.from+(w.to-w.from)*b);}};if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return E(1),ir(1);let y=()=>{i=v(),E(i);};d(),y();let I=ke(a||window,[t],v,y,d);Te(t,{type:"draw",getProgress:()=>i,getTrigger:()=>({tStart:u,tEnd:m})});let oe=ot(f=>{f&&(oe(),I.off(),fe(t),i=1,E(1));});return {destroy(){oe(),I.off(),fe(t);},getProgress:()=>i}}};
|
|
4
|
+
exports.Cinematic=vt;exports.PRESETS=ht;exports.createBounce=Ht;exports.createElastic=Nt;exports.createSpring=It;exports.scrollAnimate=Ir;exports.scrollCounter=Nr;exports.scrollDraw=Lr;exports.scrollParallax=Hr;
|
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { a as ScrollDrawOptions } from './types-
|
|
2
|
-
export { P as PresetName, S as ScrollDrawInstance } from './types-
|
|
3
|
-
export { s as scrollDraw } from './scroll-draw-
|
|
4
|
-
export { S as ScrollParallaxOptions, s as scrollAnimate, a as scrollParallax } from './index-
|
|
5
|
-
export { S as ScrollCounterOptions, s as scrollCounter } from './index-
|
|
1
|
+
import { a as ScrollDrawOptions } from './types-iITMwrru.mjs';
|
|
2
|
+
export { C as CssEasing, E as Easing, P as PresetName, S as ScrollDrawInstance } from './types-iITMwrru.mjs';
|
|
3
|
+
export { s as scrollDraw } from './scroll-draw-CKZysh22.mjs';
|
|
4
|
+
export { S as ScrollParallaxOptions, s as scrollAnimate, a as scrollParallax } from './index-ClAFxNEp.mjs';
|
|
5
|
+
export { S as ScrollCounterOptions, s as scrollCounter } from './index-BMMZ8aW7.mjs';
|
|
6
6
|
export { Cinematic, CinematicInstance, CinematicOptions, DrawAnimation, FadeAnimation, Story, StoryAnimation, StoryEasing, StoryScene } from './cinematic/index.mjs';
|
|
7
|
-
export { S as ScrollAnimateOptions } from './engine-
|
|
7
|
+
export { S as ScrollAnimateOptions } from './engine-Bi2x8-X-.mjs';
|
|
8
8
|
|
|
9
9
|
type PresetName = 'sketch' | 'reveal' | 'typewriter' | 'cinematic' | 'spring';
|
|
10
10
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { a as ScrollDrawOptions } from './types-
|
|
2
|
-
export { P as PresetName, S as ScrollDrawInstance } from './types-
|
|
3
|
-
export { s as scrollDraw } from './scroll-draw-
|
|
4
|
-
export { S as ScrollParallaxOptions, s as scrollAnimate, a as scrollParallax } from './index-
|
|
5
|
-
export { S as ScrollCounterOptions, s as scrollCounter } from './index-
|
|
1
|
+
import { a as ScrollDrawOptions } from './types-iITMwrru.js';
|
|
2
|
+
export { C as CssEasing, E as Easing, P as PresetName, S as ScrollDrawInstance } from './types-iITMwrru.js';
|
|
3
|
+
export { s as scrollDraw } from './scroll-draw-DbY8RUJE.js';
|
|
4
|
+
export { S as ScrollParallaxOptions, s as scrollAnimate, a as scrollParallax } from './index-CEMsUTEG.js';
|
|
5
|
+
export { S as ScrollCounterOptions, s as scrollCounter } from './index-MdQ4ti_z.js';
|
|
6
6
|
export { Cinematic, CinematicInstance, CinematicOptions, DrawAnimation, FadeAnimation, Story, StoryAnimation, StoryEasing, StoryScene } from './cinematic/index.js';
|
|
7
|
-
export { S as ScrollAnimateOptions } from './engine-
|
|
7
|
+
export { S as ScrollAnimateOptions } from './engine-DAlvk6i0.js';
|
|
8
8
|
|
|
9
9
|
type PresetName = 'sketch' | 'reveal' | 'typewriter' | 'cinematic' | 'spring';
|
|
10
10
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as scrollAnimate,b as scrollParallax}from'./chunk-
|
|
1
|
+
export{a as scrollAnimate,b as scrollParallax}from'./chunk-UBH4K5YD.mjs';export{a as Cinematic}from'./chunk-ASCOHQQD.mjs';export{a as scrollDraw}from'./chunk-5U4JXBHR.mjs';export{a as scrollCounter}from'./chunk-Z72TVDHY.mjs';import'./chunk-HAGTU5EX.mjs';export{a as PRESETS}from'./chunk-XLXVGQ3P.mjs';import'./chunk-7LDSB4FT.mjs';import'./chunk-UPWWULKI.mjs';import'./chunk-XC5NR2MU.mjs';import'./chunk-YOOPMYT6.mjs';import'./chunk-2PYLM3E7.mjs';import'./chunk-NV6YTPHI.mjs';export{b as createBounce,c as createElastic,a as createSpring}from'./chunk-IXR6RML7.mjs';import'./chunk-4DOJSIEQ.mjs';import'./chunk-5PJEKEEP.mjs';import'./chunk-EBU6E26L.mjs';import'./chunk-LFSU6LR3.mjs';
|
package/dist/lenis/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var a={destroy:()=>{},getScrollY:()=>0};function d(c){if(typeof window>"u")return a;let r=window.scrollY,n=["scrollY","pageYOffset"],s=n.map(e=>Object.getOwnPropertyDescriptor(window,e)),t=false,l=e=>{r=e.scroll;try{for(let o of n)Object.defineProperty(window,o,{get:()=>r,configurable:!0});t=!0;}catch{}};return c.on("scroll",l),{destroy(){c.off("scroll",l),t&&(t=false,n.forEach((e,o)=>{try{let i=s[o];i?Object.defineProperty(window,e,i):delete window[e];}catch{}}));},getScrollY(){return r}}}exports.createLenisAdapter=d;
|
package/dist/lenis/index.d.mts
CHANGED
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Lenis smooth-scroll adapter for svg-scroll-draw.
|
|
3
3
|
*
|
|
4
|
-
* Lenis
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* `window.
|
|
4
|
+
* Lenis itself does not need it. Every Lenis release so far (the 1.x line;
|
|
5
|
+
* 2.0 exists only as development prereleases) moves the real scroll position
|
|
6
|
+
* on every frame: its `setScroll()` calls `wrapper.scrollTo({ behavior:
|
|
7
|
+
* 'instant' })`, so `window.scrollY` already follows the smooth scroll and
|
|
8
|
+
* every svg-scroll-draw engine reads it with no adapter.
|
|
9
|
+
*
|
|
10
|
+
* The adapter is for a setup that keeps a virtual scroll value and does NOT
|
|
11
|
+
* move the page: any object with Lenis's `on('scroll')` / `off('scroll')`
|
|
12
|
+
* shape. It patches `window.scrollY` / `window.pageYOffset` to that value, and
|
|
13
|
+
* `destroy()` puts the browser's own properties back.
|
|
8
14
|
*
|
|
9
15
|
* Usage:
|
|
10
|
-
* import Lenis from '@studio-freight/lenis'
|
|
11
16
|
* import { createLenisAdapter } from 'svg-scroll-draw/lenis'
|
|
12
17
|
*
|
|
13
|
-
*
|
|
14
|
-
* const adapter = createLenisAdapter(
|
|
15
|
-
*
|
|
16
|
-
* // RAF loop — let Lenis drive the tick
|
|
17
|
-
* function raf(time: number) {
|
|
18
|
-
* lenis.raf(time)
|
|
19
|
-
* requestAnimationFrame(raf)
|
|
20
|
-
* }
|
|
21
|
-
* requestAnimationFrame(raf)
|
|
18
|
+
* // `scroller` emits 'scroll' with { scroll, velocity, direction, progress }
|
|
19
|
+
* const adapter = createLenisAdapter(scroller)
|
|
22
20
|
*
|
|
23
21
|
* // On cleanup:
|
|
24
22
|
* adapter.destroy()
|
|
@@ -34,7 +32,7 @@ interface LenisLike {
|
|
|
34
32
|
off(event: 'scroll', callback: (e: LenisScrollEvent) => void): void;
|
|
35
33
|
}
|
|
36
34
|
interface LenisAdapterInstance {
|
|
37
|
-
/** Restore
|
|
35
|
+
/** Restore the browser's own `window.scrollY` / `pageYOffset` and remove the listener. */
|
|
38
36
|
destroy: () => void;
|
|
39
37
|
/** Returns the current virtual scroll Y value Lenis last reported. */
|
|
40
38
|
getScrollY: () => number;
|
|
@@ -44,7 +42,8 @@ interface LenisAdapterInstance {
|
|
|
44
42
|
* virtual scroll position so all svg-scroll-draw engines stay in sync
|
|
45
43
|
* with smooth scroll.
|
|
46
44
|
*
|
|
47
|
-
*
|
|
45
|
+
* Not needed for Lenis 1.x, which scrolls the page itself; only for a
|
|
46
|
+
* scroller that reports a virtual position without moving the page.
|
|
48
47
|
*/
|
|
49
48
|
declare function createLenisAdapter(lenis: LenisLike): LenisAdapterInstance;
|
|
50
49
|
|
package/dist/lenis/index.d.ts
CHANGED
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Lenis smooth-scroll adapter for svg-scroll-draw.
|
|
3
3
|
*
|
|
4
|
-
* Lenis
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* `window.
|
|
4
|
+
* Lenis itself does not need it. Every Lenis release so far (the 1.x line;
|
|
5
|
+
* 2.0 exists only as development prereleases) moves the real scroll position
|
|
6
|
+
* on every frame: its `setScroll()` calls `wrapper.scrollTo({ behavior:
|
|
7
|
+
* 'instant' })`, so `window.scrollY` already follows the smooth scroll and
|
|
8
|
+
* every svg-scroll-draw engine reads it with no adapter.
|
|
9
|
+
*
|
|
10
|
+
* The adapter is for a setup that keeps a virtual scroll value and does NOT
|
|
11
|
+
* move the page: any object with Lenis's `on('scroll')` / `off('scroll')`
|
|
12
|
+
* shape. It patches `window.scrollY` / `window.pageYOffset` to that value, and
|
|
13
|
+
* `destroy()` puts the browser's own properties back.
|
|
8
14
|
*
|
|
9
15
|
* Usage:
|
|
10
|
-
* import Lenis from '@studio-freight/lenis'
|
|
11
16
|
* import { createLenisAdapter } from 'svg-scroll-draw/lenis'
|
|
12
17
|
*
|
|
13
|
-
*
|
|
14
|
-
* const adapter = createLenisAdapter(
|
|
15
|
-
*
|
|
16
|
-
* // RAF loop — let Lenis drive the tick
|
|
17
|
-
* function raf(time: number) {
|
|
18
|
-
* lenis.raf(time)
|
|
19
|
-
* requestAnimationFrame(raf)
|
|
20
|
-
* }
|
|
21
|
-
* requestAnimationFrame(raf)
|
|
18
|
+
* // `scroller` emits 'scroll' with { scroll, velocity, direction, progress }
|
|
19
|
+
* const adapter = createLenisAdapter(scroller)
|
|
22
20
|
*
|
|
23
21
|
* // On cleanup:
|
|
24
22
|
* adapter.destroy()
|
|
@@ -34,7 +32,7 @@ interface LenisLike {
|
|
|
34
32
|
off(event: 'scroll', callback: (e: LenisScrollEvent) => void): void;
|
|
35
33
|
}
|
|
36
34
|
interface LenisAdapterInstance {
|
|
37
|
-
/** Restore
|
|
35
|
+
/** Restore the browser's own `window.scrollY` / `pageYOffset` and remove the listener. */
|
|
38
36
|
destroy: () => void;
|
|
39
37
|
/** Returns the current virtual scroll Y value Lenis last reported. */
|
|
40
38
|
getScrollY: () => number;
|
|
@@ -44,7 +42,8 @@ interface LenisAdapterInstance {
|
|
|
44
42
|
* virtual scroll position so all svg-scroll-draw engines stay in sync
|
|
45
43
|
* with smooth scroll.
|
|
46
44
|
*
|
|
47
|
-
*
|
|
45
|
+
* Not needed for Lenis 1.x, which scrolls the page itself; only for a
|
|
46
|
+
* scroller that reports a virtual position without moving the page.
|
|
48
47
|
*/
|
|
49
48
|
declare function createLenisAdapter(lenis: LenisLike): LenisAdapterInstance;
|
|
50
49
|
|
package/dist/lenis/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var a={destroy:()=>{},getScrollY:()=>0};function d(c){if(typeof window>"u")return a;let r=window.scrollY,n=["scrollY","pageYOffset"],s=n.map(e=>Object.getOwnPropertyDescriptor(window,e)),t=false,l=e=>{r=e.scroll;try{for(let o of n)Object.defineProperty(window,o,{get:()=>r,configurable:!0});t=!0;}catch{}};return c.on("scroll",l),{destroy(){c.off("scroll",l),t&&(t=false,n.forEach((e,o)=>{try{let i=s[o];i?Object.defineProperty(window,e,i):delete window[e];}catch{}}));},getScrollY(){return r}}}export{d as createLenisAdapter};
|
package/dist/nuxt/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
'use strict';var vue=require('vue');function
|
|
2
|
-
<div style="position:absolute;${
|
|
3
|
-
<div style="position:absolute;${f?`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(r),window.addEventListener("scroll",o,{passive:true}),o(),{el:r,destroy(){window.removeEventListener("scroll",o),r.remove();}}}var nn=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,rn=/[MmLlHhVvCcSsQqTtAaZz]/g;function Vn(e,t,n){if(!ze)return;let r=(e.match(rn)??[]).join("").toUpperCase(),o=(t.match(rn)??[]).join("").toUpperCase(),s=(e.match(nn)??[]).length,a=(t.match(nn)??[]).length;if(r!==o){ae(`morphTo: command sequence differs (${r||"\u2205"} \u2192 ${o||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,n);return}s!==a&&ae(`morphTo: coordinate count differs (${s} \u2192 ${a}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,n);}function Fn(e,t,n){let r=(t.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),o=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,s=>{let a=parseFloat(s),u=r[o++]??a;return String(+(a+(u-a)*n).toFixed(4))})}function wt(e,t={}){return typeof window>"u"?{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0}:Ve(t,(n,r)=>_n(e,n,r))}function _n(e,t,n){let{preset:r,...o}=t,s=r?{...Qt[r],...o}:o,{selector:a="path, polyline, line, polygon, rect, circle",speed:u=1,fade:f=false,easing:p="linear",trigger:g={},stagger:x=0,direction:y="forward",once:R=false,debug:j=false,axis:w="y",scrollContainer:D,autoReverse:ue=false,delay:H=0,strokeColor:M,strokeWidth:C,fillOpacity:O,waypoints:S,velocityScale:A=false,threshold:N=0,rootMargin:te="0px",repeat:q=0,repeatDelay:V=0,morphTo:I,clip:v,autoplay:Q=false,duration:h=1e3,native:P=true,onProgress:Ee,onStart:U,onComplete:_,onEnter:fe,onLeave:Te,onEnterBack:ge,onLeaveBack:me}=s,b=v===true?"left":typeof v=="string"?v:false,E=typeof p=="function"?p:ee[p]??ee.linear,ye=ie(g.start||"top bottom"),He=ie(g.end||"bottom top"),X=typeof D=="string"?document.querySelector(D):D??null,Ae=Array.isArray(M)?M[0]:null,Pe=Array.isArray(M)?M[1]:typeof M=="string"?M:null,he=Array.isArray(C)?C[0]:null,Ne=Array.isArray(C)?C[1]:typeof C=="number"?C:null,Oe=Array.isArray(O)?O[0]:null,be=Array.isArray(O)?O[1]:typeof O=="number"?O:null;function ke(i){let c=i*100;switch(b){case "right":return `inset(0 0 0 ${100-c}%)`;case "top":return `inset(0 0 ${100-c}% 0)`;case "bottom":return `inset(${100-c}% 0 0 0)`;case "center":return `circle(${i*150}% at 50% 50%)`;default:return `inset(0 ${100-c}% 0 0)`}}let l=b?[]:Array.from(e.querySelectorAll(a)),m=[],K=[],k=0,F=0,Y=x,G=0,Ie=0,Z=false,$e=false,Re=0,mt=-1,et=[],tt=-1,pe=false,xe=0,Fe=0,_e,pt=false,dt=null;function kt(){dt?.destroy(),dt=null;}let Ge=new Set,$t=NaN,We=true,nt=-1,Rt=performance.now(),Be=NaN;function rt(){return X?w==="x"?X.scrollLeft:X.scrollTop:w==="x"?window.scrollX:window.scrollY}function Dt(){return X?w==="x"?X.clientWidth:X.clientHeight:w==="x"?window.innerWidth:window.innerHeight}function Ht(){let i=ot(e,X,w);return we(i,i.scroll,Dt(),ye,He)}function wn(){let i=F-k,c=l.length-1,d=X??document.documentElement,L=w==="x"?"Width":"Height";if(Y=x,x>0&&c>0&&i>0){let ne=d[`scroll${L}`]-d[`client${L}`]-1-k-i/u;ne>=0&&(Y=Math.min(x,ne/(c*i)));}let J=Math.max(0,c)*Y*i,le=i/Math.min(u,1);G=k+Math.min(0,J,le,J+le),Ie=k+Math.max(0,J,le,J+le);}function Nt(){(({tStart:k,tEnd:F}=Ht())),wn(),j&&ze&&(kt(),dt=In(k,F,w));}function gt(i,c=Ht){Se(e,{type:"draw",getProgress:()=>i.getProgress(),getTrigger:c});let d=i.destroy;return i.destroy=()=>{d.call(i),ve(e);},i}function It(i,c){return R&&!ue?Math.max(mt,E(et[i]=Math.max(et[i]??0,c))):E(c)}function Sn(i,c){if(e.style.setProperty("--scroll-draw-progress",String(i)),b){let d=c==="reverse"?1-i:i;e.style.clipPath=ke(d);return}l.forEach((d,L)=>yt(d,L,i,c));}function yt(i,c,d,L){i.style.strokeDashoffset=L==="reverse"?`${m[c]*d}`:`${m[c]*(1-d)}`,f&&(i.style.opacity=L==="reverse"?`${1-d}`:`${d}`),Ae&&Pe?i.style.stroke=it(Ae,Pe,d):Pe&&(i.style.stroke=Pe),he!==null&&Ne!==null?i.style.strokeWidth=`${he+(Ne-he)*d}`:Ne!==null&&(i.style.strokeWidth=`${Ne}`),Oe!==null&&be!==null?i.style.fillOpacity=`${Oe+(be-Oe)*d}`:be!==null&&(i.style.fillOpacity=`${be}`),I&&i.tagName.toLowerCase()==="path"&&K[c]&&i.setAttribute("d",Fn(K[c],I,d));}function ht(){if(e.style.setProperty("--scroll-draw-progress","0"),b){e.style.clipPath=ke(y==="reverse"?1:0);return}l.forEach((i,c)=>{i.style.strokeDasharray=`${m[c]}`,i.style.strokeDashoffset=y==="reverse"?"0":`${m[c]}`,f?i.style.opacity=y==="reverse"?"1":"0":i.style.opacity="",Ae&&(i.style.stroke=Ae),he!==null&&(i.style.strokeWidth=`${he}`),Oe!==null&&(i.style.fillOpacity=`${Oe}`),I&&i.tagName.toLowerCase()==="path"&&K[c]&&i.setAttribute("d",K[c]);});}function je(i,c){let d=i.getAttribute("d"),L=st(i);if(I&&K[c]){i.setAttribute("d",I);let J=st(i);i.setAttribute("d",K[c]),L=Math.max(st(i),J),i.setAttribute("d",d);}m[c]=L,i.style.strokeDasharray=`${L}`;}if(l.forEach((i,c)=>{Nn(i);let d=i.tagName.toLowerCase()==="path";d?K.push(i.getAttribute("d")??""):K.push(""),je(i,c);let L=m[c];I&&(d?Vn(K[K.length-1],I,i):ae(`morphTo only applies to <path> elements \u2014 ignored on <${i.tagName}>.`,i)),n?(i.style.strokeDashoffset=y==="reverse"?`${L}`:"0",f&&(i.style.opacity="1"),Pe&&(i.style.stroke=Pe),Ne!==null&&(i.style.strokeWidth=`${Ne}`),be!==null&&(i.style.fillOpacity=`${be}`),I&&i.tagName.toLowerCase()==="path"&&i.setAttribute("d",I)):(i.style.strokeDashoffset=y==="reverse"?"0":`${L}`,f?i.style.opacity=y==="reverse"?"1":"0":i.style.opacity="",Ae&&(i.style.stroke=Ae),he!==null&&(i.style.strokeWidth=`${he}`),Oe!==null&&(i.style.fillOpacity=`${Oe}`));}),n)return b&&(e.style.clipPath=ke(1)),_?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};b&&(e.style.clipPath=ke(y==="reverse"?1:0));let Vt=typeof p=="string"?at(p):null;function vn(){return !(P===false||Q||j&&ze||!Hn()||!l.length||!Vt||b||w!=="y"||X||u!==1||x!==0||R||ue||A!==false||I||S||q||H>0||Ee||U||_||fe||Te||ge||me||M!=null||C!=null||O!=null||(g.start||"top bottom").trim()!=="top bottom"||(g.end||"bottom top").trim()!=="bottom top")}function En(){let i=++Dn,c=`svg-scroll-draw-${i}`,d=`svg-scroll-draw-host-${i}`,L=`--svg-scroll-draw-${i}`,J=y==="reverse"?"0":"var(--ssd-len)",le=y==="reverse"?"var(--ssd-len)":"0",ne=`stroke-dashoffset:${J};`,W=`stroke-dashoffset:${le};`;f&&(ne+=`opacity:${y==="reverse"?1:0};`,W+=`opacity:${y==="reverse"?0:1};`);let B=document.createElement("style");B.setAttribute("data-svg-scroll-draw",""),B.textContent=`@keyframes ${c}{from{${ne}}to{${W}}}.${d}{view-timeline-name:${L};view-timeline-axis:block;}.${c}{animation-name:${c};animation-duration:auto;animation-timing-function:${Vt};animation-fill-mode:both;animation-timeline:${L};animation-range:cover 0% cover 100%;}`,document.head.appendChild(B),e.classList.add(d);function se(T,$){T.style.setProperty("--ssd-len",String(m[$])),T.style.strokeDasharray=`${m[$]}`,T.style.strokeDashoffset="",T.style.opacity="",T.style.animationPlayState="",T.classList.add(c);}l.forEach(se);let re=false,ce=-1;function de(){if(ce>=0)return ce;let T=e.getBoundingClientRect(),{tStart:$,tEnd:oe}=we({top:T.top,height:T.height},rt(),Dt(),ye,He);return E(z(rt(),$,oe,u))}return {destroy(){e.classList.remove(d),l.forEach(T=>{T.classList.remove(c),T.style.removeProperty("--ssd-len"),T.style.animationPlayState="";}),B.remove();},replay(){re=false,ce=-1,l.forEach(se);},pause(){re=true,l.forEach(T=>{T.style.animationPlayState="paused";});},resume(){re&&(re=false,l.forEach(T=>{T.style.animationPlayState="running";}));},seek(T){let $=Math.min(1,Math.max(0,T));ce=$,re=true,l.forEach((oe,De)=>{oe.classList.remove(c),oe.style.strokeDashoffset=y==="reverse"?`${m[De]*$}`:`${m[De]*(1-$)}`,f&&(oe.style.opacity=y==="reverse"?`${1-$}`:`${$}`);});},getProgress(){return de()},refresh(){l.forEach((T,$)=>{je(T,$),T.style.setProperty("--ssd-len",String(m[$]));});}}}if(vn())return gt(En());function Tn(){let i=Math.max(1,h),c=b?i:i*(1+Math.max(0,l.length-1)*x),d=0,L=0,J=false;function le(ce){let de=true,T=Math.min(1,Math.max(0,ce/c));if(b){let $=Math.min(1,Math.max(0,ce/i)),oe=E($);xe=oe,e.style.setProperty("--scroll-draw-progress",String(oe)),e.style.clipPath=ke(y==="reverse"?1-oe:oe),Ee?.(oe),$<1&&(de=false);}else {l.forEach((oe,De)=>{let Mn=De*x*i,Bt=Math.min(1,Math.max(0,(ce-Mn)/i));yt(oe,De,E(Bt),y),Bt<1&&(de=false);});let $=E(T);xe=$,Ee?.($),e.style.setProperty("--scroll-draw-progress",String($));}if(S){let $=E(T);for(let oe in S){let De=parseFloat(oe);$>=De&&!Ge.has(De)&&(Ge.add(De),S[oe]?.());}}return de}function ne(ce){if(pe)return;let de=ce-d;$e||($e=true,U?.());let T=le(de);if(T&&!Z){Z=true,le(c),_?.(),Fe<(q==="infinite"?1/0:q??0)&&(Fe++,_e=setTimeout(()=>{d=performance.now(),$e=false,Z=false,Ge.clear(),ht(),Re=requestAnimationFrame(ne);},V));return}T||(Re=requestAnimationFrame(ne));}function W(){cancelAnimationFrame(Re),clearTimeout(_e),d=performance.now(),L=0,pe=false,$e=false,Z=false,Fe=0,J=true,xe=0,Ge.clear(),ht(),Re=requestAnimationFrame(ne);}let B=new IntersectionObserver(ce=>{ce.forEach(de=>{de.isIntersecting&&!(R&&Z)?W():!de.isIntersecting&&!R&&!Z&&(cancelAnimationFrame(Re),clearTimeout(_e),J=false);});},{root:X??null,threshold:N,rootMargin:te}),se;function re(){clearTimeout(se),se=setTimeout(()=>l.forEach(je),150);}return window.addEventListener("resize",re),window.addEventListener("orientationchange",re),H>0?setTimeout(()=>B.observe(e),H):B.observe(e),{destroy(){cancelAnimationFrame(Re),clearTimeout(_e),B.disconnect(),window.removeEventListener("resize",re),window.removeEventListener("orientationchange",re),clearTimeout(se);},replay(){Fe=0,W();},pause(){pe||!J||(pe=true,L=performance.now()-d,cancelAnimationFrame(Re));},resume(){pe&&(pe=false,J=true,d=performance.now()-L,Re=requestAnimationFrame(ne));},seek(ce){let de=Math.min(1,Math.max(0,ce));xe=de,pe=true,L=de*c,d=performance.now()-L,cancelAnimationFrame(Re),le(L);},getProgress(){return xe},refresh(){clearTimeout(se),l.forEach(je);}}}if(Q)return gt(Tn());Nt();let Ft=()=>z(rt(),G,Ie,1);function _t(){Z=true,_?.(),Fe<(q==="infinite"?1/0:q)&&(Fe++,_e=setTimeout(()=>{pt=true;},V));}function Gt(){mt=-1,et=[],$e=false,Z=false,pt=false,Ge.clear(),ht(),We=true;}function xn(){let i=performance.now(),c=rt();if(pt&&Ft()%1&&Gt(),!We&&A===false&&c===$t)return;We=false,$t=c;let d=u;if(A!==false){let W=i-Rt,B=W>0?Math.abs(c-(nt<0?c:nt))/W:0;d=u*Math.max(.2,1+B*(typeof A=="number"?A:1)*.04);}nt=c,Rt=i;let L=ue?tt===-1||c>=tt?"forward":"reverse":y;tt=c;let J=F-k,le=true,ne=J===0?0:(c-k)/J;if(isNaN(Be)||(Be<=0&&ne>0&&fe?.(),Be<1&&ne>=1&&Te?.(),Be>=1&&ne<1&&ge?.(),Be>0&&ne<=0&&me?.()),Be=ne,b){let W=It(0,z(c,k,F,d));xe=W,e.style.setProperty("--scroll-draw-progress",String(W));let B=L==="reverse"?1-W:W;e.style.clipPath=ke(B),Ee?.(W),!$e&&z(c,k,F,d)>0&&($e=true,U?.()),W>=1&&!Z?_t():W<1&&!R&&(Z=false);return}if(l.forEach((W,B)=>{let se=B*Y*J,re=It(B,z(c,k+se,F+se,d));yt(W,B,re,L),B===0&&(xe=re,Ee?.(re),e.style.setProperty("--scroll-draw-progress",String(re))),re<1&&(le=false);}),S){let W=E(z(c,k,F,d));for(let B in S){let se=parseFloat(B);W>=se&&!Ge.has(se)&&(Ge.add(se),S[B]?.());}}!$e&&z(c,k,F,d)>0&&($e=true,U?.()),le&&!Z?_t():!le&&!R&&(Z=false);}let qe=Me(X??window,[e],Ft,xn,()=>{let i=m.join();l.forEach(je),Nt(),We=true,m.join()!==i&&Ye();}),bt=H>0;function Ye(){qe.hold(pe||bt);}let Wt;return bt&&(Wt=setTimeout(()=>{bt=false,Ye();},H)),Ye(),gt({destroy(){clearTimeout(_e),clearTimeout(Wt),qe.off(),kt();},replay(){Gt(),tt=-1,nt=-1,Fe=0,pe=false,xe=0,clearTimeout(_e),Ye();},pause(){pe=true,qe.hold(true);},resume(){pe&&(pe=false,We=true,Ye());},seek(i){let c=Math.min(1,Math.max(0,i));xe=c,mt=c,et=[],pe=true,qe.hold(true),Sn(c,y),We=true;},getProgress(){return xe},refresh:qe.remeasure},()=>({tStart:k,tEnd:F}))}var on=new WeakMap,Gn=0;function sn(e){return JSON.stringify(e,(t,n)=>{if(typeof n=="function")return "\u0192";if(typeof Element<"u"&&n instanceof Element){let r=on.get(n);return r===void 0&&on.set(n,r=++Gn),`el#${r}`}return n})}function an(e,t){let n={...e};for(let r of Object.keys(n))typeof n[r]=="function"&&(n[r]=(...o)=>t()[r]?.(...o));return n}function Wn(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function ln(e){let t=[],n=/([\w]+)\(([^)]*)\)/g,r;for(;(r=n.exec(e))!==null;){let o=[],s=[],a=r[2].trim();if(a)for(let u of a.split(/[\s,]+/)){let f=u.match(/^([-+]?[\d.eE]+)(.*)$/);o.push(f?parseFloat(f[1]):0),s.push(f?f[2]:"");}t.push({fn:r[1],nums:o,units:s});}return t}function Bn(e,t,n){let r=ln(e),o=ln(t);return r.length===0||r.length!==o.length?n<1?e:t:r.map((s,a)=>{let u=o[a];return s.fn!==u.fn||s.nums.length!==u.nums.length?n<1?`${s.fn}(${s.nums.map((f,p)=>`${f}${s.units[p]}`).join(", ")})`:`${u.fn}(${u.nums.map((f,p)=>`${f}${u.units[p]}`).join(", ")})`:`${s.fn}(${s.nums.map((f,p)=>`${f+(u.nums[p]-f)*n}${s.units[p]}`).join(", ")})`}).join(" ")}function cn(e,t,n){if(typeof e=="number"&&typeof t=="number")return String(e+(t-e)*n);let r=String(e),o=String(t);if(Wn(r))return it(r,o,n);if(r.includes("("))return Bn(r,o,n);let s=r.match(/^([-+]?[\d.]+)(.*)$/),a=o.match(/^([-+]?[\d.]+)(.*)$/);if(s&&a){let u=parseFloat(s[1]),f=parseFloat(a[1]);return `${u+(f-u)*n}${s[2]||a[2]}`}return n<1?r:o}function zn(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}var jn=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),qn=0,un="--scroll-draw-progress";function Yn(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var mn={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function St(e,t){return typeof window>"u"?mn:t.respectReducedMotion===false?fn(e,t,false):Ve(t,(n,r)=>fn(e,n,r))}function fn(e,t,n){let{props:r,trigger:o={},easing:s="ease-out",speed:a=1,once:u=false,axis:f="y",scrollContainer:p,native:g=true,velocityScale:x=false,triggerElement:y,onProgress:R,onComplete:j,onEnter:w,onLeave:D,onEnterBack:ue,onLeaveBack:H}=t,M=typeof s=="function"?s:ee[s]??ee["ease-out"],C=ie(o.start||"top bottom"),O=ie(o.end||"bottom top"),S=y??e,A=typeof p=="string"?document.querySelector(p):p??null,N=Object.entries(r).map(([l,m])=>({prop:zn(l),from:Array.isArray(m)?m[0]:"",to:Array.isArray(m)?m[1]:m}));function te(){let l=window.getComputedStyle(e);for(let m of N)m.from===""&&(m.from=l.getPropertyValue(m.prop).trim()||"0");}function q(){for(let l of N)e.style.setProperty(l.prop,String(l.to));}let V=new Map;for(let l of [...N.map(m=>m.prop),un])V.set(l,e.style.getPropertyValue(l));function I(){for(let[l,m]of V)m?e.style.setProperty(l,m):e.style.removeProperty(l);}if(n)return q(),j?.(),{...mn,destroy:I,getProgress:()=>1};te();let v=()=>A?f==="x"?A.scrollLeft:A.scrollTop:f==="x"?window.scrollX:window.scrollY,Q=()=>A?f==="x"?A.clientWidth:A.clientHeight:f==="x"?window.innerWidth:window.innerHeight,h=typeof s=="string"?at(s):null;function P(){if(!g||!Yn()||!h||f!=="y"||A||S!==e||u||a!==1||R||j||w||D||ue||H||x!==false||(o.start||"top bottom").trim()!=="top bottom"||(o.end||"bottom top").trim()!=="bottom top")return false;for(let l of N)if(!jn.has(l.prop))return false;return true}function Ee(){let l=`ssd-a-${++qn}`,m=N.map(G=>`${G.prop}:${G.from}`).join(";"),K=N.map(G=>`${G.prop}:${G.to}`).join(";"),k=document.createElement("style");k.setAttribute("data-ssd-animate",""),k.textContent=`@keyframes ${l}{from{${m}}to{${K}}}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${h};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(k),e.classList.add(l);let F=()=>{let G=e.getBoundingClientRect();return we({top:G.top,height:G.height},v(),Q(),C,O)};Se(e,{type:"animate",getProgress:()=>Y.getProgress(),getTrigger:F});let Y={refresh(){},destroy(){e.classList.remove(l),k.remove(),e.style.animationPlayState="",I(),ve(e);},replay(){e.classList.remove(l),e.offsetWidth,e.classList.add(l);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(G){let Ie=Math.min(1,Math.max(0,G));e.classList.remove(l);for(let Z of N)e.style.setProperty(Z.prop,cn(Z.from,Z.to,Ie));},getProgress(){let{tStart:G,tEnd:Ie}=F();return M(z(v(),G,Ie,a))}};return Y}if(P())return Ee();let U=0,_=0,fe=false,Te=-1,ge=0,me=0,b=false,E=NaN,ye=-1,He=0,X=S===e?N:[],Ae=false;function Pe(){let l=e.style,m=X.map(Y=>l.getPropertyValue(Y.prop)),K=l.transition;X.length&&(l.transition="none"),X.forEach(Y=>l.setProperty(Y.prop,V.get(Y.prop)??""));let k=ot(S,A,f);X.forEach((Y,G)=>l.setProperty(Y.prop,m[G])),X.length&&(e.offsetWidth,l.transition=K);let F=we(k,k.scroll,Q(),C,O);Ae&&Math.abs(F.tStart-U)<1&&Math.abs(F.tEnd-_)<1||(Ae=true,U=F.tStart,_=F.tEnd);}function he(l){e.style.setProperty(un,String(l));for(let m of N)e.style.setProperty(m.prop,cn(m.from,m.to,l));R?.(l);}function Ne(l){if(isNaN(E)){E=l;return}E<=0&&l>0&&w?.(),E<1&&l>=1&&D?.(),E>=1&&l<1&&ue?.(),E>0&&l<=0&&H?.(),E=l;}function Oe(){if(fe)return;let l=performance.now(),m=v(),K=a;if(x!==false){let G=l-He,Ie=G>0?Math.abs(m-(ye<0?m:ye))/G:0;K=a*Math.max(.2,1+Ie*(typeof x=="number"?x:1)*.04);}ye=m,He=l;let k=_===U?0:(m-U)/(_-U);Ne(k);let F=z(m,U,_,K),Y=u?Math.max(Te,M(ge=Math.max(ge,F))):M(F);me=Y,he(Y),Y>=1&&!b?(b=true,j?.()):Y<1&&!u&&(b=false);}let be=Me(A??window,[S],()=>z(v(),U,_,Math.min(a,1)),Oe,Pe);Pe(),_===U&&ae("scrollAnimate: zero-length trigger window, so it never animates. In a sticky stage, set triggerElement.",e),ge=z(v(),U,_,a),me=M(ge),he(me),Se(e,{type:"animate",getProgress:()=>me,getTrigger:()=>({tStart:U,tEnd:_})});function ke(){fe=true,be.hold(true);}return {destroy(){fe=true,be.off(),I(),ve(e);},replay(){Te=-1,ge=0,b=false,me=0,fe=false,he(0),be.hold(false);},pause:ke,resume(){fe&&(fe=false,be.hold(false));},seek(l){let m=Math.min(1,Math.max(0,l));me=m,Te=m,ge=0,ke(),he(m);},getProgress(){return me},refresh:be.remeasure}}var vt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Et(e,t){if(typeof window>"u")return vt;let n=typeof e=="string"?document.querySelector(e):e;return n?Ve(t,(r,o)=>Qn(n,r,o)):(ae("scrollCounter: element not found:",e),vt)}function Qn(e,t,n){let{from:r=0,to:o,format:s,easing:a="ease-out",trigger:u={},once:f=true,decimals:p,onComplete:g}=t,x=p!==void 0?h=>h.toFixed(p):s??(h=>String(Math.round(h))),y=typeof a=="function"?a:ee[a]??ee["ease-out"],R=ie(u.start||"top 80%"),j=ie(u.end||"top 20%");if(n)return e.textContent=x(o),g?.(),{...vt,getProgress:()=>1};let w=0,D=0,ue=false,H=-1,M=0,C=0,O=false,S=()=>window.scrollY,A=()=>window.innerHeight;function N(){let h=e.getBoundingClientRect(),P=we({top:h.top,height:h.height},S(),A(),R,j);ue&&Math.abs(P.tStart-w)<1&&Math.abs(P.tEnd-D)<1||(ue=true,w=P.tStart,D=P.tEnd);}let te=e.style.getPropertyValue("--scroll-draw-progress");function q(h){e.textContent=x(r+(o-r)*h),e.style.setProperty("--scroll-draw-progress",String(h));}let V=()=>z(S(),w,D,1);function I(){let h=V(),P=f?Math.max(H,y(M=Math.max(M,h))):y(h);C=P,q(P),P>=1&&!O?(O=true,g?.()):P<1&&!f&&(O=false);}N();{M=z(S(),w,D,1);let h=y(M);C=h,q(h);}let v=Me(window,[e],V,I,N);Se(e,{type:"counter",getProgress:()=>C,getTrigger:()=>({tStart:w,tEnd:D})});let Q=()=>v.hold(false);return {destroy(){v.off(),e.style.setProperty("--scroll-draw-progress",te),ve(e);},replay(){H=-1,M=0,O=false,C=0,q(0),Q();},pause:()=>v.hold(true),resume:Q,seek(h){let P=Math.min(1,Math.max(0,h));C=P,H=P,M=0,v.hold(true),q(P);},getProgress(){return C}}}var pn={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Tt(e,t={}){if(typeof window>"u")return pn;let n=typeof e=="string"?document.querySelector(e):e;if(!n||n.tagName.toLowerCase()!=="video")return ae("scrollVideo: <video> element not found:",e),pn;let r=n,{trigger:o={},easing:s="linear",once:a=false,axis:u="y",preload:f="auto",triggerElement:p,onReady:g,onComplete:x,onProgress:y}=t,R=p??r,j=window.matchMedia("(prefers-reduced-motion: reduce)").matches,w=typeof s=="function"?s:ee[s]??ee.linear,D=ie(o.start||"top top"),ue=ie(o.end||"bottom top");r.pause(),r.hasAttribute("preload")||(r.preload=f);let H=t.from??0,M=t.to,C=0,O=0,S=false,A=-1,N=0,te=0,q=false,V=false,I=()=>u==="x"?window.scrollX:window.scrollY,v=()=>u==="x"?window.innerWidth:window.innerHeight;function Q(){let b=R.getBoundingClientRect(),E=u==="x"?b.left:b.top,ye=u==="x"?b.width:b.height,He=we({top:E,height:ye},I(),v(),D,ue);C=He.tStart,O=He.tEnd,V&&O===C&&ae("scrollVideo: zero-length trigger window, so it never scrubs. In a sticky stage, set triggerElement.",r);}let h=NaN;function P(b){if(!V)return;let E=M??r.duration??0,ye=H+(E-H)*b;ye!==h&&(h=ye,r.currentTime=ye),r.style.setProperty("--scroll-draw-progress",String(b)),y?.(b);}let Ee=()=>z(I(),C,O,1);function U(){if(!V||j)return;let b=Ee(),E=a?Math.max(A,w(N=Math.max(N,b))):w(b);te=E,P(E),E>=1&&!q?(q=true,x?.()):E<1&&!a&&(q=false);}let _=Me(window,[R],Ee,U,Q),fe=()=>_.hold(S||!V||j);fe();function Te(){if(V=true,M===void 0&&(M=r.duration),j){P(1),g?.();return}Q(),g?.(),S?P(te):fe();}r.readyState>=1?Te():r.addEventListener("loadedmetadata",Te,{once:true}),V||Q();let ge=j?()=>{}:lt(b=>{b&&(ge(),j=true,_.hold(true),P(1));});Se(r,{type:"video",getProgress:()=>te,getTrigger:()=>({tStart:C,tEnd:O})});function me(){S&&(S=false,fe());}return {destroy(){_.off(),r.removeEventListener("loadedmetadata",Te),ge(),ve(r);},replay(){A=-1,N=0,q=false,te=0,h=NaN,P(0),me();},pause(){S=true,_.hold(true);},resume:me,seek(b){let E=Math.min(1,Math.max(0,b));te=E,A=E,N=0,S=true,_.hold(true),h=NaN,P(E);},getProgress(){return te}}}function dn(e,t){let n=document.createElement("span");n.textContent=t,n.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;user-select:none",e.appendChild(n);}function ft(e=""){let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=e,t}function yn(e){let t=e.textContent??"";return e.textContent="",t.split(/(\s+)/).filter(Boolean).map(n=>{let r=e.appendChild(ft(n)),o=/^\s+$/.test(n);return o?r.style.whiteSpace="pre":r.style.display="inline-block",o?null:r}).filter(n=>n!==null)}function Un(e){let t=e.textContent??"";e.textContent="";let n=[],r=null;for(let o of t){let s=ft(o),a=o===" ";a?s.style.whiteSpace="pre":(s.style.display="inline-block",n.push(s)),a||o>"\u0DFF"?r=null:r||(r=e.appendChild(ft()),r.style.cssText="display:inline-block;white-space:nowrap"),(r??e).appendChild(s);}return n}function gn(e){let t=yn(e),n=new Map;for(let s of t){let a=s.offsetTop;n.has(a)||n.set(a,[]),n.get(a).push(s);}let r=[],o=Array.from(n.keys()).sort((s,a)=>s-a);for(let s of o){let a=n.get(s),u=ft();u.style.display="inline-block",a.forEach((f,p)=>{let g=f.nextElementSibling;u.appendChild(f),p<a.length-1&&g&&g.style.whiteSpace==="pre"&&u.appendChild(g);}),r.push(u);}return e.textContent="",r.forEach((s,a)=>{e.appendChild(s),a<r.length-1&&e.appendChild(document.createTextNode(" "));}),r}function Xn(e,t,n,r){if(n<=1||r===0)return e;r=Math.min(r,1/n);let o=(n-1)*r,s=t*r,a=s+(1-o);return a<=s?e>=s?1:0:Qe((e-s)/(a-s),0,1)}function Kn(e,t){let n=[];if(t?.y!==void 0&&n.push(`translateY(${t.y*(1-e)}px)`),t?.x!==void 0&&n.push(`translateX(${t.x*(1-e)}px)`),t?.rotate!==void 0&&n.push(`rotate(${t.rotate*(1-e)}deg)`),t?.scale!==void 0){let r=t.scale+(1-t.scale)*e;n.push(`scale(${r})`);}return n.join(" ")}var xt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Mt(e,t={}){if(typeof window>"u")return xt;let n=typeof e=="string"?document.querySelector(e):e;if(!n)return ae("scrollText: element not found:",e),xt;let r=n;return Ve(t,(o,s)=>Zn(r,o,s))}function Zn(e,t,n){let{split:r="words",stagger:o=.04,easing:s="ease-out",from:a={opacity:0,y:24},trigger:u={},once:f=true,onComplete:p}=t,g=typeof s=="function"?s:ee[s]??ee["ease-out"],x=ie(u.start||"top 85%"),y=ie(u.end||"top 40%"),R=e.innerHTML,j=e.textContent??"",w;r==="chars"?w=Un(e):r==="lines"?w=gn(e):w=yn(e),dn(e,j);let D=w.length;function ue(v,Q){a?.opacity!==void 0&&(v.style.opacity=String(a.opacity+(1-a.opacity)*Q));let h=Kn(Q,a);h&&(v.style.transform=h);}function H(v){e.style.setProperty("--scroll-draw-progress",String(v)),w.forEach((Q,h)=>{let P=g(Xn(v,h,D,o));ue(Q,P);});}if(n)return H(1),p?.(),{...xt,destroy:()=>{e.innerHTML=R;},getProgress:()=>1};H(0);let M=0,C=0,O=-1,S=0,A=false;function N(){({tStart:M,tEnd:C}=we(e.getBoundingClientRect(),window.scrollY,window.innerHeight,x,y));}let te=()=>z(window.scrollY,M,C,1);function q(){let v=f?O=Math.max(O,te()):te();S=v,H(v),v>=1&&!A?(A=true,p?.()):v<1&&!f&&(A=false);}N();let V=Me(window,[e],te,q,()=>{r==="lines"&&(e.innerHTML=R,w=gn(e),dn(e,j),H(S)),N();});Se(e,{type:"text",getProgress:()=>S,getTrigger:()=>({tStart:M,tEnd:C})});let I=()=>V.hold(false);return {destroy(){V.off(),e.innerHTML=R,ve(e);},replay(){O=-1,A=false,S=0,H(0),I();},pause:()=>V.hold(true),resume:I,seek(v){V.hold(true),H(S=O=Qe(v,0,1));},getProgress(){return S}}}var Je=e=>typeof e=="function"?e():vue.unref(e);function Ce(e,t,n){let r=null,o=t(),s=()=>{r?.destroy(),r=e.value?n(e.value,an(o,()=>o)):null;};vue.onMounted(s),vue.watch(()=>sn(o=t()),s),vue.onUnmounted(()=>{r?.destroy(),r=null;});}function rr(e={}){let t=vue.ref(null);return Ce(t,()=>Je(e),wt),t}var hn={preset:0,selector:0,speed:0,fade:1,easing:0,trigger:0,stagger:0,direction:0,once:1,debug:1,axis:0,scrollContainer:0,autoReverse:1,delay:0,strokeColor:0,strokeWidth:0,fillOpacity:0,clip:2,waypoints:0,velocityScale:3,threshold:0,rootMargin:0,repeat:0,repeatDelay:0,morphTo:0,onProgress:0,onStart:0,onComplete:0,onEnter:0,onLeave:0,onEnterBack:0,onLeaveBack:0,autoplay:1,duration:0,native:1},or=[null,Boolean,[Boolean,String],[Boolean,Number]],bn=e=>({type:e,default:void 0}),Lt=vue.defineComponent({name:"ScrollDraw",props:Object.fromEntries(Object.entries(hn).map(([e,t])=>[e,t?bn(or[t]):null])),setup(e,{slots:t}){let n=vue.ref(null);return Ce(n,()=>{let r={};for(let o in hn){let s=e[o];s!=null&&(r[o]=s);}return r},wt),()=>vue.h("div",{ref:n},t.default?.())}});function sr(e){let t=vue.ref(null);return Ce(t,()=>Je(e),St),t}var Ct=vue.defineComponent({name:"ScrollAnimate",props:{options:{type:Object,required:true}},setup(e,{slots:t}){let n=vue.ref(null);return Ce(n,()=>e.options,St),()=>vue.h("div",{ref:n},t.default?.())}});function ir(e){let t=vue.ref(null);return Ce(t,()=>Je(e),Et),t}var At=vue.defineComponent({name:"ScrollCounter",props:{to:{type:Number,required:true},from:{type:Number},format:{type:Function},easing:{type:[String,Function]},trigger:{type:Object},once:bn(Boolean),decimals:{type:Number},onComplete:{type:Function}},setup(e){let t=vue.ref(null);return Ce(t,()=>{let n={to:e.to};return e.from!=null&&(n.from=e.from),e.format!=null&&(n.format=e.format),e.easing!=null&&(n.easing=e.easing),e.trigger!=null&&(n.trigger=e.trigger),e.once!=null&&(n.once=e.once),e.decimals!=null&&(n.decimals=e.decimals),e.onComplete!=null&&(n.onComplete=e.onComplete),n},Et),()=>vue.h("span",{ref:t})}});function ar(e={}){let t=vue.ref(null);return Ce(t,()=>Je(e),Tt),t}var Pt=vue.defineComponent({name:"ScrollVideo",props:{src:{type:String,required:true},options:{type:Object},muted:{type:Boolean,default:true},playsInline:{type:Boolean,default:true},class:{type:String}},setup(e){let t=vue.ref(null);return Ce(t,()=>e.options??{},Tt),()=>vue.h("video",{ref:t,src:e.src,muted:e.muted,playsinline:e.playsInline,preload:"auto",class:e.class})}});function lr(e={}){let t=vue.ref(null);return Ce(t,()=>Je(e),Mt),t}var Ot=vue.defineComponent({name:"ScrollText",props:{options:{type:Object},tag:{type:String,default:"p"}},setup(e,{slots:t}){let n=vue.ref(null);return Ce(n,()=>e.options??{},Mt),()=>vue.h(e.tag,{ref:n},t.default?.())}});function Ao(){return {install(e){e.component("ScrollDraw",Lt),e.component("ScrollAnimate",Ct),e.component("ScrollCounter",At),e.component("ScrollVideo",Pt),e.component("ScrollText",Ot);}}}exports.ScrollAnimate=Ct;exports.ScrollCounter=At;exports.ScrollDraw=Lt;exports.ScrollText=Ot;exports.ScrollVideo=Pt;exports.createScrollDrawPlugin=Ao;exports.useScrollAnimate=sr;exports.useScrollCounter=ir;exports.useScrollDraw=rr;exports.useScrollText=lr;exports.useScrollVideo=ar;
|
|
1
|
+
'use strict';var vue=require('vue');var Xe=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function k(e,...r){Xe&&console.warn(`[svg-scroll-draw] ${e}`,...r);}function Ir({tension:e=2.5,friction:r=2.2}={}){return t=>1-Math.cos(t*Math.PI*e)*Math.pow(1-t,r)}function Nr({bounces:e=3,decay:r=.5}={}){let t=Math.max(1,Math.round(e)),n=Math.max(.01,Math.min(.99,r)),o=Math.sqrt(n),s=0,i=[];for(let g=0;g<t;g++){let w=Math.pow(o,g);i.push(w),s+=w;}let c=[0],m=0;for(let g=0;g<t;g++)m+=i[g]/s,c.push(m);return g=>{if(g<=0)return 0;if(g>=1)return 1;for(let w=0;w<t;w++)if(g<=c[w+1]){let A=(g-c[w])/(c[w+1]-c[w]);if(w===0)return A*(2-A);let E=1-Math.pow(n,w);return E+(1-E)*(2*A-1)*(2*A-1)}return 1}}function Vr({amplitude:e=1,period:r=.4}={}){let t=Math.max(1,e),n=Math.max(.1,r),o=t<=1?n/4:n/(2*Math.PI)*Math.asin(1/t);return s=>s<=0?0:s>=1?1:t*Math.pow(2,-10*s)*Math.sin((s-o)*(2*Math.PI)/n)+1}var Je={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:Ir(),bounce:Nr(),elastic:Vr()};function _r(e,r,t,n){let o=(s,i,c)=>((1+3*s-3*i)*c+3*i-6*s)*c*c+3*s*c;return s=>{if(s<=0||s>=1)return +(s>0);let i=s;for(let c=0;c<8;c++)i-=(o(e,t,i)-s)/((3*(1+3*e-3*t)*i+6*t-12*e)*i+3*e);if(!(i>=0&&i<=1&&Math.abs(o(e,t,i)-s)<1e-9))for(let c=0,m=0,g=1;c<30;c++)i=(m+g)/2,o(e,t,i)<s?m=i:g=i;return o(r,n,i)}}function Mt(e){let r=/^cubic-bezier\((.*)\)$/.exec(e==="ease"?"cubic-bezier(.25,.1,.25,1)":e.trim()),t=r?r[1].split(",").map(parseFloat):[];if(t.length===4&&t.every(Number.isFinite)&&t[0]*(1-t[0])>=0&&t[2]*(1-t[2])>=0)return [_r(t[0],t[1],t[2],t[3]),`cubic-bezier(${t})`]}var Zt=new Set;function De(e,r="linear"){if(typeof e=="function")return e;if(e==null)return Je[r];if({}.hasOwnProperty.call(Je,e))return Je[e];let t=Mt(String(e));return t?t[0]:(!Zt.has(e)&&Zt.add(e)&&k(`Unknown easing ${JSON.stringify(e)}: use a name, cubic-bezier() or a function.`),Je[r])}function it(e,r,t){return Math.min(t,Math.max(r,e))}function ae(e="top bottom"){let r=e.trim();if(/^\d+(\.\d+)?%$/.test(r))return {element:"top",viewport:r};let[t="top",n="bottom"]=r.split(/\s+/).filter(Boolean);return {element:t,viewport:n}}var rr=(e,r)=>e==="top"?0:e==="center"?.5:e==="bottom"?1:r;function er(e,r,t,n){return e+t+r*rr(n,0)}function tr(e,r){return r*(/^\d+(\.\d+)?%$/.test(e)?parseFloat(e)/100:rr(e,1))}function U(e,r,t,n){return t===r?0:it((e-r)/(t-r)*n,0,1)}function Le(e,r,t,n,o){let s=er(e.top,e.height,r,n.element)-tr(n.viewport,t),i=er(e.top,e.height,r,o.element)-tr(o.viewport,t);return {tStart:s,tEnd:i}}function mt(e,r,t){let n=e.getBoundingClientRect(),o=t==="x"?n.width:n.height;return r?{top:t==="x"?n.left-r.getBoundingClientRect().left-r.clientLeft+r.scrollLeft:n.top-r.getBoundingClientRect().top-r.clientTop+r.scrollTop,height:o,scroll:0}:{top:t==="x"?n.left:n.top,height:o,scroll:t==="x"?window.scrollX:window.scrollY}}function pt(e){let r=parseFloat(e.getAttribute("pathLength")??"");if(r>0)return r;let t=e.tagName.toLowerCase();if(t==="rect"){let n=parseFloat(e.getAttribute("width")??"0"),o=parseFloat(e.getAttribute("height")??"0");return 2*(n+o)}if(t==="circle"){let n=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*n}return e.getTotalLength()}function dt(e){return `${e} ${e*2}`}function nr(e){let r=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(r)return [parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16)];let t=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(t)return [parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)];let n=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return n?[parseInt(n[1]),parseInt(n[2]),parseInt(n[3])]:null}function gt(e,r,t){let n=nr(e),o=nr(r);return !n||!o?e:`rgb(${Math.round(n[0]+(o[0]-n[0])*t)},${Math.round(n[1]+(o[1]-n[1])*t)},${Math.round(n[2]+(o[2]-n[2])*t)})`}var or={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 zr="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",Wr="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",sr=33;function Br(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function Gr(e){let r=[];for(let t=0;t<sr;t++){let n=t/(sr-1);r.push(String(Math.round(e(n)*1e5)/1e5));}return `linear(${r.join(",")})`}function yt(e){switch(e){case "linear":return "linear";case "ease-in":return zr;case "ease-out":return Wr;case "ease-in-out":return Br()?Gr(Je["ease-in-out"]):null;default:return Mt(e)?.[1]??null}}var ir=Symbol.for("svg-scroll-draw.registry");function ar(){let e=globalThis;return e[ir]||(e[ir]=new Map)}function Pe(e,r){ar().set(e,r);}function ke(e){ar().delete(e);}function Ze(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let r=window.matchMedia("(prefers-reduced-motion: reduce)"),t=o=>e(!!o.matches);if(typeof r.addEventListener=="function")return r.addEventListener("change",t),()=>r.removeEventListener("change",t);let n=r;return n.addListener?.(t),()=>n.removeListener?.(t)}function qe(e,r){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return r(e,true);let t=r(e,false),n=Ze(s=>{if(!s)return;n();let i=(t.getProgress?.()??0)>=1;t.destroy(),t=r(i?{...e,onComplete:void 0}:e,true);}),o={};for(let s of Object.keys(t))o[s]=(...i)=>t[s]?.(...i);return o.destroy=()=>{n(),t.destroy();},o}var at,ht=new Set,bt=new WeakMap,lt=new Map,lr=e=>{let r=e.getBoundingClientRect();return r.width+" "+r.height};function jr(e){let r=new Set;for(let t of e)for(;t&&t!==document.body;t=t.parentElement)for(let n=t;n;n=n.previousElementSibling)r.add(n);return r}function cr(e,r){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let t=()=>r();at??(at=new ResizeObserver(o=>{let s=false;for(let{target:i}of o)bt.get(i)!==lr(i)&&(s=true),bt.set(i,"");s&&ht.forEach(i=>i());})),ht.add(t);let n=jr(e);return [document.body,document.documentElement].forEach(o=>o&&n.add(o)),n.forEach(o=>{bt.has(o)||bt.set(o,lr(o)),lt.set(o,(lt.get(o)??0)+1),at.observe(o);}),()=>{ht.delete(t)&&(n.forEach(o=>{let s=(lt.get(o)??1)-1;if(s)return void lt.set(o,s);lt.delete(o),at?.unobserve(o);}),ht.size||(at?.disconnect(),at=void 0));}}function Ie(e,r,t,n,o){let s,i=NaN,c,m,g=()=>{s=0,n(),!c&&!s&&(i=t())>0&&i<1&&(s=requestAnimationFrame(g));},w=()=>{!s&&!c&&t()!==i&&(s=requestAnimationFrame(g));},A=z=>{c=z,cancelAnimationFrame(s),s=i=NaN,w();},E=()=>{clearTimeout(m),o(),w();},B=()=>{clearTimeout(m),m=setTimeout(E,150);},Q=cr(r,B),v=z=>{e[z]("scroll",w,{passive:true}),window[z]("resize",B),window[z]("orientationchange",B);};return v("addEventListener"),w(),{hold:A,remeasure:E,off(){A(true),v("removeEventListener"),Q(),clearTimeout(m);}}}var qr=0;function Yr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function ur(e,r){let t="";try{t=getComputedStyle(e).getPropertyValue(r).trim();}catch{}return t||(e.getAttribute(r)??"").trim()}var fr=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function Ur(e){if(!Xe)return;let r=ur(e,"stroke");if(!r||r==="none"){k("Element has no stroke \u2014 path will not be visible.",e);return}let t=(e.getAttribute("fill")??"").trim();t&&!fr.has(t)&&!fr.has(ur(e,"fill"))&&k("Element has a fill \u2014 it may obscure the stroke animation.",e);}function Qr(e,r,t){let n=document.createElement("div");n.setAttribute("data-svg-scroll-draw-debug",""),n.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function o(){let s=t==="x"?window.scrollX:window.scrollY,i=e-s,c=r-s,m=t==="x";n.innerHTML=`
|
|
2
|
+
<div style="position:absolute;${m?`left:${i}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${i}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:${c}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${c}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(n),window.addEventListener("scroll",o,{passive:true}),o(),{el:n,destroy(){window.removeEventListener("scroll",o),n.remove();}}}var mr=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,pr=/[MmLlHhVvCcSsQqTtAaZz]/g;function Kr(e,r,t){if(!Xe)return;let n=(e.match(pr)??[]).join("").toUpperCase(),o=(r.match(pr)??[]).join("").toUpperCase(),s=(e.match(mr)??[]).length,i=(r.match(mr)??[]).length;if(n!==o){k(`morphTo: command sequence differs (${n||"\u2205"} \u2192 ${o||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,t);return}s!==i&&k(`morphTo: coordinate count differs (${s} \u2192 ${i}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,t);}function Xr(e,r,t){let n=(r.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),o=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,s=>{let i=parseFloat(s),c=n[o++]??i;return String(+(i+(c-i)*t).toFixed(4))})}function Lt(e,r={}){return typeof window>"u"?{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0}:qe(r,(t,n)=>Jr(e,t,n))}function Jr(e,r,t){let{preset:n,...o}=r,s=n?{...or[n],...o}:o,{selector:i="path, polyline, line, polygon, rect, circle",speed:c=1,fade:m=false,easing:g="linear",trigger:w={},stagger:A=0,direction:E="forward",once:B=false,debug:Q=false,axis:v="y",scrollContainer:z,autoReverse:Z=false,delay:P=0,strokeColor:O,strokeWidth:L,fillOpacity:R,waypoints:y,velocityScale:$=false,threshold:W=0,rootMargin:se="0px",repeat:K=0,repeatDelay:V=0,morphTo:D,clip:T,autoplay:X=false,duration:S=1e3,native:C=true,onProgress:ye,onStart:I,onComplete:j,onEnter:ue,onLeave:Se,onEnterBack:fe,onLeaveBack:ie}=s,x=T===true?"left":typeof T=="string"?T:false,M=De(g),re=ae(w.start||"top bottom"),Re=ae(w.end||"bottom top"),J=typeof z=="string"?document.querySelector(z):z??null,$e=Array.isArray(O)?O[0]:null,Ee=Array.isArray(O)?O[1]:typeof O=="string"?O:null,he=Array.isArray(L)?L[0]:null,ze=Array.isArray(L)?L[1]:typeof L=="number"?L:null,Fe=Array.isArray(R)?R[0]:null,Te=Array.isArray(R)?R[1]:typeof R=="number"?R:null;function Ce(a){let f=a*100;switch(x){case "right":return `inset(0 0 0 ${100-f}%)`;case "top":return `inset(0 0 ${100-f}% 0)`;case "bottom":return `inset(${100-f}% 0 0 0)`;case "center":return `circle(${a*150}% at 50% 50%)`;default:return `inset(0 ${100-f}% 0 0)`}}let l=x?[]:Array.from(e.querySelectorAll(i)),d=[],ne=[],F=0,_=0,G=A,q=0,_e=0,oe=false,He=false,be=0,Qe=-1,Ye=[],Ue=-1,me=false,u=0,p=0,b,le=false,we=null;function We(){we?.destroy(),we=null;}let Oe=new Set,Be=NaN,Ge=true,ut=-1,Wt=performance.now(),Ke=NaN;function ft(){return J?v==="x"?J.scrollLeft:J.scrollTop:v==="x"?window.scrollX:window.scrollY}function Bt(){return J?v==="x"?J.clientWidth:J.clientHeight:v==="x"?window.innerWidth:window.innerHeight}function Gt(){let a=mt(e,J,v);return Le(a,a.scroll,Bt(),re,Re)}function Pr(){let a=_-F,f=l.length-1,h=J??document.documentElement,N=v==="x"?"Width":"Height";if(G=A,A>0&&f>0&&a>0){let pe=h[`scroll${N}`]-h[`client${N}`]-1-F-a/c;pe>=0&&(G=Math.min(A,pe/(f*a)));}let ce=Math.max(0,f)*G*a,xe=a/Math.min(c,1);q=F+Math.min(0,ce,xe,ce+xe),_e=F+Math.max(0,ce,xe,ce+xe);}function jt(){(({tStart:F,tEnd:_}=Gt())),Pr(),Q&&Xe&&(We(),we=Qr(F,_,v));}function St(a,f=Gt){Pe(e,{type:"draw",getProgress:()=>a.getProgress(),getTrigger:f});let h=a.destroy;return a.destroy=()=>{h.call(a),ke(e);},a}function qt(a,f){return B&&!Z?Math.max(Qe,M(Ye[a]=Math.max(Ye[a]??0,f))):M(f)}function kr(a,f){if(e.style.setProperty("--scroll-draw-progress",String(a)),x){let h=f==="reverse"?1-a:a;e.style.clipPath=Ce(h);return}l.forEach((h,N)=>Et(h,N,a,f));}function Et(a,f,h,N){a.style.strokeDashoffset=N==="reverse"?`${d[f]*h}`:`${d[f]*(1-h)}`,m&&(a.style.opacity=N==="reverse"?`${1-h}`:`${h}`),$e&&Ee?a.style.stroke=gt($e,Ee,h):Ee&&(a.style.stroke=Ee),he!==null&&ze!==null?a.style.strokeWidth=`${he+(ze-he)*h}`:ze!==null&&(a.style.strokeWidth=`${ze}`),Fe!==null&&Te!==null?a.style.fillOpacity=`${Fe+(Te-Fe)*h}`:Te!==null&&(a.style.fillOpacity=`${Te}`),D&&a.tagName.toLowerCase()==="path"&&ne[f]&&a.setAttribute("d",Xr(ne[f],D,h));}function Tt(){if(e.style.setProperty("--scroll-draw-progress","0"),x){e.style.clipPath=Ce(E==="reverse"?1:0);return}l.forEach((a,f)=>{a.style.strokeDasharray=dt(d[f]),a.style.strokeDashoffset=E==="reverse"?"0":`${d[f]}`,m?a.style.opacity=E==="reverse"?"1":"0":a.style.opacity="",$e&&(a.style.stroke=$e),he!==null&&(a.style.strokeWidth=`${he}`),Fe!==null&&(a.style.fillOpacity=`${Fe}`),D&&a.tagName.toLowerCase()==="path"&&ne[f]&&a.setAttribute("d",ne[f]);});}function nt(a,f){let h=a.getAttribute("d"),N=pt(a);if(D&&ne[f]){a.setAttribute("d",D);let ce=pt(a);a.setAttribute("d",ne[f]),N=Math.max(pt(a),ce),a.setAttribute("d",h);}d[f]=N,a.style.strokeDasharray=dt(N);}if(l.forEach((a,f)=>{Ur(a);let h=a.tagName.toLowerCase()==="path";h?ne.push(a.getAttribute("d")??""):ne.push(""),nt(a,f);let N=d[f];D&&(h?Kr(ne[ne.length-1],D,a):k(`morphTo only applies to <path> elements \u2014 ignored on <${a.tagName}>.`,a)),t?(a.style.strokeDashoffset=E==="reverse"?`${N}`:"0",m&&(a.style.opacity="1"),Ee&&(a.style.stroke=Ee),ze!==null&&(a.style.strokeWidth=`${ze}`),Te!==null&&(a.style.fillOpacity=`${Te}`),D&&a.tagName.toLowerCase()==="path"&&a.setAttribute("d",D)):(a.style.strokeDashoffset=E==="reverse"?"0":`${N}`,m?a.style.opacity=E==="reverse"?"1":"0":a.style.opacity="",$e&&(a.style.stroke=$e),he!==null&&(a.style.strokeWidth=`${he}`),Fe!==null&&(a.style.fillOpacity=`${Fe}`));}),t)return x&&(e.style.clipPath=Ce(1)),j?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};x&&(e.style.clipPath=Ce(E==="reverse"?1:0));let Yt=typeof g=="string"?yt(g):null;function Rr(){return !(C===false||X||Q&&Xe||!Yr()||!l.length||!Yt||x||v!=="y"||J||c!==1||A!==0||B||Z||$!==false||D||y||K||P>0||ye||I||j||ue||Se||fe||ie||O!=null||L!=null||R!=null||(w.start||"top bottom").trim()!=="top bottom"||(w.end||"bottom top").trim()!=="bottom top")}function $r(){let a=++qr,f=`svg-scroll-draw-${a}`,h=`svg-scroll-draw-host-${a}`,N=`--svg-scroll-draw-${a}`,ce=E==="reverse"?"0":"var(--ssd-len)",xe=E==="reverse"?"var(--ssd-len)":"0",pe=`stroke-dashoffset:${ce};`,ee=`stroke-dashoffset:${xe};`;m&&(pe+=`opacity:${E==="reverse"?1:0};`,ee+=`opacity:${E==="reverse"?0:1};`);let te=document.createElement("style");te.setAttribute("data-svg-scroll-draw",""),te.textContent=`@keyframes ${f}{from{${pe}}to{${ee}}}.${h}{view-timeline-name:${N};view-timeline-axis:block;}.${f}{animation-name:${f};animation-duration:auto;animation-timing-function:${Yt};animation-fill-mode:both;animation-timeline:${N};animation-range:cover 0% cover 100%;}`,document.head.appendChild(te),e.classList.add(h);function ve(H,Y){H.style.setProperty("--ssd-len",String(d[Y])),H.style.strokeDasharray=dt(d[Y]),H.style.strokeDashoffset="",H.style.opacity="",H.style.animationPlayState="",H.classList.add(f);}l.forEach(ve);let de=false,Me=-1;function Ae(){if(Me>=0)return Me;let H=e.getBoundingClientRect(),{tStart:Y,tEnd:ge}=Le({top:H.top,height:H.height},ft(),Bt(),re,Re);return M(U(ft(),Y,ge,c))}return {destroy(){e.classList.remove(h),l.forEach(H=>{H.classList.remove(f),H.style.removeProperty("--ssd-len"),H.style.animationPlayState="";}),te.remove();},replay(){de=false,Me=-1,l.forEach(ve);},pause(){de=true,l.forEach(H=>{H.style.animationPlayState="paused";});},resume(){de&&(de=false,l.forEach(H=>{H.style.animationPlayState="running";}));},seek(H){let Y=Math.min(1,Math.max(0,H));Me=Y,de=true,l.forEach((ge,je)=>{ge.classList.remove(f),ge.style.strokeDashoffset=E==="reverse"?`${d[je]*Y}`:`${d[je]*(1-Y)}`,m&&(ge.style.opacity=E==="reverse"?`${1-Y}`:`${Y}`);});},getProgress(){return Ae()},refresh(){l.forEach((H,Y)=>{nt(H,Y),H.style.setProperty("--ssd-len",String(d[Y]));});}}}if(Rr())return St($r());function Fr(){let a=Math.max(1,S),f=x?a:a*(1+Math.max(0,l.length-1)*A),h=0,N=0,ce=false;function xe(Me){let Ae=true,H=Math.min(1,Math.max(0,Me/f));if(x){let Y=Math.min(1,Math.max(0,Me/a)),ge=M(Y);u=ge,e.style.setProperty("--scroll-draw-progress",String(ge)),e.style.clipPath=Ce(E==="reverse"?1-ge:ge),ye?.(ge),Y<1&&(Ae=false);}else {l.forEach((ge,je)=>{let Dr=je*A*a,Jt=Math.min(1,Math.max(0,(Me-Dr)/a));Et(ge,je,M(Jt),E),Jt<1&&(Ae=false);});let Y=M(H);u=Y,ye?.(Y),e.style.setProperty("--scroll-draw-progress",String(Y));}if(y){let Y=M(H);for(let ge in y){let je=parseFloat(ge);Y>=je&&!Oe.has(je)&&(Oe.add(je),y[ge]?.());}}return Ae}function pe(Me){if(me)return;let Ae=Me-h;He||(He=true,I?.());let H=xe(Ae);if(H&&!oe){oe=true,xe(f),j?.(),p<(K==="infinite"?1/0:K??0)&&(p++,b=setTimeout(()=>{h=performance.now(),He=false,oe=false,Oe.clear(),Tt(),be=requestAnimationFrame(pe);},V));return}H||(be=requestAnimationFrame(pe));}function ee(){cancelAnimationFrame(be),clearTimeout(b),h=performance.now(),N=0,me=false,He=false,oe=false,p=0,ce=true,u=0,Oe.clear(),Tt(),be=requestAnimationFrame(pe);}let te=new IntersectionObserver(Me=>{Me.forEach(Ae=>{Ae.isIntersecting&&!(B&&oe)?ee():!Ae.isIntersecting&&!B&&!oe&&(cancelAnimationFrame(be),clearTimeout(b),ce=false);});},{root:J??null,threshold:W,rootMargin:se}),ve;function de(){clearTimeout(ve),ve=setTimeout(()=>l.forEach(nt),150);}return window.addEventListener("resize",de),window.addEventListener("orientationchange",de),P>0?setTimeout(()=>te.observe(e),P):te.observe(e),{destroy(){cancelAnimationFrame(be),clearTimeout(b),te.disconnect(),window.removeEventListener("resize",de),window.removeEventListener("orientationchange",de),clearTimeout(ve);},replay(){p=0,ee();},pause(){me||!ce||(me=true,N=performance.now()-h,cancelAnimationFrame(be));},resume(){me&&(me=false,ce=true,h=performance.now()-N,be=requestAnimationFrame(pe));},seek(Me){let Ae=Math.min(1,Math.max(0,Me));u=Ae,me=true,N=Ae*f,h=performance.now()-N,cancelAnimationFrame(be),xe(N);},getProgress(){return u},refresh(){clearTimeout(ve),l.forEach(nt);}}}if(X)return St(Fr());jt();let Ut=()=>U(ft(),q,_e,1);function Qt(){oe=true,j?.(),p<(K==="infinite"?1/0:K)&&(p++,b=setTimeout(()=>{le=true;},V));}function Kt(){Qe=-1,Ye=[],He=false,oe=false,le=false,Oe.clear(),Tt(),Ge=true;}function Hr(){let a=performance.now(),f=ft();if(le&&Ut()%1&&Kt(),!Ge&&$===false&&f===Be)return;Ge=false,Be=f;let h=c;if($!==false){let ee=a-Wt,te=ee>0?Math.abs(f-(ut<0?f:ut))/ee:0;h=c*Math.max(.2,1+te*(typeof $=="number"?$:1)*.04);}ut=f,Wt=a;let N=Z?Ue===-1||f>=Ue?"forward":"reverse":E;Ue=f;let ce=_-F,xe=true,pe=ce===0?0:(f-F)/ce;if(isNaN(Ke)||(Ke<=0&&pe>0&&ue?.(),Ke<1&&pe>=1&&Se?.(),Ke>=1&&pe<1&&fe?.(),Ke>0&&pe<=0&&ie?.()),Ke=pe,x){let ee=qt(0,U(f,F,_,h));u=ee,e.style.setProperty("--scroll-draw-progress",String(ee));let te=N==="reverse"?1-ee:ee;e.style.clipPath=Ce(te),ye?.(ee),!He&&U(f,F,_,h)>0&&(He=true,I?.()),ee>=1&&!oe?Qt():ee<1&&!B&&(oe=false);return}if(l.forEach((ee,te)=>{let ve=te*G*ce,de=qt(te,U(f,F+ve,_+ve,h));Et(ee,te,de,N),te===0&&(u=de,ye?.(de),e.style.setProperty("--scroll-draw-progress",String(de))),de<1&&(xe=false);}),y){let ee=M(U(f,F,_,h));for(let te in y){let ve=parseFloat(te);ee>=ve&&!Oe.has(ve)&&(Oe.add(ve),y[te]?.());}}!He&&U(f,F,_,h)>0&&(He=true,I?.()),xe&&!oe?Qt():!xe&&!B&&(oe=false);}let ot=Ie(J??window,[e],Ut,Hr,()=>{let a=d.join();l.forEach(nt),jt(),Ge=true,d.join()!==a&&st();}),xt=P>0;function st(){ot.hold(me||xt);}let Xt;return xt&&(Xt=setTimeout(()=>{xt=false,st();},P)),st(),St({destroy(){clearTimeout(b),clearTimeout(Xt),ot.off(),We();},replay(){Kt(),Ue=-1,ut=-1,p=0,me=false,u=0,clearTimeout(b),st();},pause(){me=true,ot.hold(true);},resume(){me&&(me=false,Ge=true,st());},seek(a){let f=Math.min(1,Math.max(0,a));u=f,Qe=f,Ye=[],me=true,ot.hold(true),kr(f,E),Ge=true;},getProgress(){return u},refresh:ot.remeasure},()=>({tStart:F,tEnd:_}))}var dr=new WeakMap,Zr=0;function ct(e){return JSON.stringify(e,(r,t)=>{if(typeof t=="function")return "\u0192";if(typeof Element<"u"&&t instanceof Element){let n=dr.get(t);return n===void 0&&dr.set(t,n=++Zr),`el#${n}`}return t})}function gr(e,r){let t={...e};for(let n of Object.keys(t))typeof t[n]=="function"&&(t[n]=(...o)=>r()[n]?.(...o));return t}function en(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function yr(e){let r=[],t=/([\w]+)\(([^)]*)\)/g,n;for(;(n=t.exec(e))!==null;){let o=[],s=[],i=n[2].trim();if(i)for(let c of i.split(/[\s,]+/)){let m=c.match(/^([-+]?[\d.eE]+)(.*)$/);o.push(m?parseFloat(m[1]):0),s.push(m?m[2]:"");}r.push({fn:n[1],nums:o,units:s});}return r}function tn(e,r,t){let n=yr(e),o=yr(r);return n.length===0||n.length!==o.length?t<1?e:r:n.map((s,i)=>{let c=o[i];return s.fn!==c.fn||s.nums.length!==c.nums.length?t<1?`${s.fn}(${s.nums.map((m,g)=>`${m}${s.units[g]}`).join(", ")})`:`${c.fn}(${c.nums.map((m,g)=>`${m}${c.units[g]}`).join(", ")})`:`${s.fn}(${s.nums.map((m,g)=>`${m+(c.nums[g]-m)*t}${s.units[g]}`).join(", ")})`}).join(" ")}function hr(e,r,t){if(typeof e=="number"&&typeof r=="number")return String(e+(r-e)*t);let n=String(e),o=String(r);if(en(n))return gt(n,o,t);if(n.includes("("))return tn(n,o,t);let s=n.match(/^([-+]?[\d.]+)(.*)$/),i=o.match(/^([-+]?[\d.]+)(.*)$/);if(s&&i){let c=parseFloat(s[1]),m=parseFloat(i[1]);return `${c+(m-c)*t}${s[2]||i[2]}`}return t<1?n:o}function rn(e){return e.replace(/([A-Z])/g,r=>`-${r.toLowerCase()}`)}var nn=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),on=0,br="--scroll-draw-progress";function sn(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var vr={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Ct(e,r){return typeof window>"u"?vr:r.respectReducedMotion===false?wr(e,r,false):qe(r,(t,n)=>wr(e,t,n))}function wr(e,r,t){let{props:n,trigger:o={},easing:s="ease-out",speed:i=1,once:c=false,axis:m="y",scrollContainer:g,native:w=true,velocityScale:A=false,triggerElement:E,onProgress:B,onComplete:Q,onEnter:v,onLeave:z,onEnterBack:Z,onLeaveBack:P}=r,O=De(s,"ease-out"),L=ae(o.start||"top bottom"),R=ae(o.end||"bottom top"),y=E??e,$=typeof g=="string"?document.querySelector(g):g??null,W=Object.entries(n).map(([l,d])=>({prop:rn(l),from:Array.isArray(d)?d[0]:"",to:Array.isArray(d)?d[1]:d}));function se(){let l=window.getComputedStyle(e);for(let d of W)d.from===""&&(d.from=l.getPropertyValue(d.prop).trim()||"0");}function K(){for(let l of W)e.style.setProperty(l.prop,String(l.to));}let V=new Map;for(let l of [...W.map(d=>d.prop),br])V.set(l,e.style.getPropertyValue(l));function D(){for(let[l,d]of V)d?e.style.setProperty(l,d):e.style.removeProperty(l);}if(t)return K(),Q?.(),{...vr,destroy:D,getProgress:()=>1};se();let T=()=>$?m==="x"?$.scrollLeft:$.scrollTop:m==="x"?window.scrollX:window.scrollY,X=()=>$?m==="x"?$.clientWidth:$.clientHeight:m==="x"?window.innerWidth:window.innerHeight,S=typeof s=="string"?yt(s):null;function C(){if(!w||!sn()||!S||m!=="y"||$||y!==e||c||i!==1||B||Q||v||z||Z||P||A!==false||(o.start||"top bottom").trim()!=="top bottom"||(o.end||"bottom top").trim()!=="bottom top")return false;for(let l of W)if(!nn.has(l.prop))return false;return true}function ye(){let l=`ssd-a-${++on}`,d=W.map(q=>`${q.prop}:${q.from}`).join(";"),ne=W.map(q=>`${q.prop}:${q.to}`).join(";"),F=document.createElement("style");F.setAttribute("data-ssd-animate",""),F.textContent=`@keyframes ${l}{from{${d}}to{${ne}}}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${S};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(F),e.classList.add(l);let _=()=>{let q=e.getBoundingClientRect();return Le({top:q.top,height:q.height},T(),X(),L,R)};Pe(e,{type:"animate",getProgress:()=>G.getProgress(),getTrigger:_});let G={refresh(){},destroy(){e.classList.remove(l),F.remove(),e.style.animationPlayState="",D(),ke(e);},replay(){e.classList.remove(l),e.offsetWidth,e.classList.add(l);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(q){let _e=Math.min(1,Math.max(0,q));e.classList.remove(l);for(let oe of W)e.style.setProperty(oe.prop,hr(oe.from,oe.to,_e));},getProgress(){let{tStart:q,tEnd:_e}=_();return O(U(T(),q,_e,i))}};return G}if(C())return ye();let I=0,j=0,ue=false,Se=-1,fe=0,ie=0,x=false,M=NaN,re=-1,Re=0,J=y===e?W:[],$e=false;function Ee(){let l=e.style,d=J.map(G=>l.getPropertyValue(G.prop)),ne=l.transition;J.length&&(l.transition="none"),J.forEach(G=>l.setProperty(G.prop,V.get(G.prop)??""));let F=mt(y,$,m);J.forEach((G,q)=>l.setProperty(G.prop,d[q])),J.length&&(e.offsetWidth,l.transition=ne);let _=Le(F,F.scroll,X(),L,R);$e&&Math.abs(_.tStart-I)<1&&Math.abs(_.tEnd-j)<1||($e=true,I=_.tStart,j=_.tEnd);}function he(l){e.style.setProperty(br,String(l));for(let d of W)e.style.setProperty(d.prop,hr(d.from,d.to,l));B?.(l);}function ze(l){if(isNaN(M)){M=l;return}M<=0&&l>0&&v?.(),M<1&&l>=1&&z?.(),M>=1&&l<1&&Z?.(),M>0&&l<=0&&P?.(),M=l;}function Fe(){if(ue)return;let l=performance.now(),d=T(),ne=i;if(A!==false){let q=l-Re,_e=q>0?Math.abs(d-(re<0?d:re))/q:0;ne=i*Math.max(.2,1+_e*(typeof A=="number"?A:1)*.04);}re=d,Re=l;let F=j===I?0:(d-I)/(j-I);ze(F);let _=U(d,I,j,ne),G=c?Math.max(Se,O(fe=Math.max(fe,_))):O(_);ie=G,he(G),G>=1&&!x?(x=true,Q?.()):G<1&&!c&&(x=false);}let Te=Ie($??window,[y],()=>U(T(),I,j,Math.min(i,1)),Fe,Ee);Ee(),j===I&&k("scrollAnimate: zero-length trigger window, so it never animates. In a sticky stage, set triggerElement.",e),fe=U(T(),I,j,i),ie=O(fe),he(ie),Pe(e,{type:"animate",getProgress:()=>ie,getTrigger:()=>({tStart:I,tEnd:j})});function Ce(){ue=true,Te.hold(true);}return {destroy(){ue=true,Te.off(),D(),ke(e);},replay(){Se=-1,fe=0,x=false,ie=0,ue=false,he(0),Te.hold(false);},pause:Ce,resume(){ue&&(ue=false,Te.hold(false));},seek(l){let d=Math.min(1,Math.max(0,l));ie=d,Se=d,fe=0,Ce(),he(d);},getProgress(){return ie},refresh:Te.remeasure}}var Ot={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function At(e,r){if(typeof window>"u")return Ot;let t=typeof e=="string"?document.querySelector(e):e;return t?qe(r,(n,o)=>an(t,n,o)):(k("scrollCounter: element not found:",e),Ot)}function an(e,r,t){let{from:n=0,to:o,format:s,easing:i="ease-out",trigger:c={},once:m=true,decimals:g,onComplete:w}=r,A=g!==void 0?S=>S.toFixed(g):s??(S=>String(Math.round(S))),E=De(i,"ease-out"),B=ae(c.start||"top 80%"),Q=ae(c.end||"top 20%");if(t)return e.textContent=A(o),w?.(),{...Ot,getProgress:()=>1};let v=0,z=0,Z=false,P=-1,O=0,L=0,R=false,y=()=>window.scrollY,$=()=>window.innerHeight;function W(){let S=e.getBoundingClientRect(),C=Le({top:S.top,height:S.height},y(),$(),B,Q);Z&&Math.abs(C.tStart-v)<1&&Math.abs(C.tEnd-z)<1||(Z=true,v=C.tStart,z=C.tEnd);}let se=e.style.getPropertyValue("--scroll-draw-progress");function K(S){e.textContent=A(n+(o-n)*S),e.style.setProperty("--scroll-draw-progress",String(S));}let V=()=>U(y(),v,z,1);function D(){let S=V(),C=m?Math.max(P,E(O=Math.max(O,S))):E(S);L=C,K(C),C>=1&&!R?(R=true,w?.()):C<1&&!m&&(R=false);}W();{O=U(y(),v,z,1);let S=E(O);L=S,K(S);}let T=Ie(window,[e],V,D,W);Pe(e,{type:"counter",getProgress:()=>L,getTrigger:()=>({tStart:v,tEnd:z})});let X=()=>T.hold(false);return {destroy(){T.off(),e.style.setProperty("--scroll-draw-progress",se),ke(e);},replay(){P=-1,O=0,R=false,L=0,K(0),X();},pause:()=>T.hold(true),resume:X,seek(S){let C=Math.min(1,Math.max(0,S));L=C,P=C,O=0,T.hold(true),K(C);},getProgress(){return L}}}var Sr={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Pt(e,r={}){if(typeof window>"u")return Sr;let t=typeof e=="string"?document.querySelector(e):e;if(!t||t.tagName.toLowerCase()!=="video")return k("scrollVideo: <video> element not found:",e),Sr;let n=t,{trigger:o={},easing:s="linear",once:i=false,axis:c="y",preload:m="auto",triggerElement:g,onReady:w,onComplete:A,onProgress:E}=r,B=g??n,Q=window.matchMedia("(prefers-reduced-motion: reduce)").matches,v=De(s),z=ae(o.start||"top top"),Z=ae(o.end||"bottom top");n.pause(),n.hasAttribute("preload")||(n.preload=m);let P=r.from??0,O=r.to,L=0,R=0,y=false,$=-1,W=0,se=0,K=false,V=false,D=()=>c==="x"?window.scrollX:window.scrollY,T=()=>c==="x"?window.innerWidth:window.innerHeight;function X(){let x=B.getBoundingClientRect(),M=c==="x"?x.left:x.top,re=c==="x"?x.width:x.height,Re=Le({top:M,height:re},D(),T(),z,Z);L=Re.tStart,R=Re.tEnd,V&&R===L&&k("scrollVideo: zero-length trigger window, so it never scrubs. In a sticky stage, set triggerElement.",n);}let S=NaN;function C(x){if(!V)return;let M=O??n.duration??0,re=P+(M-P)*x;re!==S&&(S=re,n.currentTime=re),n.style.setProperty("--scroll-draw-progress",String(x)),E?.(x);}let ye=()=>U(D(),L,R,1);function I(){if(!V||Q)return;let x=ye(),M=i?Math.max($,v(W=Math.max(W,x))):v(x);se=M,C(M),M>=1&&!K?(K=true,A?.()):M<1&&!i&&(K=false);}let j=Ie(window,[B],ye,I,X),ue=()=>j.hold(y||!V||Q);ue();function Se(){if(V=true,O===void 0&&(O=n.duration),Q){C(1),w?.();return}X(),w?.(),y?C(se):ue();}n.readyState>=1?Se():n.addEventListener("loadedmetadata",Se,{once:true}),V||X();let fe=Q?()=>{}:Ze(x=>{x&&(fe(),Q=true,j.hold(true),C(1));});Pe(n,{type:"video",getProgress:()=>se,getTrigger:()=>({tStart:L,tEnd:R})});function ie(){y&&(y=false,ue());}return {destroy(){j.off(),n.removeEventListener("loadedmetadata",Se),fe(),ke(n);},replay(){$=-1,W=0,K=false,se=0,S=NaN,C(0),ie();},pause(){y=true,j.hold(true);},resume:ie,seek(x){let M=Math.min(1,Math.max(0,x));se=M,$=M,W=0,y=true,j.hold(true),S=NaN,C(M);},getProgress(){return se}}}var ln=1e4;function kt(e){let{frames:r,count:t}=e;if(typeof r!="function")return ct(e);let n=Number.isFinite(t)?Math.min(Math.max(Math.floor(t),0),ln):0,o;try{o=Array.from({length:n},(s,i)=>r(i));}catch{o=["throws"];}return ct({...e,frames:o})}function Er(e,r="<ScrollFrames>"){if(!e||e.getAttribute("aria-hidden")==="true")return;let t=e.getAttribute("role");t==="presentation"||t==="none"||e.getAttribute("aria-label")||e.getAttribute("aria-labelledby")||k(`${r}: the canvas has no aria-label. Say what the frames show, or set aria-hidden="true" if they are decoration.`,e);}var wt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function cn(e){let r=e>1?[0,e-1]:[0],t=[[0,e-1]];for(let n=0;n<t.length;n++){let[o,s]=t[n];if(s-o<2)continue;let i=o+s>>1;r.push(i),t.push([o,i],[i,s]);}return r}function Tr(e,r){if(typeof window>"u")return wt;let t=typeof e=="string"?document.querySelector(e):e;if(!t||t.tagName.toLowerCase()!=="canvas")return k("scrollFrames: <canvas> element not found:",e),wt;let n=t,{frames:o,trigger:s={},easing:i="linear",once:c=false,axis:m="y",fit:g="cover",triggerElement:w,onReady:A,onLoad:E,onComplete:B,onProgress:Q}=r||{},v=Array.isArray(o)?o:null,z=r?.count,Z=Math.floor(v?Math.min(z??v.length,v.length):z??NaN);if(!(v||typeof o=="function")||!Number.isFinite(Z)||Z<1)return k("scrollFrames: no frames. Pass `frames` as an array of URLs, or a function with a finite `count` of 1 or more.",n),wt;let P=r.concurrency??6;(!Number.isFinite(P)||P<1)&&(k("scrollFrames: `concurrency` must be a finite number of 1 or more; using 6.",r.concurrency),P=6),P=Math.floor(P);let O=n.getContext("2d");if(!O)return k("scrollFrames: the canvas has no 2D context.",n),wt;let L=Z-1,R=w??n,y=window.matchMedia("(prefers-reduced-motion: reduce)").matches,$=De(i),W=u=>{let p=$(u);return p===p?p:0},se=ae(s.start||"top top"),K=ae(s.end||"bottom top"),V=0,D=0,T=false,X=-1,S=0,C=0,ye=false,I=false,j=false,ue=false,Se=0,fe=-1,ie=new Array(Z),x=new Uint8Array(Z),M=new Set,re=y?[L]:cn(Z),Re=0,J=0,$e=false,Ee=(u,...p)=>{if(u)try{u(...p);}catch(b){typeof reportError=="function"?reportError(b):setTimeout(()=>{throw b});}},he=false,ze=u=>{let p;try{p=v?v[u]:o(u);}catch(b){p=b;}return typeof p=="string"&&p?p:(he||(he=true,k(`scrollFrames: no URL for frame ${u}; it is skipped for its nearest neighbour.`,p)),null)},Fe=()=>m==="x"?window.scrollX:window.scrollY,Te=()=>m==="x"?window.innerWidth:window.innerHeight;function Ce(){!$e&&J===re.length&&($e=true,Ee(E));}function l(){for(;!I&&M.size<P&&Re<re.length;){let u=re[Re++];x[u]||d(u);}}function d(u){x[u]=1;let p=ze(u);if(p===null){J++,queueMicrotask(()=>{I||Ce();});return}let b=new Image,le=false,we=We=>{le||I||(le=true,b.onload=b.onerror=null,M.delete(b),We?ie[u]=b:k("scrollFrames: a frame failed to load; its nearest neighbour shows instead:",p),J++,l(),_(),Ce());};M.add(b),b.decoding="async",b.onerror=()=>we(false),b.src=p,typeof b.decode=="function"?b.decode().then(()=>we(true),()=>{b.complete?we(b.naturalWidth>0):b.onload=()=>we(true);}):b.onload=()=>we(true);}function ne(u){for(let p=0;p<=L;p++){if(ie[u-p])return u-p;if(ie[u+p])return u+p}return -1}function F(){let u=n.clientWidth,p=n.clientHeight;if(!u||!p)return;let b=Math.min(window.devicePixelRatio||1,2),le=Math.round(u*b),we=Math.round(p*b);if(Math.abs(n.width-le)<=1&&Math.abs(n.height-we)<=1)return;n.width=le,n.height=we,fe=-1;let We=n.clientWidth,Oe=n.clientHeight;if(We!==u||Oe!==p){let Be=n.style;We!==u&&Oe!==p?(Be.width=`${u}px`,Be.height=`${p}px`):Be.aspectRatio=`${u} / ${p}`;}}function _(){let u=ne(Se);if(u<0||u===fe)return;let p=ie[u],b=n.width,le=n.height,we=p.naturalWidth||b,We=p.naturalHeight||le,Oe=(g==="contain"?Math.min:Math.max)(b/we,le/We),Be=we*Oe,Ge=We*Oe;O.clearRect(0,0,b,le),O.drawImage(p,(b-Be)/2,(le-Ge)/2,Be,Ge),fe=u,j||(j=true,Ee(A));}function G(u){Se=Math.min(L,Math.max(0,Math.round(u*L))),n.style.setProperty("--scroll-draw-progress",String(u)),_(),Ee(Q,u,Se);}function q(){let u=R.getBoundingClientRect(),p=m==="x"?u.left:u.top,b=m==="x"?u.width:u.height,le=Le({top:p,height:b},Fe(),Te(),se,K);V=le.tStart,D=le.tEnd,D===V&&b>0&&!y&&!ue&&(ue=true,k("scrollFrames: zero-length trigger window, so it never scrubs. In a sticky stage, set triggerElement.",n));}let _e=()=>U(Fe(),V,D,1);function oe(){if(y)return;let u=_e(),p=c?Math.max(X,W(S=Math.max(S,u))):W(u);C=p,G(p),p>=1&&!ye?(ye=true,Ee(B)):p<1&&!c&&(ye=false);}function He(){C=1,G(1);}F(),y||q();let be=Ie(window,[R],_e,oe,()=>{F(),y||q(),_();}),Qe=()=>be.hold(T||y);Qe(),y&&He(),l();let Ye=typeof ResizeObserver=="function"?new ResizeObserver(()=>{F(),_();}):null;Ye?.observe(n);let Ue=y?()=>{}:Ze(u=>{u&&(Ue(),y=true,be.hold(true),re=re.slice(0,Re),x[L]||re.push(L),Ce(),He(),l());});Pe(n,{type:"frames",getProgress:()=>C,getTrigger:()=>({tStart:V,tEnd:D})});function me(){I||!T||(T=false,Qe());}return {destroy(){if(!I){I=true,be.off(),Ye?.disconnect(),Ue();for(let u of M)u.onload=u.onerror=null,u.src="";M.clear(),ke(n);}},replay(){I||(X=-1,S=0,ye=false,C=0,G(0),me());},pause(){I||(T=true,be.hold(true));},resume:me,seek(u){if(I)return;let p=Math.min(1,Math.max(0,u===u?u:0));C=p,X=p,S=0,T=true,be.hold(true),G(p);},getProgress(){return C}}}function Rt(e,{triggerElement:r,...t},n){let o=r;return typeof r=="string"&&typeof document<"u"&&(o=document.querySelector(r),o||k(`scrollFrames: triggerElement "${r}" matches nothing; measuring the canvas.`)),Tr(e,{...t,frames:n.frames,triggerElement:o??void 0})}function xr(e,r){let t=document.createElement("span");t.textContent=r,t.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;user-select:none",e.appendChild(t);}function vt(e=""){let r=document.createElement("span");return r.setAttribute("aria-hidden","true"),r.textContent=e,r}function Lr(e){let r=e.textContent??"";return e.textContent="",r.split(/(\s+)/).filter(Boolean).map(t=>{let n=e.appendChild(vt(t)),o=/^\s+$/.test(t);return o?n.style.whiteSpace="pre":n.style.display="inline-block",o?null:n}).filter(t=>t!==null)}function un(e){let r=e.textContent??"";e.textContent="";let t=[],n=null;for(let o of r){let s=vt(o),i=o===" ";i?s.style.whiteSpace="pre":(s.style.display="inline-block",t.push(s)),i||o>"\u0DFF"?n=null:n||(n=e.appendChild(vt()),n.style.cssText="display:inline-block;white-space:nowrap"),(n??e).appendChild(s);}return t}function Mr(e){let r=Lr(e),t=new Map;for(let s of r){let i=s.offsetTop;t.has(i)||t.set(i,[]),t.get(i).push(s);}let n=[],o=Array.from(t.keys()).sort((s,i)=>s-i);for(let s of o){let i=t.get(s),c=vt();c.style.display="inline-block",i.forEach((m,g)=>{let w=m.nextElementSibling;c.appendChild(m),g<i.length-1&&w&&w.style.whiteSpace==="pre"&&c.appendChild(w);}),n.push(c);}return e.textContent="",n.forEach((s,i)=>{e.appendChild(s),i<n.length-1&&e.appendChild(document.createTextNode(" "));}),n}function fn(e,r,t,n){if(t<=1||n===0)return e;n=Math.min(n,1/t);let o=(t-1)*n,s=r*n,i=s+(1-o);return i<=s?e>=s?1:0:it((e-s)/(i-s),0,1)}function mn(e,r){let t=[];if(r?.y!==void 0&&t.push(`translateY(${r.y*(1-e)}px)`),r?.x!==void 0&&t.push(`translateX(${r.x*(1-e)}px)`),r?.rotate!==void 0&&t.push(`rotate(${r.rotate*(1-e)}deg)`),r?.scale!==void 0){let n=r.scale+(1-r.scale)*e;t.push(`scale(${n})`);}return t.join(" ")}var $t={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Ft(e,r={}){if(typeof window>"u")return $t;let t=typeof e=="string"?document.querySelector(e):e;if(!t)return k("scrollText: element not found:",e),$t;let n=t;return qe(r,(o,s)=>pn(n,o,s))}function pn(e,r,t){let{split:n="words",stagger:o=.04,easing:s="ease-out",from:i={opacity:0,y:24},trigger:c={},once:m=true,onComplete:g}=r,w=De(s,"ease-out"),A=ae(c.start||"top 85%"),E=ae(c.end||"top 40%"),B=e.innerHTML,Q=e.textContent??"",v;n==="chars"?v=un(e):n==="lines"?v=Mr(e):v=Lr(e),xr(e,Q);let z=v.length;function Z(T,X){i?.opacity!==void 0&&(T.style.opacity=String(i.opacity+(1-i.opacity)*X));let S=mn(X,i);S&&(T.style.transform=S);}function P(T){e.style.setProperty("--scroll-draw-progress",String(T)),v.forEach((X,S)=>{let C=w(fn(T,S,z,o));Z(X,C);});}if(t)return P(1),g?.(),{...$t,destroy:()=>{e.innerHTML=B;},getProgress:()=>1};P(0);let O=0,L=0,R=-1,y=0,$=false;function W(){({tStart:O,tEnd:L}=Le(e.getBoundingClientRect(),window.scrollY,window.innerHeight,A,E));}let se=()=>U(window.scrollY,O,L,1);function K(){let T=m?R=Math.max(R,se()):se();y=T,P(T),T>=1&&!$?($=true,g?.()):T<1&&!m&&($=false);}W();let V=Ie(window,[e],se,K,()=>{n==="lines"&&(e.innerHTML=B,v=Mr(e),xr(e,Q),P(y)),W();});Pe(e,{type:"text",getProgress:()=>y,getTrigger:()=>({tStart:O,tEnd:L})});let D=()=>V.hold(false);return {destroy(){V.off(),e.innerHTML=B,ke(e);},replay(){R=-1,$=false,y=0,P(0),D();},pause:()=>V.hold(true),resume:D,seek(T){V.hold(true),P(y=R=it(T,0,1));},getProgress(){return y}}}var rt=e=>typeof e=="function"?e():vue.unref(e);function Ve(e,r,t,n=ct){let o=null,s=r(),i=()=>{o?.destroy(),o=e.value?t(e.value,gr(s,()=>s),s):null;};vue.onMounted(i),vue.watch(()=>n(s=r()),i),vue.onUnmounted(()=>{o?.destroy(),o=null;});}function hn(e={}){let r=vue.ref(null);return Ve(r,()=>rt(e),Lt),r}var Cr={preset:0,selector:0,speed:0,fade:1,easing:0,trigger:0,stagger:0,direction:0,once:1,debug:1,axis:0,scrollContainer:0,autoReverse:1,delay:0,strokeColor:0,strokeWidth:0,fillOpacity:0,clip:2,waypoints:0,velocityScale:3,threshold:0,rootMargin:0,repeat:0,repeatDelay:0,morphTo:0,onProgress:0,onStart:0,onComplete:0,onEnter:0,onLeave:0,onEnterBack:0,onLeaveBack:0,autoplay:1,duration:0,native:1},bn=[null,Boolean,[Boolean,String],[Boolean,Number]],Ht=e=>({type:e,default:void 0}),Dt=vue.defineComponent({name:"ScrollDraw",props:Object.fromEntries(Object.entries(Cr).map(([e,r])=>[e,r?Ht(bn[r]):null])),setup(e,{slots:r}){let t=vue.ref(null);return Ve(t,()=>{let n={};for(let o in Cr){let s=e[o];s!=null&&(n[o]=s);}return n},Lt),()=>vue.h("div",{ref:t},r.default?.())}});function wn(e){let r=vue.ref(null);return Ve(r,()=>rt(e),Ct),r}var It=vue.defineComponent({name:"ScrollAnimate",props:{options:{type:Object,required:true}},setup(e,{slots:r}){let t=vue.ref(null);return Ve(t,()=>e.options,Ct),()=>vue.h("div",{ref:t},r.default?.())}});function vn(e){let r=vue.ref(null);return Ve(r,()=>rt(e),At),r}var Nt=vue.defineComponent({name:"ScrollCounter",props:{to:{type:Number,required:true},from:{type:Number},format:{type:Function},easing:{type:[String,Function]},trigger:{type:Object},once:Ht(Boolean),decimals:{type:Number},onComplete:{type:Function}},setup(e){let r=vue.ref(null);return Ve(r,()=>{let t={to:e.to};return e.from!=null&&(t.from=e.from),e.format!=null&&(t.format=e.format),e.easing!=null&&(t.easing=e.easing),e.trigger!=null&&(t.trigger=e.trigger),e.once!=null&&(t.once=e.once),e.decimals!=null&&(t.decimals=e.decimals),e.onComplete!=null&&(t.onComplete=e.onComplete),t},At),()=>vue.h("span",{ref:r})}});function Sn(e={}){let r=vue.ref(null);return Ve(r,()=>rt(e),Pt),r}var Vt=vue.defineComponent({name:"ScrollVideo",props:{src:{type:String,required:true},options:{type:Object},muted:{type:Boolean,default:true},playsInline:{type:Boolean,default:true},class:{type:String}},setup(e){let r=vue.ref(null);return Ve(r,()=>e.options??{},Pt),()=>vue.h("video",{ref:r,src:e.src,muted:e.muted,playsinline:e.playsInline,preload:"auto",class:e.class})}});function En(e){let r=vue.ref(null);return Ve(r,()=>rt(e),Rt,kt),r}var Or={frames:0,count:0,trigger:0,easing:0,once:1,axis:0,triggerElement:0,fit:0,concurrency:0,onReady:0,onLoad:0,onComplete:0,onProgress:0},_t=vue.defineComponent({name:"ScrollFrames",props:Object.fromEntries(Object.entries(Or).map(([e,r])=>[e,r?Ht(Boolean):e==="frames"?{required:true}:null])),setup(e){let r=vue.ref(null);return Ve(r,()=>{let t={};for(let n in Or){let o=e[n];o!=null&&(t[n]=o);}return t},Rt,kt),vue.onMounted(()=>Er(r.value)),()=>vue.h("canvas",{ref:r,role:"img"})}});function Tn(e={}){let r=vue.ref(null);return Ve(r,()=>rt(e),Ft),r}var zt=vue.defineComponent({name:"ScrollText",props:{options:{type:Object},tag:{type:String,default:"p"}},setup(e,{slots:r}){let t=vue.ref(null);return Ve(t,()=>e.options??{},Ft),()=>vue.h(e.tag,{ref:t},r.default?.())}});function as(){return {install(e){e.component("ScrollDraw",Dt),e.component("ScrollAnimate",It),e.component("ScrollCounter",Nt),e.component("ScrollVideo",Vt),e.component("ScrollFrames",_t),e.component("ScrollText",zt);}}}exports.ScrollAnimate=It;exports.ScrollCounter=Nt;exports.ScrollDraw=Dt;exports.ScrollFrames=_t;exports.ScrollText=zt;exports.ScrollVideo=Vt;exports.createScrollDrawPlugin=as;exports.useScrollAnimate=wn;exports.useScrollCounter=vn;exports.useScrollDraw=hn;exports.useScrollFrames=En;exports.useScrollText=Tn;exports.useScrollVideo=Sn;
|