svg-scroll-draw 2.17.0 → 2.17.1

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