svg-scroll-draw 2.23.1 → 2.23.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -19
- package/dist/angular/index.cjs +3 -3
- package/dist/angular/index.mjs +1 -1
- package/dist/astro/index.cjs +2 -2
- package/dist/astro/index.mjs +1 -1
- package/dist/cdn/svg-scroll-draw.dev.global.js +140 -176
- package/dist/cdn/svg-scroll-draw.global.js +3 -3
- package/dist/chunk-6TWFLRUB.mjs +3 -0
- package/dist/{chunk-OTDD2ROH.mjs → chunk-DSFD227B.mjs} +1 -1
- package/dist/chunk-I73SOXBN.mjs +1 -0
- package/dist/chunk-NLPSVYFP.mjs +1 -0
- package/dist/chunk-OPXWNJBG.mjs +1 -0
- package/dist/chunk-QFSTKVA3.mjs +1 -0
- package/dist/chunk-UPWWULKI.mjs +1 -0
- package/dist/chunk-XC5NR2MU.mjs +1 -0
- package/dist/{chunk-GVBO5GRD.mjs → chunk-XTPAW6XR.mjs} +1 -1
- package/dist/{chunk-VMUJMXKO.mjs → chunk-ZNCZYV3Q.mjs} +1 -1
- package/dist/group/index.cjs +2 -2
- package/dist/group/index.d.mts +4 -2
- package/dist/group/index.d.ts +4 -2
- package/dist/group/index.mjs +1 -1
- package/dist/horizontal/index.cjs +1 -1
- package/dist/horizontal/index.d.mts +10 -7
- package/dist/horizontal/index.d.ts +10 -7
- package/dist/horizontal/index.mjs +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.mjs +1 -1
- package/dist/nuxt/index.cjs +3 -3
- package/dist/nuxt/index.mjs +1 -1
- package/dist/progress/index.cjs +1 -1
- package/dist/progress/index.mjs +1 -1
- package/dist/react/index.cjs +3 -3
- package/dist/react/index.d.mts +3 -1
- package/dist/react/index.d.ts +3 -1
- package/dist/react/index.mjs +1 -1
- package/dist/reveal/index.cjs +1 -1
- package/dist/reveal/index.d.mts +9 -3
- package/dist/reveal/index.d.ts +9 -3
- package/dist/reveal/index.mjs +1 -1
- package/dist/snap/index.cjs +1 -1
- package/dist/snap/index.mjs +1 -1
- package/dist/solid/index.cjs +3 -3
- package/dist/solid/index.mjs +1 -1
- package/dist/svelte/index.cjs +3 -3
- package/dist/svelte/index.mjs +1 -1
- package/dist/text/index.cjs +1 -1
- package/dist/text/index.mjs +1 -1
- package/dist/timeline/index.cjs +1 -1
- package/dist/timeline/index.mjs +1 -1
- package/dist/video/index.cjs +1 -1
- package/dist/video/index.mjs +1 -1
- package/dist/vue/index.cjs +3 -3
- package/dist/vue/index.mjs +1 -1
- package/dist/web-component/index.cjs +3 -3
- package/dist/web-component/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-DY5JCXVR.mjs +0 -1
- package/dist/chunk-HX4SP5WN.mjs +0 -3
- package/dist/chunk-KV3WCPQ5.mjs +0 -1
- package/dist/chunk-LTCJVVSC.mjs +0 -1
- package/dist/chunk-WXUOF4NM.mjs +0 -1
- package/dist/chunk-YWKPTYSG.mjs +0 -1
- package/dist/chunk-YZV4Z3EQ.mjs +0 -1
package/dist/reveal/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function je({bounces:e=3,decay:t=.5}={}){let n=Math.max(1,Math.round(e)),r=Math.max(.01,Math.min(.99,t)),o=Math.sqrt(r),i=0,u=[];for(let l=0;l<n;l++){let f=Math.pow(o,l);u.push(f),i+=f;}let m=[0],c=0;for(let l=0;l<n;l++)c+=u[l]/i,m.push(c);return l=>{if(l<=0)return 0;if(l>=1)return 1;for(let f=0;f<n;f++)if(l<=m[f+1]){let g=(l-m[f])/(m[f+1]-m[f]);if(f===0)return g*(2-g);let T=1-Math.pow(r,f);return T+(1-T)*(2*g-1)*(2*g-1)}return 1}}function Ye({amplitude:e=1,period:t=.4}={}){let n=Math.max(1,e),r=Math.max(.1,t),o=n<=1?r/4:r/(2*Math.PI)*Math.asin(1/n);return i=>i<=0?0:i>=1?1:n*Math.pow(2,-10*i)*Math.sin((i-o)*(2*Math.PI)/r)+1}var D={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:je(),elastic:Ye()};function be(e,t,n){return Math.min(n,Math.max(t,e))}function ae(e="top bottom"){let t=e.trim();if(/^\d+(\.\d+)?%$/.test(t))return {element:"top",viewport:t};let[n="top",r="bottom"]=t.split(/\s+/).filter(Boolean);return {element:n,viewport:r}}function ye(e,t,n,r){switch(r){case "top":return e+n;case "center":return e+n+t/2;case "bottom":return e+n+t;default:return e+n}}function ve(e,t){if(/^\d+(\.\d+)?%$/.test(e))return t*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return t/2;case "bottom":return t;default:return t}}function q(e,t,n,r){return n===t?0:be((e-t)/(n-t)*r,0,1)}function ue(e,t,n,r,o){let i=ye(e.top,e.height,t,r.element)-ve(r.viewport,n),u=ye(e.top,e.height,t,o.element)-ve(o.viewport,n);return {tStart:i,tEnd:u}}function Ee(e,t,n){let r=e.getBoundingClientRect(),o=n==="x"?r.width:r.height;return t?{top:n==="x"?r.left-t.getBoundingClientRect().left+t.scrollLeft:r.top-t.getBoundingClientRect().top+t.scrollTop,height:o,scroll:0}:{top:n==="x"?r.left:r.top,height:o,scroll:n==="x"?window.scrollX:window.scrollY}}function we(e){let t=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(t)return [parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)];let n=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(n)return [parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16)];let r=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return r?[parseInt(r[1]),parseInt(r[2]),parseInt(r[3])]:null}function Se(e,t,n){let r=we(e),o=we(t);return !r||!o?e:`rgb(${Math.round(r[0]+(o[0]-r[0])*n)},${Math.round(r[1]+(o[1]-r[1])*n)},${Math.round(r[2]+(o[2]-r[2])*n)})`}var qe="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",Ge="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Me=33;function Ue(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function Ke(e){let t=[];for(let n=0;n<Me;n++){let r=n/(Me-1);t.push(String(Math.round(e(r)*1e5)/1e5));}return `linear(${t.join(",")})`}function xe(e){switch(e){case "linear":return "linear";case "ease-in":return qe;case "ease-out":return Ge;case "ease-in-out":return Ue()?Ke(D["ease-in-out"]):null;default:return null}}var Le=Symbol.for("svg-scroll-draw.registry");function Re(){let e=globalThis;return e[Le]||(e[Le]=new Map)}function ce(e,t){Re().set(e,t);}function le(e){Re().delete(e);}var Ze=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function G(e,...t){Ze&&console.warn(`[svg-scroll-draw] ${e}`,...t);}var H,U=new Set,K=new WeakMap,W=new Map,Te=e=>{let t=e.getBoundingClientRect();return t.width+" "+t.height};function Je(e){let t=new Set;for(let n of e)for(;n&&n!==document.body;n=n.parentElement)for(let r=n;r;r=r.previousElementSibling)t.add(r);return t}function Pe(e,t){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let n=()=>t();H??(H=new ResizeObserver(o=>{let i=false;for(let{target:u}of o)K.get(u)!==Te(u)&&(i=true),K.set(u,"");i&&U.forEach(u=>u());})),U.add(n);let r=Je(e);return [document.body,document.documentElement].forEach(o=>o&&r.add(o)),r.forEach(o=>{K.has(o)||K.set(o,Te(o)),W.set(o,(W.get(o)??0)+1),H.observe(o);}),()=>{U.delete(n)&&(r.forEach(o=>{let i=(W.get(o)??1)-1;if(i)return void W.set(o,i);W.delete(o),H?.unobserve(o);}),U.size||(H?.disconnect(),H=void 0));}}function $e(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let t=window.matchMedia("(prefers-reduced-motion: reduce)"),n=o=>e(!!o.matches);if(typeof t.addEventListener=="function")return t.addEventListener("change",n),()=>t.removeEventListener("change",n);let r=t;return r.addListener?.(n),()=>r.removeListener?.(n)}function Ae(e,t){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t(e,true);let n=t(e,false),r=$e(i=>{if(!i)return;r();let u=(n.getProgress?.()??0)>=1;n.destroy(),n=t(u?{...e,onComplete:void 0}:e,true);}),o={};for(let i of Object.keys(n))o[i]=(...u)=>n[i]?.(...u);return o.destroy=()=>{r(),n.destroy();},o}function et(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Ie(e){let t=[],n=/([\w]+)\(([^)]*)\)/g,r;for(;(r=n.exec(e))!==null;){let o=[],i=[],u=r[2].trim();if(u)for(let m of u.split(/[\s,]+/)){let c=m.match(/^([-+]?[\d.eE]+)(.*)$/);o.push(c?parseFloat(c[1]):0),i.push(c?c[2]:"");}t.push({fn:r[1],nums:o,units:i});}return t}function tt(e,t,n){let r=Ie(e),o=Ie(t);return r.length===0||r.length!==o.length?n<1?e:t:r.map((i,u)=>{let m=o[u];return i.fn!==m.fn||i.nums.length!==m.nums.length?n<1?`${i.fn}(${i.nums.map((c,l)=>`${c}${i.units[l]}`).join(", ")})`:`${m.fn}(${m.nums.map((c,l)=>`${c}${m.units[l]}`).join(", ")})`:`${i.fn}(${i.nums.map((c,l)=>`${c+(m.nums[l]-c)*n}${i.units[l]}`).join(", ")})`}).join(" ")}function Ce(e,t,n){if(typeof e=="number"&&typeof t=="number")return String(e+(t-e)*n);let r=String(e),o=String(t);if(et(r))return Se(r,o,n);if(r.includes("("))return tt(r,o,n);let i=r.match(/^([-+]?[\d.]+)(.*)$/),u=o.match(/^([-+]?[\d.]+)(.*)$/);if(i&&u){let m=parseFloat(i[1]),c=parseFloat(u[1]);return `${m+(c-m)*n}${i[2]||u[2]}`}return n<1?r:o}function nt(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}var rt=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),ot=0,_e="--scroll-draw-progress";function st(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var Oe={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Fe(e,t){return typeof window>"u"?Oe:t.respectReducedMotion===false?Ne(e,t,false):Ae(t,(n,r)=>Ne(e,n,r))}function Ne(e,t,n){let{props:r,trigger:o={},easing:i="ease-out",speed:u=1,once:m=false,axis:c="y",scrollContainer:l,native:f=true,velocityScale:g=false,triggerElement:T,onProgress:P,onComplete:S,onEnter:O,onLeave:F,onEnterBack:z,onLeaveBack:B}=t,M=typeof i=="function"?i:D[i]??D["ease-out"],$=ae(o.start??"top bottom"),A=ae(o.end??"bottom top"),X=T??e,b=typeof l=="string"?document.querySelector(l):l??null,y=Object.entries(r).map(([s,a])=>({prop:nt(s),from:Array.isArray(a)?a[0]:"",to:Array.isArray(a)?a[1]:a}));function De(){let s=window.getComputedStyle(e);for(let a of y)a.from===""&&(a.from=s.getPropertyValue(a.prop).trim()||"0");}function He(){for(let s of y)e.style.setProperty(s.prop,String(s.to));}let Z=new Map;for(let s of [...y.map(a=>a.prop),_e])Z.set(s,e.style.getPropertyValue(s));function J(){for(let[s,a]of Z)a?e.style.setProperty(s,a):e.style.removeProperty(s);}if(n)return He(),S?.(),{...Oe,destroy:J,getProgress:()=>1};De();let fe=typeof i=="string"?xe(i):null;function We(){if(!f||!st()||!fe||c!=="y"||b||X!==e||m||u!==1||P||S||O||F||z||B||g!==false||(o.start??"top bottom").trim()!=="top bottom"||(o.end??"bottom top").trim()!=="bottom top")return false;for(let s of y)if(!rt.has(s.prop))return false;return true}function ze(){let s=`ssd-a-${++ot}`,a=y.map(d=>`${d.prop}:${d.from}`).join(";"),_=y.map(d=>`${d.prop}:${d.to}`).join(";"),E=document.createElement("style");E.setAttribute("data-ssd-animate",""),E.textContent=`@keyframes ${s}{from{${a}}to{${_}}}.${s}{animation-name:${s};animation-duration:auto;animation-timing-function:${fe};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(E),e.classList.add(s);let p=()=>c==="x"?window.scrollX:window.scrollY,h=()=>c==="x"?window.innerWidth:window.innerHeight,N=()=>{let d=e.getBoundingClientRect();return ue({top:d.top,height:d.height},p(),h(),$,A)};ce(e,{type:"animate",getProgress:()=>oe.getProgress(),getTrigger:N});let oe={refresh(){},destroy(){e.classList.remove(s),E.remove(),e.style.animationPlayState="",J(),le(e);},replay(){e.classList.remove(s),e.offsetWidth,e.classList.add(s);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(d){let se=Math.min(1,Math.max(0,d));e.classList.remove(s);for(let ie of y)e.style.setProperty(ie.prop,Ce(ie.from,ie.to,se));},getProgress(){let{tStart:d,tEnd:se}=N();return M(q(p(),d,se,u))}};return oe}if(We())return ze();let v=0,w=0,x=0,Q=false,L=false,I=-1,C=0,j=false,R=NaN,ee=-1,pe=0,de=()=>b?c==="x"?b.scrollLeft:b.scrollTop:c==="x"?window.scrollX:window.scrollY,Be=()=>b?c==="x"?b.clientWidth:b.clientHeight:c==="x"?window.innerWidth:window.innerHeight,k=X===e?y:[],ge=false;function te(){let s=e.style,a=k.map(h=>s.getPropertyValue(h.prop)),_=s.transition;k.length&&(s.transition="none"),k.forEach(h=>s.setProperty(h.prop,Z.get(h.prop)??""));let E=Ee(X,b,c);k.forEach((h,N)=>s.setProperty(h.prop,a[N])),k.length&&(e.offsetWidth,s.transition=_);let p=ue(E,E.scroll,Be(),$,A);ge&&Math.abs(p.tStart-v)<1&&Math.abs(p.tEnd-w)<1||(ge=true,v=p.tStart,w=p.tEnd);}function Y(s){e.style.setProperty(_e,String(s));for(let a of y)e.style.setProperty(a.prop,Ce(a.from,a.to,s));P?.(s);}function Xe(s){if(isNaN(R)){R=s;return}R<=0&&s>0?O?.():R>0&&s<=0&&B?.(),R<1&&s>=1?F?.():R>=1&&s<1&&z?.(),R=s;}function ne(){if(!Q||L)return;let s=performance.now(),a=de(),_=u;if(g!==false){let h=s-pe,N=h>0?Math.abs(a-(ee<0?a:ee))/h:0;_=u*Math.max(.2,1+N*(typeof g=="number"?g:1)*.04);}ee=a,pe=s;let E=w===v?0:(a-v)/(w-v);Xe(E);let p=M(q(a,v,w,_));m&&(I=Math.max(I,p),p=I),C=p,Y(p),p>=1&&!j?(j=true,S?.()):p<1&&!m&&(j=false),x=requestAnimationFrame(ne);}te(),w===v&&G("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e);{let s=M(q(de(),v,w,u));m&&s>0&&(I=s),C=s,Y(s);}let he=new IntersectionObserver(s=>{s.forEach(a=>{Q=a.isIntersecting,Q&&!L?x=requestAnimationFrame(ne):cancelAnimationFrame(x);});},{root:b??null}),re;function V(){clearTimeout(re),re=setTimeout(te,150);}window.addEventListener("resize",V),window.addEventListener("orientationchange",V);let Qe=Pe([X],V);return he.observe(e),ce(e,{type:"animate",getProgress:()=>C,getTrigger:()=>({tStart:v,tEnd:w})}),{destroy(){cancelAnimationFrame(x),he.disconnect(),window.removeEventListener("resize",V),window.removeEventListener("orientationchange",V),Qe(),clearTimeout(re),J(),le(e);},replay(){I=-1,j=false,C=0,L=false,Y(0);},pause(){L=true,cancelAnimationFrame(x);},resume(){L&&(L=false,Q&&(x=requestAnimationFrame(ne)));},seek(s){let a=Math.min(1,Math.max(0,s));C=a,I=a,L=true,cancelAnimationFrame(x),Y(a);},getProgress(){return C},refresh(){te();}}}var it={fadeUp:{opacity:0,y:32},fadeDown:{opacity:0,y:-32},fadeLeft:{opacity:0,x:32},fadeRight:{opacity:0,x:-32},scale:{opacity:0,scale:.88},flip:{opacity:0,rotateX:20},flipX:{opacity:0,rotateY:20}};function at(e){let t={};e.opacity!==void 0&&(t.opacity=[e.opacity,1]);let n=[],r=[];return e.x!==void 0&&(n.push(`translateX(${e.x}px)`),r.push("translateX(0px)")),e.y!==void 0&&(n.push(`translateY(${e.y}px)`),r.push("translateY(0px)")),e.scale!==void 0&&(n.push(`scale(${e.scale})`),r.push("scale(1)")),e.rotate!==void 0&&(n.push(`rotate(${e.rotate}deg)`),r.push("rotate(0deg)")),e.rotateX!==void 0&&(n.push(`rotateX(${e.rotateX}deg)`),r.push("rotateX(0deg)")),e.rotateY!==void 0&&(n.push(`rotateY(${e.rotateY}deg)`),r.push("rotateY(0deg)")),n.length>0&&(t.transform=[n.join(" "),r.join(" ")]),t}function ut(e){return typeof e=="string"?Array.from(document.querySelectorAll(e)):e instanceof NodeList?Array.from(e):e}function me(e){let t=e.trim().split(/\s+/),[n,r]=t.length>1?t:/%$/.test(t[0])?["top",t[0]]:[t[0],"bottom"];return [n,/%$/.test(r)?parseFloat(r):r==="top"?0:r==="center"?50:100]}function ke(e,t){let[n,r]=me(e);return `${n} ${+Math.max(0,r-t).toFixed(3)}%`}function ct(e){let t=NaN,n=0,r=0;return e.map(o=>{let i=o.getBoundingClientRect();return Math.abs(i.top-t)<=Math.max(8,Math.min(i.height,n||i.height)/2)?r++:(t=i.top,n=i.height,r=0),r})}var Ve={destroy:()=>{}};function Ft(e,t={}){if(typeof window>"u")return Ve;let n=ut(e);if(!n.length)return G("scrollReveal: no elements found:",e),Ve;let{preset:r="fadeUp",from:o,stagger:i=.15,easing:u="ease-out",once:m=true,trigger:c,onEnter:l,onLeave:f}=t,g={...it[r],...o},T=at(g),P=c?.start??"top 88%",S=c?.end??"top 53%",O=Math.abs(me(P)[1]-me(S)[1]),F=Math.min(Math.max(i,0),1)*O,z=F>0?ct(n):n.map(()=>0),B=n.map((M,$)=>{let A=Math.min(z[$]*F,O);return Fe(M,{props:T,easing:u,once:m,native:false,trigger:A>0?{start:ke(P,A),end:ke(S,A)}:{start:P,end:S},onEnter:$===0?l:void 0,onLeave:$===n.length-1?f:void 0})});return {destroy(){B.forEach(M=>M.destroy());}}}exports.scrollReveal=Ft;
|
|
1
|
+
'use strict';function Ge({bounces:e=3,decay:t=.5}={}){let n=Math.max(1,Math.round(e)),r=Math.max(.01,Math.min(.99,t)),o=Math.sqrt(r),s=0,u=[];for(let l=0;l<n;l++){let p=Math.pow(o,l);u.push(p),s+=p;}let m=[0],c=0;for(let l=0;l<n;l++)c+=u[l]/s,m.push(c);return l=>{if(l<=0)return 0;if(l>=1)return 1;for(let p=0;p<n;p++)if(l<=m[p+1]){let g=(l-m[p])/(m[p+1]-m[p]);if(p===0)return g*(2-g);let T=1-Math.pow(r,p);return T+(1-T)*(2*g-1)*(2*g-1)}return 1}}function Ue({amplitude:e=1,period:t=.4}={}){let n=Math.max(1,e),r=Math.max(.1,t),o=n<=1?r/4:r/(2*Math.PI)*Math.asin(1/n);return s=>s<=0?0:s>=1?1:n*Math.pow(2,-10*s)*Math.sin((s-o)*(2*Math.PI)/r)+1}var W={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:Ge(),elastic:Ue()};function we(e,t,n){return Math.min(n,Math.max(t,e))}function ae(e="top bottom"){let t=e.trim();if(/^\d+(\.\d+)?%$/.test(t))return {element:"top",viewport:t};let[n="top",r="bottom"]=t.split(/\s+/).filter(Boolean);return {element:n,viewport:r}}function Se(e,t,n,r){switch(r){case "top":return e+n;case "center":return e+n+t/2;case "bottom":return e+n+t;default:return e+n}}function Me(e,t){if(/^\d+(\.\d+)?%$/.test(e))return t*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return t/2;case "bottom":return t;default:return t}}function B(e,t,n,r){return n===t?0:we((e-t)/(n-t)*r,0,1)}function ue(e,t,n,r,o){let s=Se(e.top,e.height,t,r.element)-Me(r.viewport,n),u=Se(e.top,e.height,t,o.element)-Me(o.viewport,n);return {tStart:s,tEnd:u}}function xe(e,t,n){let r=e.getBoundingClientRect(),o=n==="x"?r.width:r.height;return t?{top:n==="x"?r.left-t.getBoundingClientRect().left-t.clientLeft+t.scrollLeft:r.top-t.getBoundingClientRect().top-t.clientTop+t.scrollTop,height:o,scroll:0}:{top:n==="x"?r.left:r.top,height:o,scroll:n==="x"?window.scrollX:window.scrollY}}function Le(e){let t=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(t)return [parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)];let n=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(n)return [parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16)];let r=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return r?[parseInt(r[1]),parseInt(r[2]),parseInt(r[3])]:null}function Re(e,t,n){let r=Le(e),o=Le(t);return !r||!o?e:`rgb(${Math.round(r[0]+(o[0]-r[0])*n)},${Math.round(r[1]+(o[1]-r[1])*n)},${Math.round(r[2]+(o[2]-r[2])*n)})`}var Ke="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",Ze="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Te=33;function Je(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function et(e){let t=[];for(let n=0;n<Te;n++){let r=n/(Te-1);t.push(String(Math.round(e(r)*1e5)/1e5));}return `linear(${t.join(",")})`}function Pe(e){switch(e){case "linear":return "linear";case "ease-in":return Ke;case "ease-out":return Ze;case "ease-in-out":return Je()?et(W["ease-in-out"]):null;default:return null}}var $e=Symbol.for("svg-scroll-draw.registry");function Ae(){let e=globalThis;return e[$e]||(e[$e]=new Map)}function ce(e,t){Ae().set(e,t);}function le(e){Ae().delete(e);}var tt=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function Z(e,...t){tt&&console.warn(`[svg-scroll-draw] ${e}`,...t);}var X,J=new Set,ee=new WeakMap,Q=new Map,Ie=e=>{let t=e.getBoundingClientRect();return t.width+" "+t.height};function nt(e){let t=new Set;for(let n of e)for(;n&&n!==document.body;n=n.parentElement)for(let r=n;r;r=r.previousElementSibling)t.add(r);return t}function Ce(e,t){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let n=()=>t();X??(X=new ResizeObserver(o=>{let s=false;for(let{target:u}of o)ee.get(u)!==Ie(u)&&(s=true),ee.set(u,"");s&&J.forEach(u=>u());})),J.add(n);let r=nt(e);return [document.body,document.documentElement].forEach(o=>o&&r.add(o)),r.forEach(o=>{ee.has(o)||ee.set(o,Ie(o)),Q.set(o,(Q.get(o)??0)+1),X.observe(o);}),()=>{J.delete(n)&&(r.forEach(o=>{let s=(Q.get(o)??1)-1;if(s)return void Q.set(o,s);Q.delete(o),X?.unobserve(o);}),J.size||(X?.disconnect(),X=void 0));}}function _e(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let t=window.matchMedia("(prefers-reduced-motion: reduce)"),n=o=>e(!!o.matches);if(typeof t.addEventListener=="function")return t.addEventListener("change",n),()=>t.removeEventListener("change",n);let r=t;return r.addListener?.(n),()=>r.removeListener?.(n)}function Ne(e,t){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t(e,true);let n=t(e,false),r=_e(s=>{if(!s)return;r();let u=(n.getProgress?.()??0)>=1;n.destroy(),n=t(u?{...e,onComplete:void 0}:e,true);}),o={};for(let s of Object.keys(n))o[s]=(...u)=>n[s]?.(...u);return o.destroy=()=>{r(),n.destroy();},o}function rt(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Oe(e){let t=[],n=/([\w]+)\(([^)]*)\)/g,r;for(;(r=n.exec(e))!==null;){let o=[],s=[],u=r[2].trim();if(u)for(let m of u.split(/[\s,]+/)){let c=m.match(/^([-+]?[\d.eE]+)(.*)$/);o.push(c?parseFloat(c[1]):0),s.push(c?c[2]:"");}t.push({fn:r[1],nums:o,units:s});}return t}function ot(e,t,n){let r=Oe(e),o=Oe(t);return r.length===0||r.length!==o.length?n<1?e:t:r.map((s,u)=>{let m=o[u];return s.fn!==m.fn||s.nums.length!==m.nums.length?n<1?`${s.fn}(${s.nums.map((c,l)=>`${c}${s.units[l]}`).join(", ")})`:`${m.fn}(${m.nums.map((c,l)=>`${c}${m.units[l]}`).join(", ")})`:`${s.fn}(${s.nums.map((c,l)=>`${c+(m.nums[l]-c)*n}${s.units[l]}`).join(", ")})`}).join(" ")}function ke(e,t,n){if(typeof e=="number"&&typeof t=="number")return String(e+(t-e)*n);let r=String(e),o=String(t);if(rt(r))return Re(r,o,n);if(r.includes("("))return ot(r,o,n);let s=r.match(/^([-+]?[\d.]+)(.*)$/),u=o.match(/^([-+]?[\d.]+)(.*)$/);if(s&&u){let m=parseFloat(s[1]),c=parseFloat(u[1]);return `${m+(c-m)*n}${s[2]||u[2]}`}return n<1?r:o}function st(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}var it=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),at=0,Fe="--scroll-draw-progress";function ut(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var Ve={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function He(e,t){return typeof window>"u"?Ve:t.respectReducedMotion===false?De(e,t,false):Ne(t,(n,r)=>De(e,n,r))}function De(e,t,n){let{props:r,trigger:o={},easing:s="ease-out",speed:u=1,once:m=false,axis:c="y",scrollContainer:l,native:p=true,velocityScale:g=false,triggerElement:T,onProgress:P,onComplete:M,onEnter:O,onLeave:k,onEnterBack:j,onLeaveBack:Y}=t,S=typeof s=="function"?s:W[s]??W["ease-out"],$=ae(o.start||"top bottom"),A=ae(o.end||"bottom top"),q=T??e,y=typeof l=="string"?document.querySelector(l):l??null,v=Object.entries(r).map(([i,a])=>({prop:st(i),from:Array.isArray(a)?a[0]:"",to:Array.isArray(a)?a[1]:a}));function Be(){let i=window.getComputedStyle(e);for(let a of v)a.from===""&&(a.from=i.getPropertyValue(a.prop).trim()||"0");}function Xe(){for(let i of v)e.style.setProperty(i.prop,String(i.to));}let te=new Map;for(let i of [...v.map(a=>a.prop),Fe])te.set(i,e.style.getPropertyValue(i));function ne(){for(let[i,a]of te)a?e.style.setProperty(i,a):e.style.removeProperty(i);}if(n)return Xe(),M?.(),{...Ve,destroy:ne,getProgress:()=>1};Be();let F=()=>y?c==="x"?y.scrollLeft:y.scrollTop:c==="x"?window.scrollX:window.scrollY,fe=()=>y?c==="x"?y.clientWidth:y.clientHeight:c==="x"?window.innerWidth:window.innerHeight,pe=typeof s=="string"?Pe(s):null;function Qe(){if(!p||!ut()||!pe||c!=="y"||y||q!==e||m||u!==1||P||M||O||k||j||Y||g!==false||(o.start||"top bottom").trim()!=="top bottom"||(o.end||"bottom top").trim()!=="bottom top")return false;for(let i of v)if(!it.has(i.prop))return false;return true}function je(){let i=`ssd-a-${++at}`,a=v.map(f=>`${f.prop}:${f.from}`).join(";"),N=v.map(f=>`${f.prop}:${f.to}`).join(";"),w=document.createElement("style");w.setAttribute("data-ssd-animate",""),w.textContent=`@keyframes ${i}{from{${a}}to{${N}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${pe};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(w),e.classList.add(i);let h=()=>{let f=e.getBoundingClientRect();return ue({top:f.top,height:f.height},F(),fe(),$,A)};ce(e,{type:"animate",getProgress:()=>d.getProgress(),getTrigger:h});let d={refresh(){},destroy(){e.classList.remove(i),w.remove(),e.style.animationPlayState="",ne(),le(e);},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(f){let z=Math.min(1,Math.max(0,f));e.classList.remove(i);for(let K of v)e.style.setProperty(K.prop,ke(K.from,K.to,z));},getProgress(){let{tStart:f,tEnd:z}=h();return S(B(F(),f,z,u))}};return d}if(Qe())return je();let b=0,E=0,D=0,I=NaN,x=false,re=-1,C=0,L=0,G=false,R=NaN,oe=-1,de=0,V=q===e?v:[],ge=false;function be(){let i=e.style,a=V.map(d=>i.getPropertyValue(d.prop)),N=i.transition;V.length&&(i.transition="none"),V.forEach(d=>i.setProperty(d.prop,te.get(d.prop)??""));let w=xe(q,y,c);V.forEach((d,f)=>i.setProperty(d.prop,a[f])),V.length&&(e.offsetWidth,i.transition=N);let h=ue(w,w.scroll,fe(),$,A);ge&&Math.abs(h.tStart-b)<1&&Math.abs(h.tEnd-E)<1||(ge=true,b=h.tStart,E=h.tEnd);}function U(i){e.style.setProperty(Fe,String(i));for(let a of v)e.style.setProperty(a.prop,ke(a.from,a.to,i));P?.(i);}function Ye(i){if(isNaN(R)){R=i;return}R<=0&&i>0?O?.():R>0&&i<=0&&Y?.(),R<1&&i>=1?k?.():R>=1&&i<1&&j?.(),R=i;}let he=i=>B(i,b,E,Math.min(u,1));function _(){!D&&!x&&he(F())!==I&&(D=requestAnimationFrame(ye));}function ye(){if(x)return;let i=performance.now(),a=F(),N=u;if(g!==false){let f=i-de,z=f>0?Math.abs(a-(oe<0?a:oe))/f:0;N=u*Math.max(.2,1+z*(typeof g=="number"?g:1)*.04);}oe=a,de=i;let w=E===b?0:(a-b)/(E-b);Ye(w);let h=B(a,b,E,N),d=m?Math.max(re,S(C=Math.max(C,h))):S(h);L=d,U(d),d>=1&&!G?(G=true,M?.()):d<1&&!m&&(G=false),!x&&(I=he(a),D=I>0&&I<1?requestAnimationFrame(ye):0);}be(),E===b&&Z("scrollAnimate: zero-length trigger window, so it never animates. In a sticky stage, set triggerElement.",e),C=B(F(),b,E,u),L=S(C),U(L);function ve(){be(),_();}let se;function H(){clearTimeout(se),se=setTimeout(ve,150);}let Ee=y??window;Ee.addEventListener("scroll",_,{passive:true}),window.addEventListener("resize",H),window.addEventListener("orientationchange",H);let qe=Ce([q],H);_(),ce(e,{type:"animate",getProgress:()=>L,getTrigger:()=>({tStart:b,tEnd:E})});function ie(){x=true,cancelAnimationFrame(D),D=0,I=NaN;}return {destroy(){ie(),Ee.removeEventListener("scroll",_),window.removeEventListener("resize",H),window.removeEventListener("orientationchange",H),qe(),clearTimeout(se),ne(),le(e);},replay(){re=-1,C=0,G=false,L=0,x=false,U(0),I=0,_();},pause:ie,resume(){x&&(x=false,_());},seek(i){let a=Math.min(1,Math.max(0,i));L=a,re=a,C=0,ie(),U(a);},getProgress(){return L},refresh:ve}}var ct={fadeUp:{opacity:0,y:32},fadeDown:{opacity:0,y:-32},fadeLeft:{opacity:0,x:32},fadeRight:{opacity:0,x:-32},scale:{opacity:0,scale:.88},flip:{opacity:0,rotateX:20},flipX:{opacity:0,rotateY:20}};function lt(e){let t={};e.opacity!==void 0&&(t.opacity=[e.opacity,1]);let n=[],r=[];return e.x!==void 0&&(n.push(`translateX(${e.x}px)`),r.push("translateX(0px)")),e.y!==void 0&&(n.push(`translateY(${e.y}px)`),r.push("translateY(0px)")),e.scale!==void 0&&(n.push(`scale(${e.scale})`),r.push("scale(1)")),e.rotate!==void 0&&(n.push(`rotate(${e.rotate}deg)`),r.push("rotate(0deg)")),e.rotateX!==void 0&&(n.push(`rotateX(${e.rotateX}deg)`),r.push("rotateX(0deg)")),e.rotateY!==void 0&&(n.push(`rotateY(${e.rotateY}deg)`),r.push("rotateY(0deg)")),n.length>0&&(t.transform=[n.join(" "),r.join(" ")]),t}function mt(e){return typeof e=="string"?Array.from(document.querySelectorAll(e)):e instanceof NodeList?Array.from(e):e}function me(e){let t=e.trim().split(/\s+/),[n,r]=t.length>1?t:/%$/.test(t[0])?["top",t[0]]:[t[0],"bottom"];return [n,/%$/.test(r)?parseFloat(r):r==="top"?0:r==="center"?50:100]}function ze(e,t){let[n,r]=me(e);return `${n} ${+Math.max(0,r-t).toFixed(3)}%`}function ft(e){let t=NaN,n=0,r=0;return e.map(o=>{let s=o.getBoundingClientRect();return Math.abs(s.top-t)<=Math.max(8,Math.min(s.height,n||s.height)/2)?r++:(t=s.top,n=s.height,r=0),r})}var We={destroy:()=>{}};function Vt(e,t={}){if(typeof window>"u")return We;let n=mt(e);if(!n.length)return Z("scrollReveal: no elements found:",e),We;let{preset:r="fadeUp",from:o,stagger:s=.15,easing:u="ease-out",once:m=true,trigger:c,onEnter:l,onLeave:p}=t,g={...ct[r],...o},T=lt(g),P=c?.start||"top 88%",M=c?.end||"top 53%",O=Math.abs(me(P)[1]-me(M)[1]),k=Math.min(Math.max(s,0),1)*O,j=k>0?ft(n):n.map(()=>0),Y=n.map((S,$)=>{let A=Math.min(j[$]*k,O);return He(S,{props:T,easing:u,once:m,native:false,trigger:A>0?{start:ze(P,A),end:ze(M,A)}:{start:P,end:M},onEnter:$===0?l:void 0,onLeave:$===n.length-1?p:void 0})});return {destroy(){Y.forEach(S=>S.destroy());}}}exports.scrollReveal=Vt;
|
package/dist/reveal/index.d.mts
CHANGED
|
@@ -19,8 +19,11 @@ interface ScrollRevealFrom {
|
|
|
19
19
|
type ScrollRevealPreset = 'fadeUp' | 'fadeDown' | 'fadeLeft' | 'fadeRight' | 'scale' | 'flip' | 'flipX';
|
|
20
20
|
interface ScrollRevealOptions {
|
|
21
21
|
/**
|
|
22
|
-
* Named preset for the reveal animation. Default: `'fadeUp'
|
|
23
|
-
*
|
|
22
|
+
* Named preset for the reveal animation. Default: `'fadeUp'`, which also
|
|
23
|
+
* applies when only `from` is given. `from` is merged over the preset: its
|
|
24
|
+
* keys replace the preset's, and the preset's other keys stay, so
|
|
25
|
+
* `{ from: { scale: 0.95 } }` still fades up 32px. Set every key the preset
|
|
26
|
+
* has, or pick the preset you want, to leave one out.
|
|
24
27
|
*
|
|
25
28
|
* Presets:
|
|
26
29
|
* - `fadeUp` — opacity 0→1, y +32→0 (default)
|
|
@@ -32,7 +35,10 @@ interface ScrollRevealOptions {
|
|
|
32
35
|
* - `flipX` — opacity 0→1, rotateY 20→0
|
|
33
36
|
*/
|
|
34
37
|
preset?: ScrollRevealPreset;
|
|
35
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* Custom start state, merged over `preset` (see there). Keys: opacity, x, y,
|
|
40
|
+
* scale, rotate, rotateX, rotateY.
|
|
41
|
+
*/
|
|
36
42
|
from?: ScrollRevealFrom;
|
|
37
43
|
/**
|
|
38
44
|
* How far behind its neighbour each element in the same row starts, as a
|
package/dist/reveal/index.d.ts
CHANGED
|
@@ -19,8 +19,11 @@ interface ScrollRevealFrom {
|
|
|
19
19
|
type ScrollRevealPreset = 'fadeUp' | 'fadeDown' | 'fadeLeft' | 'fadeRight' | 'scale' | 'flip' | 'flipX';
|
|
20
20
|
interface ScrollRevealOptions {
|
|
21
21
|
/**
|
|
22
|
-
* Named preset for the reveal animation. Default: `'fadeUp'
|
|
23
|
-
*
|
|
22
|
+
* Named preset for the reveal animation. Default: `'fadeUp'`, which also
|
|
23
|
+
* applies when only `from` is given. `from` is merged over the preset: its
|
|
24
|
+
* keys replace the preset's, and the preset's other keys stay, so
|
|
25
|
+
* `{ from: { scale: 0.95 } }` still fades up 32px. Set every key the preset
|
|
26
|
+
* has, or pick the preset you want, to leave one out.
|
|
24
27
|
*
|
|
25
28
|
* Presets:
|
|
26
29
|
* - `fadeUp` — opacity 0→1, y +32→0 (default)
|
|
@@ -32,7 +35,10 @@ interface ScrollRevealOptions {
|
|
|
32
35
|
* - `flipX` — opacity 0→1, rotateY 20→0
|
|
33
36
|
*/
|
|
34
37
|
preset?: ScrollRevealPreset;
|
|
35
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* Custom start state, merged over `preset` (see there). Keys: opacity, x, y,
|
|
40
|
+
* scale, rotate, rotateX, rotateY.
|
|
41
|
+
*/
|
|
36
42
|
from?: ScrollRevealFrom;
|
|
37
43
|
/**
|
|
38
44
|
* How far behind its neighbour each element in the same row starts, as a
|
package/dist/reveal/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'../chunk-
|
|
1
|
+
import {a}from'../chunk-OPXWNJBG.mjs';import'../chunk-OJFWQ6CU.mjs';import'../chunk-UPWWULKI.mjs';import'../chunk-2PYLM3E7.mjs';import'../chunk-A4JCC3QQ.mjs';import'../chunk-DM6EDKWH.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import {b}from'../chunk-LFSU6LR3.mjs';var M={fadeUp:{opacity:0,y:32},fadeDown:{opacity:0,y:-32},fadeLeft:{opacity:0,x:32},fadeRight:{opacity:0,x:-32},scale:{opacity:0,scale:.88},flip:{opacity:0,rotateX:20},flipX:{opacity:0,rotateY:20}};function N(e){let r={};e.opacity!==void 0&&(r.opacity=[e.opacity,1]);let t=[],n=[];return e.x!==void 0&&(t.push(`translateX(${e.x}px)`),n.push("translateX(0px)")),e.y!==void 0&&(t.push(`translateY(${e.y}px)`),n.push("translateY(0px)")),e.scale!==void 0&&(t.push(`scale(${e.scale})`),n.push("scale(1)")),e.rotate!==void 0&&(t.push(`rotate(${e.rotate}deg)`),n.push("rotate(0deg)")),e.rotateX!==void 0&&(t.push(`rotateX(${e.rotateX}deg)`),n.push("rotateX(0deg)")),e.rotateY!==void 0&&(t.push(`rotateY(${e.rotateY}deg)`),n.push("rotateY(0deg)")),t.length>0&&(r.transform=[t.join(" "),n.join(" ")]),r}function P(e){return typeof e=="string"?Array.from(document.querySelectorAll(e)):e instanceof NodeList?Array.from(e):e}function u(e){let r=e.trim().split(/\s+/),[t,n]=r.length>1?r:/%$/.test(r[0])?["top",r[0]]:[r[0],"bottom"];return [t,/%$/.test(n)?parseFloat(n):n==="top"?0:n==="center"?50:100]}function y(e,r){let[t,n]=u(e);return `${t} ${+Math.max(0,n-r).toFixed(3)}%`}function Y(e){let r=NaN,t=0,n=0;return e.map(a=>{let o=a.getBoundingClientRect();return Math.abs(o.top-r)<=Math.max(8,Math.min(o.height,t||o.height)/2)?n++:(r=o.top,t=o.height,n=0),n})}var v={destroy:()=>{}};function A(e,r={}){if(typeof window>"u")return v;let t=P(e);if(!t.length)return b("scrollReveal: no elements found:",e),v;let{preset:n="fadeUp",from:a$1,stagger:o=.15,easing:b$1="ease-out",once:R=true,trigger:d,onEnter:x,onLeave:E}=r,S={...M[n],...a$1},X=N(S),s=d?.start||"top 88%",i=d?.end||"top 53%",f=Math.abs(u(s)[1]-u(i)[1]),g=Math.min(Math.max(o,0),1)*f,$=g>0?Y(t):t.map(()=>0),L=t.map((l,c)=>{let p=Math.min($[c]*g,f);return a(l,{props:X,easing:b$1,once:R,native:false,trigger:p>0?{start:y(s,p),end:y(i,p)}:{start:s,end:i},onEnter:c===0?x:void 0,onLeave:c===t.length-1?E:void 0})});return {destroy(){L.forEach(l=>l.destroy());}}}export{A as scrollReveal};
|
package/dist/snap/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function
|
|
1
|
+
'use strict';function K({bounces:e=3,decay:r=.5}={}){let n=Math.max(1,Math.round(e)),a=Math.max(.01,Math.min(.99,r)),p=Math.sqrt(a),u=0,y=[];for(let o=0;o<n;o++){let s=Math.pow(p,o);y.push(s),u+=s;}let m=[0],M=0;for(let o=0;o<n;o++)M+=y[o]/u,m.push(M);return o=>{if(o<=0)return 0;if(o>=1)return 1;for(let s=0;s<n;s++)if(o<=m[s+1]){let b=(o-m[s])/(m[s+1]-m[s]);if(s===0)return b*(2-b);let E=1-Math.pow(a,s);return E+(1-E)*(2*b-1)*(2*b-1)}return 1}}function X({amplitude:e=1,period:r=.4}={}){let n=Math.max(1,e),a=Math.max(.1,r),p=n<=1?a/4:a/(2*Math.PI)*Math.asin(1/n);return u=>u<=0?0:u>=1?1:n*Math.pow(2,-10*u)*Math.sin((u-p)*(2*Math.PI)/a)+1}var A={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:K(),elastic:X()};function x(e,r,n){return Math.min(n,Math.max(r,e))}var j=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function q(e,...r){j&&console.warn(`[svg-scroll-draw] ${e}`,...r);}function P(){return typeof window>"u"||typeof window.matchMedia!="function"?false:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function H(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let r=window.matchMedia("(prefers-reduced-motion: reduce)"),n=p=>e(!!p.matches);if(typeof r.addEventListener=="function")return r.addEventListener("change",n),()=>r.removeEventListener("change",n);let a=r;return a.addListener?.(n),()=>a.removeListener?.(n)}var W=Symbol.for("svg-scroll-draw.registry");function F(){let e=globalThis;return e[W]||(e[W]=new Map)}function G(e,r){F().set(e,r);}function z(e){F().delete(e);}var $={destroy:()=>{},snapTo:()=>{},getCurrentIndex:()=>0};function J(e){return typeof e=="string"?Array.from(document.querySelectorAll(e)):e instanceof NodeList?Array.from(e):e}function le(e,r={}){if(typeof window>"u")return $;let n=J(e);if(!n.length)return q("scrollSnap: no sections found"),$;let{direction:a="vertical",duration:p=600,easing:u="ease-in-out",threshold:y=.3,scrollContainer:m,onSnap:M,respectReducedMotion:o=true}=r,s=o&&P(),b=o?H(t=>{s=t;}):()=>{},E=typeof u=="function"?u:A[u]??A["ease-in-out"],h=a==="horizontal",_=h?"Width":"Height",C=h?"left":"top",f=typeof m=="string"?document.querySelector(m):m??null,R=false,v=0;function w(){return f?h?f.scrollLeft:f.scrollTop:h?window.scrollX:window.scrollY}function N(t){let i=f??window,c=h?{left:t}:{top:t};try{i.scrollTo({...c,behavior:"instant"});}catch{i.scrollTo(c);}}function S(){let t=f??document.scrollingElement??document.documentElement,i=t[`scroll${_}`]-t[`client${_}`],c=f?f.getBoundingClientRect()[C]+f[h?"clientLeft":"clientTop"]:0,d=w();return n.map(g=>x(g.getBoundingClientRect()[C]-c+d,0,i))}function B(){let t=w(),i=S();return i.reduce((c,d,g)=>Math.abs(d-t)<Math.abs(i[c]-t)?g:c,0)}let l=B();function T(t){R=false,l=t,M?.(t);}function L(t){let i=x(t,0,n.length-1);cancelAnimationFrame(v),R=true;let c=S(),d=w(),g=c[i];if(Math.abs(d-g)<1)return T(i);if(s)return N(g),T(i);let k=performance.now();function Q(Y){let V=x((Y-k)/p,0,1);N(d+(g-d)*E(V)),V<1?v=requestAnimationFrame(Q):T(i);}v=requestAnimationFrame(Q);}let I;function O(){R||(clearTimeout(I),I=setTimeout(()=>{let t=w(),i=S();if(Math.abs(t-i[l])<1)return;let c=n[l][`offset${_}`],d=t-i[l];d>c*y&&l<n.length-1?L(l+1):d<-(c*y)&&l>0?L(l-1):L(l);},100));}let D=f??window;return D.addEventListener("scroll",O,{passive:true}),G(n[0],{type:"snap",getProgress:()=>l/(n.length-1||1),getTrigger:()=>{let t=S();return {tStart:t[0],tEnd:t[t.length-1]}}}),{destroy(){cancelAnimationFrame(v),clearTimeout(I),D.removeEventListener("scroll",O),b(),z(n[0]);},snapTo:L,getCurrentIndex(){return l}}}exports.scrollSnap=le;
|
package/dist/snap/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'../chunk-AJ22VSHC.mjs';import {d}from'../chunk-DM6EDKWH.mjs';import {a as a$1}from'../chunk-5PJEKEEP.mjs';import {a as a$3}from'../chunk-4DOJSIEQ.mjs';import {a as a$2,b as b$1}from'../chunk-BCV4RAIX.mjs';import {b}from'../chunk-LFSU6LR3.mjs';var
|
|
1
|
+
import {a}from'../chunk-AJ22VSHC.mjs';import {d}from'../chunk-DM6EDKWH.mjs';import {a as a$1}from'../chunk-5PJEKEEP.mjs';import {a as a$3}from'../chunk-4DOJSIEQ.mjs';import {a as a$2,b as b$1}from'../chunk-BCV4RAIX.mjs';import {b}from'../chunk-LFSU6LR3.mjs';var z={destroy:()=>{},snapTo:()=>{},getCurrentIndex:()=>0};function k(c){return typeof c=="string"?Array.from(document.querySelectorAll(c)):c instanceof NodeList?Array.from(c):c}function Z(c,$={}){if(typeof window>"u")return z;let i=k(c);if(!i.length)return b("scrollSnap: no sections found"),z;let{direction:B="vertical",duration:P=600,easing:g="ease-in-out",threshold:v=.3,scrollContainer:S,onSnap:_,respectReducedMotion:w=true}=$,M=w&&a(),G=w?a$1(e=>{M=e;}):()=>{},W=typeof g=="function"?g:d[g]??d["ease-in-out"],a$4=B==="horizontal",b$2=a$4?"Width":"Height",x=a$4?"left":"top",s=typeof S=="string"?document.querySelector(S):S??null,h=false,u=0;function m(){return s?a$4?s.scrollLeft:s.scrollTop:a$4?window.scrollX:window.scrollY}function L(e){let t=s??window,n=a$4?{left:e}:{top:e};try{t.scrollTo({...n,behavior:"instant"});}catch{t.scrollTo(n);}}function d$1(){let e=s??document.scrollingElement??document.documentElement,t=e[`scroll${b$2}`]-e[`client${b$2}`],n=s?s.getBoundingClientRect()[x]+s[a$4?"clientLeft":"clientTop"]:0,r=m();return i.map(l=>a$3(l.getBoundingClientRect()[x]-n+r,0,t))}function X(){let e=m(),t=d$1();return t.reduce((n,r,l)=>Math.abs(r-e)<Math.abs(t[n]-e)?l:n,0)}let o=X();function T(e){h=false,o=e,_?.(e);}function f(e){let t=a$3(e,0,i.length-1);cancelAnimationFrame(u),h=true;let n=d$1(),r=m(),l=n[t];if(Math.abs(r-l)<1)return T(t);if(M)return L(l),T(t);let Y=performance.now();function R(j){let C=a$3((j-Y)/P,0,1);L(r+(l-r)*W(C)),C<1?u=requestAnimationFrame(R):T(t);}u=requestAnimationFrame(R);}let E;function I(){h||(clearTimeout(E),E=setTimeout(()=>{let e=m(),t=d$1();if(Math.abs(e-t[o])<1)return;let n=i[o][`offset${b$2}`],r=e-t[o];r>n*v&&o<i.length-1?f(o+1):r<-(n*v)&&o>0?f(o-1):f(o);},100));}let A=s??window;return A.addEventListener("scroll",I,{passive:true}),a$2(i[0],{type:"snap",getProgress:()=>o/(i.length-1||1),getTrigger:()=>{let e=d$1();return {tStart:e[0],tEnd:e[e.length-1]}}}),{destroy(){cancelAnimationFrame(u),clearTimeout(E),A.removeEventListener("scroll",I),G(),b$1(i[0]);},snapTo:f,getCurrentIndex(){return o}}}export{Z as scrollSnap};
|
package/dist/solid/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
'use strict';var solidJs=require('solid-js');function
|
|
2
|
-
<div style="position:absolute;${
|
|
3
|
-
<div style="position:absolute;${f?`left:${m}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${m}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(n),window.addEventListener("scroll",s,{passive:true}),s(),{el:n,destroy(){window.removeEventListener("scroll",s),n.remove();}}}var qt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Bt=/[MmLlHhVvCcSsQqTtAaZz]/g;function Sn(e,r,t){if(!Ke)return;let n=(e.match(Bt)??[]).join("").toUpperCase(),s=(r.match(Bt)??[]).join("").toUpperCase(),i=(e.match(qt)??[]).length,a=(r.match(qt)??[]).length;if(n!==s){he(`morphTo: command sequence differs (${n||"\u2205"} \u2192 ${s||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,t);return}i!==a&&he(`morphTo: coordinate count differs (${i} \u2192 ${a}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,t);}function yt(e,r,t){let n=(r.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),s=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,i=>{let a=parseFloat(i),m=n[s++]??a;return String(+(a+(m-a)*t).toFixed(4))})}function ht(e,r={}){return typeof window>"u"?{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0}:Be(r,(t,n)=>Tn(e,t,n))}function Tn(e,r,t){let{preset:n,...s}=r,i=n?{...Rt[n],...s}:s,{selector:a="path, polyline, line, polygon, rect, circle",speed:m=1,fade:f=false,easing:d="linear",trigger:x={},stagger:R=0,direction:C="forward",once:Q=false,debug:me=false,axis:I="y",scrollContainer:se,autoReverse:be=false,delay:D=0,strokeColor:H,strokeWidth:k,fillOpacity:M,waypoints:w,velocityScale:v=false,threshold:T=0,rootMargin:U="0px",repeat:N=0,repeatDelay:B=0,morphTo:L,clip:fe,autoplay:Ee=false,duration:ie=1e3,native:z=true,onProgress:u,onStart:A,onComplete:h,onEnter:O,onLeave:te,onEnterBack:pe,onLeaveBack:Se}=i,Z=fe===true?"left":typeof fe=="string"?fe:false,E=typeof d=="function"?d:oe[d]??oe.linear,de=ye(x.start??"top bottom"),Ae=ye(x.end??"bottom top"),ae=typeof se=="string"?document.querySelector(se):se??null,le=Array.isArray(H)?H[0]:null,ne=Array.isArray(H)?H[1]:typeof H=="string"?H:null,re=Array.isArray(k)?k[0]:null,Y=Array.isArray(k)?k[1]:typeof k=="number"?k:null,ge=Array.isArray(M)?M[0]:null,J=Array.isArray(M)?M[1]:typeof M=="number"?M:null;function Oe(o){let c=o*100;switch(Z){case "right":return `inset(0 0 0 ${100-c}%)`;case "top":return `inset(0 0 ${100-c}% 0)`;case "bottom":return `inset(${100-c}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-c}% 0 0)`}}let _=Z?[]:Array.from(e.querySelectorAll(a)),P=[],we=[],l=0,p=0,$e=R,Te=0,$=false,V=false,G=0,Ve=false,q=-1,He=[],ze=-1,ce=false,Ie=0,Ne=0,_e,ut=null;function Tt(){ut?.destroy(),ut=null;}let We=new Set,xt=NaN,qe=true,et=-1,Mt=performance.now(),Ge=NaN;function Ye(){return ae?I==="x"?ae.scrollLeft:ae.scrollTop:I==="x"?window.scrollX:window.scrollY}function Lt(){return ae?I==="x"?ae.clientWidth:ae.clientHeight:I==="x"?window.innerWidth:window.innerHeight}function At(){let o=st(e,ae,I);return Le(o,o.scroll,Lt(),de,Ae)}function on(){let o=p-l,c=_.length-1,y=ae??document.documentElement,X=I==="x"?"Width":"Height";if($e=R,R>0&&c>0&&o>0){let xe=y[`scroll${X}`]-y[`client${X}`]-1-l-o/m;xe>=0&&($e=Math.min(R,xe/(c*o)));}Te=p+c*$e*o;}function $t(){(({tStart:l,tEnd:p}=At())),on(),me&&Ke&&(Tt(),ut=En(l,p,I));}function mt(o,c=At){Pe(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:c});let y=o.destroy;return o.destroy=()=>{y.call(o),ke(e);},o}function sn(o,c){if(e.style.setProperty("--scroll-draw-progress",String(o)),Z){let y=c==="reverse"?1-o:o;e.style.clipPath=Oe(y);return}_.forEach((y,X)=>{y.style.strokeDashoffset=c==="reverse"?`${P[X]*o}`:`${P[X]*(1-o)}`,f&&(y.style.opacity=c==="reverse"?`${1-o}`:`${o}`),le&&ne?y.style.stroke=Ue(le,ne,o):ne&&(y.style.stroke=ne),re!==null&&Y!==null?y.style.strokeWidth=`${re+(Y-re)*o}`:Y!==null&&(y.style.strokeWidth=`${Y}`),ge!==null&&J!==null?y.style.fillOpacity=`${ge+(J-ge)*o}`:J!==null&&(y.style.fillOpacity=`${J}`),L&&y.tagName.toLowerCase()==="path"&&we[X]&&y.setAttribute("d",yt(we[X],L,o));});}function tt(){if(e.style.setProperty("--scroll-draw-progress","0"),Z){e.style.clipPath=Oe(0);return}_.forEach((o,c)=>{o.style.strokeDasharray=`${P[c]}`,o.style.strokeDashoffset=C==="reverse"?"0":`${P[c]}`,f?o.style.opacity=C==="reverse"?"1":"0":o.style.opacity="",le&&(o.style.stroke=le),re!==null&&(o.style.strokeWidth=`${re}`),ge!==null&&(o.style.fillOpacity=`${ge}`),L&&o.tagName.toLowerCase()==="path"&&we[c]&&o.setAttribute("d",we[c]);});}if(_.forEach(o=>{vn(o);let c=Qe(o);P.push(c);let y=o.tagName.toLowerCase()==="path";y?we.push(o.getAttribute("d")??""):we.push(""),L&&(y?Sn(we[we.length-1],L,o):he(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),t?(o.style.strokeDasharray=`${c}`,o.style.strokeDashoffset=C==="reverse"?`${c}`:"0",f&&(o.style.opacity="1"),ne&&(o.style.stroke=ne),Y!==null&&(o.style.strokeWidth=`${Y}`),J!==null&&(o.style.fillOpacity=`${J}`),L&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",L)):(o.style.strokeDasharray=`${c}`,o.style.strokeDashoffset=C==="reverse"?"0":`${c}`,f?o.style.opacity=C==="reverse"?"1":"0":o.style.opacity="",le&&(o.style.stroke=le),re!==null&&(o.style.strokeWidth=`${re}`),ge!==null&&(o.style.fillOpacity=`${ge}`));}),Z){if(t)return e.style.clipPath=Oe(1),h?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Oe(0);}else if(t)return h?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let Ct=typeof d=="string"?it(d):null;function an(){return !(z===false||!wn()||!_.length||!Ct||Z||I!=="y"||ae||m!==1||R!==0||Q||be||v!==false||L||w||N||D>0||u||A||h||O||te||pe||Se||H!=null||k!=null||M!=null||(x.start??"top bottom").trim()!=="top bottom"||(x.end??"bottom top").trim()!=="bottom top")}function ln(){let o=++bn,c=`svg-scroll-draw-${o}`,y=`svg-scroll-draw-host-${o}`,X=`--svg-scroll-draw-${o}`,xe=C==="reverse"?"0":"var(--ssd-len)",De=C==="reverse"?"var(--ssd-len)":"0",Ce=`stroke-dashoffset:${xe};`,S=`stroke-dashoffset:${De};`;f&&(Ce+=`opacity:${C==="reverse"?1:0};`,S+=`opacity:${C==="reverse"?0:1};`);let F=document.createElement("style");F.setAttribute("data-svg-scroll-draw",""),F.textContent=`@keyframes ${c}{from{${Ce}}to{${S}}}.${y}{view-timeline-name:${X};view-timeline-axis:block;}.${c}{animation-name:${c};animation-duration:auto;animation-timing-function:${Ct};animation-fill-mode:both;animation-timeline:${X};animation-range:cover 0% cover 100%;}`,document.head.appendChild(F),e.classList.add(y);function ue(g,K){g.style.setProperty("--ssd-len",String(P[K])),g.style.strokeDasharray=`${P[K]}`,g.style.strokeDashoffset="",g.style.opacity="",g.style.animationPlayState="",g.classList.add(c);}_.forEach(ue);let b=false,W=-1;function j(){if(W>=0)return W;let g=e.getBoundingClientRect(),{tStart:K,tEnd:Me}=Le({top:g.top,height:g.height},Ye(),Lt(),de,Ae);return E(ee(Ye(),K,Me,m))}return {destroy(){e.classList.remove(y),_.forEach(g=>{g.classList.remove(c),g.style.removeProperty("--ssd-len"),g.style.animationPlayState="";}),F.remove();},replay(){b=false,W=-1,_.forEach(ue);},pause(){b=true,_.forEach(g=>{g.style.animationPlayState="paused";});},resume(){b&&(b=false,_.forEach(g=>{g.style.animationPlayState="running";}));},seek(g){let K=Math.min(1,Math.max(0,g));W=K,b=true,_.forEach((Me,ve)=>{Me.classList.remove(c),Me.style.strokeDashoffset=C==="reverse"?`${P[ve]*K}`:`${P[ve]*(1-K)}`,f&&(Me.style.opacity=C==="reverse"?`${1-K}`:`${K}`);});},getProgress(){return j()},refresh(){_.forEach((g,K)=>{P[K]=Qe(g),g.style.setProperty("--ssd-len",String(P[K])),g.style.strokeDasharray=`${P[K]}`;});}}}if(an())return mt(ln());function cn(){let o=Math.max(1,ie),c=0,y=0,X=false;function xe(b){let W=true;if(Z){let j=Math.min(1,Math.max(0,b/o)),g=E(j);Ie=g,e.style.setProperty("--scroll-draw-progress",String(g)),e.style.clipPath=Oe(C==="reverse"?1-g:g),u?.(g),j<1&&(W=false);}else _.forEach((j,g)=>{let K=g*R*o,Me=Math.min(1,Math.max(0,(b-K)/o)),ve=E(Me);j.style.strokeDashoffset=C==="reverse"?`${P[g]*ve}`:`${P[g]*(1-ve)}`,f&&(j.style.opacity=C==="reverse"?`${1-ve}`:`${ve}`),le&&ne?j.style.stroke=Ue(le,ne,ve):ne&&(j.style.stroke=ne),re!==null&&Y!==null?j.style.strokeWidth=`${re+(Y-re)*ve}`:Y!==null&&(j.style.strokeWidth=`${Y}`),ge!==null&&J!==null?j.style.fillOpacity=`${ge+(J-ge)*ve}`:J!==null&&(j.style.fillOpacity=`${J}`),L&&j.tagName.toLowerCase()==="path"&&we[g]&&j.setAttribute("d",yt(we[g],L,ve)),g===0&&(Ie=ve,u?.(ve),e.style.setProperty("--scroll-draw-progress",String(ve))),Me<1&&(W=false);});if(w){let j=Math.min(1,Math.max(0,b/o)),g=E(j);for(let K in w){let Me=parseFloat(K);g>=Me&&!We.has(Me)&&(We.add(Me),w[K]?.());}}return W}function De(b){if(ce)return;let W=b-c;V||(V=true,A?.());let j=xe(W);if(j&&!$){$=true,xe(o*(1+Math.max(0,_.length-1)*R)),h?.(),Ne<(N==="infinite"?1/0:N??0)&&(Ne++,_e=setTimeout(()=>{c=performance.now(),V=false,$=false,We.clear(),tt(),G=requestAnimationFrame(De);},B));return}j||(G=requestAnimationFrame(De));}function Ce(){cancelAnimationFrame(G),clearTimeout(_e),c=performance.now(),y=0,ce=false,V=false,$=false,Ne=0,X=true,Ie=0,We.clear(),tt(),G=requestAnimationFrame(De);}let S=new IntersectionObserver(b=>{b.forEach(W=>{W.isIntersecting&&!(Q&&$)?Ce():!W.isIntersecting&&!Q&&!$&&(cancelAnimationFrame(G),clearTimeout(_e),X=false);});},{root:ae??null,threshold:T,rootMargin:U}),F;function ue(){clearTimeout(F),F=setTimeout(()=>{_.forEach((b,W)=>{P[W]=Qe(b),b.style.strokeDasharray=`${P[W]}`;});},150);}return window.addEventListener("resize",ue),window.addEventListener("orientationchange",ue),D>0?setTimeout(()=>S.observe(e),D):S.observe(e),{destroy(){cancelAnimationFrame(G),clearTimeout(_e),S.disconnect(),window.removeEventListener("resize",ue),window.removeEventListener("orientationchange",ue),clearTimeout(F);},replay(){Ne=0,Ce();},pause(){ce||!X||(ce=true,y=performance.now()-c,cancelAnimationFrame(G));},resume(){ce&&(ce=false,X=true,c=performance.now()-y,G=requestAnimationFrame(De));},seek(b){let W=Math.min(1,Math.max(0,b));Ie=W,ce=true,y=W*o,c=performance.now()-y,cancelAnimationFrame(G),xe(y);},getProgress(){return Ie},refresh(){clearTimeout(F),_.forEach((b,W)=>{P[W]=Qe(b),b.style.strokeDasharray=`${P[W]}`;});}}}if(Ee)return mt(cn());$t();function Pt(){if(ce||!je)return;let o=performance.now(),c=Ye();if(!qe&&v===false&&c===xt){pt(c);return}qe=false,xt=c;let y=m;if(v!==false){let S=o-Mt,F=S>0?Math.abs(c-(et<0?c:et))/S:0;y=m*Math.max(.2,1+F*(typeof v=="number"?v:1)*.04);}et=c,Mt=o;let X=be?ze===-1||c>=ze?"forward":"reverse":C;ze=c;let xe=p-l,De=true,Ce=xe===0?0:(c-l)/xe;if(isNaN(Ge)||(Ge<=0&&Ce>0?O?.():Ge>0&&Ce<=0&&Se?.(),Ge<1&&Ce>=1?te?.():Ge>=1&&Ce<1&&pe?.()),Ge=Ce,Z){let S=E(ee(c,l,p,y));Q&&!be&&(q=Math.max(q,S),S=q),Ie=S,e.style.setProperty("--scroll-draw-progress",String(S));let F=X==="reverse"?1-S:S;e.style.clipPath=Oe(F),u?.(S),!V&&ee(c,l,p,y)>0&&(V=true,A?.()),S>=1&&!$?($=true,h?.(),Ne<(N==="infinite"?1/0:N??0)&&(Ne++,_e=setTimeout(()=>{q=-1,V=false,$=false,e.style.clipPath=Oe(0);},B))):S<1&&!Q&&($=false),pt(c);return}if(_.forEach((S,F)=>{let ue=F*$e*xe,b=E(ee(c,l+ue,p+ue,y));Q&&!be&&(b=He[F]=Math.max(He[F]??q,b)),S.style.strokeDashoffset=X==="reverse"?`${P[F]*b}`:`${P[F]*(1-b)}`,f&&(S.style.opacity=X==="reverse"?`${1-b}`:`${b}`),le&&ne?S.style.stroke=Ue(le,ne,b):ne&&(S.style.stroke=ne),re!==null&&Y!==null?S.style.strokeWidth=`${re+(Y-re)*b}`:Y!==null&&(S.style.strokeWidth=`${Y}`),ge!==null&&J!==null?S.style.fillOpacity=`${ge+(J-ge)*b}`:J!==null&&(S.style.fillOpacity=`${J}`),L&&S.tagName.toLowerCase()==="path"&&we[F]&&S.setAttribute("d",yt(we[F],L,b)),F===0&&(Ie=b,u?.(b),e.style.setProperty("--scroll-draw-progress",String(b))),b<1&&(De=false);}),w){let S=E(ee(c,l,p,y));for(let F in w){let ue=parseFloat(F);S>=ue&&!We.has(ue)&&(We.add(ue),w[F]?.());}}!V&&ee(c,l,p,y)>0&&(V=true,A?.()),De&&!$?($=true,h?.(),Ne<(N==="infinite"?1/0:N??0)&&(Ne++,_e=setTimeout(()=>{q=-1,He=[],V=false,$=false,We.clear(),tt(),qe=true;},B))):!De&&!Q&&($=false),pt(c);}function ft(o){return o>=p&&o<Te}function pt(o){Ve||ft(o)?G=requestAnimationFrame(Pt):je=false;}function dt(){return Ve||ft(Ye())}let je=false;function nt(){je||(je=true,G=requestAnimationFrame(function(){Pt();}));}function rt(){je=false,cancelAnimationFrame(G);}let gt=new IntersectionObserver(o=>{o.forEach(c=>{Ve=c.isIntersecting,Ve&&!ce?(qe=true,nt()):je&&!ce&&ft(Ye())||rt();});},{root:ae??null,threshold:T,rootMargin:U});function kt(){_.forEach((o,c)=>{P[c]=Qe(o),o.style.strokeDasharray=`${P[c]}`;}),$t(),qe=true;}let ot;function Xe(){clearTimeout(ot),ot=setTimeout(kt,150);}window.addEventListener("resize",Xe),window.addEventListener("orientationchange",Xe);let un=Fe([e],Xe);return D>0?setTimeout(()=>gt.observe(e),D):gt.observe(e),mt({destroy(){cancelAnimationFrame(G),clearTimeout(_e),rt(),gt.disconnect(),un(),window.removeEventListener("resize",Xe),window.removeEventListener("orientationchange",Xe),clearTimeout(ot),Tt();},replay(){q=-1,He=[],ze=-1,et=-1,V=false,$=false,Ne=0,ce=false,Ie=0,We.clear(),clearTimeout(_e),tt(),qe=true,dt()&&nt();},pause(){ce=true,rt();},resume(){ce&&(ce=false,qe=true,dt()&&nt());},seek(o){let c=Math.min(1,Math.max(0,o));Ie=c,q=c,He=[],ce=true,rt(),sn(c,C),qe=true;},getProgress(){return Ie},refresh(){clearTimeout(ot),kt(),dt()&&!ce&&nt();}},()=>({tStart:l,tEnd:p}))}var Gt=new WeakMap,xn=0;function jt(e){return JSON.stringify(e,(r,t)=>{if(typeof t=="function")return "\u0192";if(typeof Element<"u"&&t instanceof Element){let n=Gt.get(t);return n===void 0&&Gt.set(t,n=++xn),`el#${n}`}return t})}function Qt(e,r){let t={...e};for(let n of Object.keys(t))typeof t[n]=="function"&&(t[n]=(...s)=>r()[n]?.(...s));return t}function Mn(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Ut(e){let r=[],t=/([\w]+)\(([^)]*)\)/g,n;for(;(n=t.exec(e))!==null;){let s=[],i=[],a=n[2].trim();if(a)for(let m of a.split(/[\s,]+/)){let f=m.match(/^([-+]?[\d.eE]+)(.*)$/);s.push(f?parseFloat(f[1]):0),i.push(f?f[2]:"");}r.push({fn:n[1],nums:s,units:i});}return r}function Ln(e,r,t){let n=Ut(e),s=Ut(r);return n.length===0||n.length!==s.length?t<1?e:r:n.map((i,a)=>{let m=s[a];return i.fn!==m.fn||i.nums.length!==m.nums.length?t<1?`${i.fn}(${i.nums.map((f,d)=>`${f}${i.units[d]}`).join(", ")})`:`${m.fn}(${m.nums.map((f,d)=>`${f}${m.units[d]}`).join(", ")})`:`${i.fn}(${i.nums.map((f,d)=>`${f+(m.nums[d]-f)*t}${i.units[d]}`).join(", ")})`}).join(" ")}function Yt(e,r,t){if(typeof e=="number"&&typeof r=="number")return String(e+(r-e)*t);let n=String(e),s=String(r);if(Mn(n))return Ue(n,s,t);if(n.includes("("))return Ln(n,s,t);let i=n.match(/^([-+]?[\d.]+)(.*)$/),a=s.match(/^([-+]?[\d.]+)(.*)$/);if(i&&a){let m=parseFloat(i[1]),f=parseFloat(a[1]);return `${m+(f-m)*t}${i[2]||a[2]}`}return t<1?n:s}function An(e){return e.replace(/([A-Z])/g,r=>`-${r.toLowerCase()}`)}var $n=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Cn=0,Xt="--scroll-draw-progress";function Pn(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var Zt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function bt(e,r){return typeof window>"u"?Zt:r.respectReducedMotion===false?Kt(e,r,false):Be(r,(t,n)=>Kt(e,t,n))}function Kt(e,r,t){let{props:n,trigger:s={},easing:i="ease-out",speed:a=1,once:m=false,axis:f="y",scrollContainer:d,native:x=true,velocityScale:R=false,triggerElement:C,onProgress:Q,onComplete:me,onEnter:I,onLeave:se,onEnterBack:be,onLeaveBack:D}=r,H=typeof i=="function"?i:oe[i]??oe["ease-out"],k=ye(s.start??"top bottom"),M=ye(s.end??"bottom top"),w=C??e,v=typeof d=="string"?document.querySelector(d):d??null,T=Object.entries(n).map(([l,p])=>({prop:An(l),from:Array.isArray(p)?p[0]:"",to:Array.isArray(p)?p[1]:p}));function U(){let l=window.getComputedStyle(e);for(let p of T)p.from===""&&(p.from=l.getPropertyValue(p.prop).trim()||"0");}function N(){for(let l of T)e.style.setProperty(l.prop,String(l.to));}let B=new Map;for(let l of [...T.map(p=>p.prop),Xt])B.set(l,e.style.getPropertyValue(l));function L(){for(let[l,p]of B)p?e.style.setProperty(l,p):e.style.removeProperty(l);}if(t)return N(),me?.(),{...Zt,destroy:L,getProgress:()=>1};U();let fe=typeof i=="string"?it(i):null;function Ee(){if(!x||!Pn()||!fe||f!=="y"||v||w!==e||m||a!==1||Q||me||I||se||be||D||R!==false||(s.start??"top bottom").trim()!=="top bottom"||(s.end??"bottom top").trim()!=="bottom top")return false;for(let l of T)if(!$n.has(l.prop))return false;return true}function ie(){let l=`ssd-a-${++Cn}`,p=T.map(q=>`${q.prop}:${q.from}`).join(";"),$e=T.map(q=>`${q.prop}:${q.to}`).join(";"),Te=document.createElement("style");Te.setAttribute("data-ssd-animate",""),Te.textContent=`@keyframes ${l}{from{${p}}to{${$e}}}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${fe};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(Te),e.classList.add(l);let $=()=>f==="x"?window.scrollX:window.scrollY,V=()=>f==="x"?window.innerWidth:window.innerHeight,G=()=>{let q=e.getBoundingClientRect();return Le({top:q.top,height:q.height},$(),V(),k,M)};Pe(e,{type:"animate",getProgress:()=>Ve.getProgress(),getTrigger:G});let Ve={refresh(){},destroy(){e.classList.remove(l),Te.remove(),e.style.animationPlayState="",L(),ke(e);},replay(){e.classList.remove(l),e.offsetWidth,e.classList.add(l);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(q){let He=Math.min(1,Math.max(0,q));e.classList.remove(l);for(let ze of T)e.style.setProperty(ze.prop,Yt(ze.from,ze.to,He));},getProgress(){let{tStart:q,tEnd:He}=G();return H(ee($(),q,He,a))}};return Ve}if(Ee())return ie();let z=0,u=0,A=0,h=false,O=false,te=-1,pe=0,Se=false,Z=NaN,E=-1,de=0,Ae=()=>v?f==="x"?v.scrollLeft:v.scrollTop:f==="x"?window.scrollX:window.scrollY,ae=()=>v?f==="x"?v.clientWidth:v.clientHeight:f==="x"?window.innerWidth:window.innerHeight,le=w===e?T:[],ne=false;function re(){let l=e.style,p=le.map(V=>l.getPropertyValue(V.prop)),$e=l.transition;le.length&&(l.transition="none"),le.forEach(V=>l.setProperty(V.prop,B.get(V.prop)??""));let Te=st(w,v,f);le.forEach((V,G)=>l.setProperty(V.prop,p[G])),le.length&&(e.offsetWidth,l.transition=$e);let $=Le(Te,Te.scroll,ae(),k,M);ne&&Math.abs($.tStart-z)<1&&Math.abs($.tEnd-u)<1||(ne=true,z=$.tStart,u=$.tEnd);}function Y(l){e.style.setProperty(Xt,String(l));for(let p of T)e.style.setProperty(p.prop,Yt(p.from,p.to,l));Q?.(l);}function ge(l){if(isNaN(Z)){Z=l;return}Z<=0&&l>0?I?.():Z>0&&l<=0&&D?.(),Z<1&&l>=1?se?.():Z>=1&&l<1&&be?.(),Z=l;}function J(){if(!h||O)return;let l=performance.now(),p=Ae(),$e=a;if(R!==false){let V=l-de,G=V>0?Math.abs(p-(E<0?p:E))/V:0;$e=a*Math.max(.2,1+G*(typeof R=="number"?R:1)*.04);}E=p,de=l;let Te=u===z?0:(p-z)/(u-z);ge(Te);let $=H(ee(p,z,u,$e));m&&(te=Math.max(te,$),$=te),pe=$,Y($),$>=1&&!Se?(Se=true,me?.()):$<1&&!m&&(Se=false),A=requestAnimationFrame(J);}re(),u===z&&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 l=H(ee(Ae(),z,u,a));m&&l>0&&(te=l),pe=l,Y(l);}let Oe=new IntersectionObserver(l=>{l.forEach(p=>{h=p.isIntersecting,h&&!O?A=requestAnimationFrame(J):cancelAnimationFrame(A);});},{root:v??null}),_;function P(){clearTimeout(_),_=setTimeout(re,150);}window.addEventListener("resize",P),window.addEventListener("orientationchange",P);let we=Fe([w],P);return Oe.observe(e),Pe(e,{type:"animate",getProgress:()=>pe,getTrigger:()=>({tStart:z,tEnd:u})}),{destroy(){cancelAnimationFrame(A),Oe.disconnect(),window.removeEventListener("resize",P),window.removeEventListener("orientationchange",P),we(),clearTimeout(_),L(),ke(e);},replay(){te=-1,Se=false,pe=0,O=false,Y(0);},pause(){O=true,cancelAnimationFrame(A);},resume(){O&&(O=false,h&&(A=requestAnimationFrame(J)));},seek(l){let p=Math.min(1,Math.max(0,l));pe=p,te=p,O=true,cancelAnimationFrame(A),Y(p);},getProgress(){return pe},refresh(){re();}}}var wt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function vt(e,r){if(typeof window>"u")return wt;let t=typeof e=="string"?document.querySelector(e):e;return t?Be(r,(n,s)=>kn(t,n,s)):(he("scrollCounter: element not found:",e),wt)}function kn(e,r,t){let{from:n=0,to:s,format:i,easing:a="ease-out",trigger:m={},once:f=true,decimals:d,onComplete:x}=r,R=d!==void 0?u=>u.toFixed(d):i??(u=>String(Math.round(u))),C=typeof a=="function"?a:oe[a]??oe["ease-out"],Q=ye(m.start??"top 80%"),me=ye(m.end??"top 20%");if(t)return e.textContent=R(s),x?.(),{...wt,getProgress:()=>1};let I=0,se=0,be=false,D=0,H=false,k=false,M=-1,w=0,v=false,T=()=>window.scrollY,U=()=>window.innerHeight;function N(){let u=e.getBoundingClientRect(),A=Le({top:u.top,height:u.height},T(),U(),Q,me);be&&Math.abs(A.tStart-I)<1&&Math.abs(A.tEnd-se)<1||(be=true,I=A.tStart,se=A.tEnd);}function B(u){e.textContent=R(n+(s-n)*u),e.style.setProperty("--scroll-draw-progress",String(u));}function L(){if(!H||k)return;let u=C(ee(T(),I,se,1));f&&(M=Math.max(M,u),u=M),w=u,B(u),u>=1&&!v?(v=true,x?.()):u<1&&!f&&(v=false),D=requestAnimationFrame(L);}N();{let u=C(ee(T(),I,se,1));f&&u>0&&(M=u),w=u,B(u);}let fe=new IntersectionObserver(u=>{u.forEach(A=>{H=A.isIntersecting,H&&!k?D=requestAnimationFrame(L):cancelAnimationFrame(D);});}),Ee;function ie(){clearTimeout(Ee),Ee=setTimeout(N,150);}window.addEventListener("resize",ie),window.addEventListener("orientationchange",ie);let z=Fe([e],ie);return fe.observe(e),Pe(e,{type:"counter",getProgress:()=>w,getTrigger:()=>({tStart:I,tEnd:se})}),{destroy(){cancelAnimationFrame(D),fe.disconnect(),window.removeEventListener("resize",ie),window.removeEventListener("orientationchange",ie),z(),clearTimeout(Ee),ke(e);},replay(){M=-1,v=false,w=0,k=false,B(0);},pause(){k=true,cancelAnimationFrame(D);},resume(){k&&(k=false,H&&(D=requestAnimationFrame(L)));},seek(u){let A=Math.min(1,Math.max(0,u));w=A,M=A,k=true,cancelAnimationFrame(D),B(A);},getProgress(){return w}}}var Jt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Et(e,r={}){if(typeof window>"u")return Jt;let t=typeof e=="string"?document.querySelector(e):e;if(!t||t.tagName.toLowerCase()!=="video")return he("scrollVideo: <video> element not found:",e),Jt;let n=t,{trigger:s={},easing:i="linear",once:a=false,axis:m="y",preload:f="auto",triggerElement:d,onReady:x,onComplete:R,onProgress:C}=r,Q=d??n,me=window.matchMedia("(prefers-reduced-motion: reduce)").matches,I=typeof i=="function"?i:oe[i]??oe.linear,se=ye(s.start??"top top"),be=ye(s.end??"bottom top");n.pause(),n.hasAttribute("preload")||(n.preload=f);let D=r.from??0,H=r.to,k=0,M=0,w=0,v=false,T=false,U=-1,N=0,B=false,L=false,fe=()=>m==="x"?window.scrollX:window.scrollY,Ee=()=>m==="x"?window.innerWidth:window.innerHeight;function ie(){let E=Q.getBoundingClientRect(),de=m==="x"?E.left:E.top,Ae=m==="x"?E.width:E.height,ae=Le({top:de,height:Ae},fe(),Ee(),se,be);k=ae.tStart,M=ae.tEnd,L&&M===k&&he("scrollVideo: zero-length trigger window, so it never scrubs. In a sticky stage, set triggerElement.",n);}let z=NaN;function u(E){if(!L)return;let de=H??n.duration??0,Ae=D+(de-D)*E;Ae!==z&&(z=Ae,n.currentTime=Ae),n.style.setProperty("--scroll-draw-progress",String(E)),C?.(E);}function A(){if(!v||T||!L||me)return;let E=I(ee(fe(),k,M,1));a&&(U=Math.max(U,E),E=U),N=E,u(E),E>=1&&!B?(B=true,R?.()):E<1&&!a&&(B=false),w=requestAnimationFrame(A);}function h(){if(L=true,H===void 0&&(H=n.duration),me){u(1),x?.();return}ie(),x?.(),v&&!T&&(w=requestAnimationFrame(A));}n.readyState>=1?h():n.addEventListener("loadedmetadata",h,{once:true}),L||ie();let O=me?()=>{}:ct(E=>{E&&(O(),me=true,cancelAnimationFrame(w),u(1));}),te=new IntersectionObserver(E=>{E.forEach(de=>{v=de.isIntersecting,v&&!T&&L?w=requestAnimationFrame(A):cancelAnimationFrame(w);});}),pe;function Se(){clearTimeout(pe),pe=setTimeout(ie,150);}window.addEventListener("resize",Se),window.addEventListener("orientationchange",Se);let Z=Fe([Q],Se);return te.observe(n),Pe(n,{type:"video",getProgress:()=>N,getTrigger:()=>({tStart:k,tEnd:M})}),{destroy(){cancelAnimationFrame(w),te.disconnect(),n.removeEventListener("loadedmetadata",h),window.removeEventListener("resize",Se),window.removeEventListener("orientationchange",Se),Z(),O(),clearTimeout(pe),ke(n);},replay(){U=-1,B=false,N=0,T=false,z=NaN,u(0);},pause(){T=true,cancelAnimationFrame(w);},resume(){T&&(T=false,v&&L&&(w=requestAnimationFrame(A)));},seek(E){let de=Math.min(1,Math.max(0,E));N=de,U=de,T=true,cancelAnimationFrame(w),z=NaN,u(de);},getProgress(){return N}}}function en(e,r){let t=document.createElement("span");t.textContent=r,t.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;user-select:none",e.appendChild(t);}function rn(e){let r=e.textContent??"";return e.textContent="",r.split(/(\s+)/).filter(Boolean).map(t=>{let n=document.createElement("span");return n.setAttribute("aria-hidden","true"),/^\s+$/.test(t)?(n.textContent=t,n.style.whiteSpace="pre"):(n.textContent=t,n.style.display="inline-block"),e.appendChild(n),/^\s+$/.test(t)?null:n}).filter(t=>t!==null)}function On(e){let r=e.textContent??"";return e.textContent="",r.split("").map(t=>{let n=document.createElement("span");return n.setAttribute("aria-hidden","true"),n.textContent=t,t===" "?n.style.whiteSpace="pre":n.style.display="inline-block",e.appendChild(n),t===" "?null:n}).filter(t=>t!==null)}function tn(e){let r=rn(e),t=new Map;for(let i of r){let a=i.offsetTop;t.has(a)||t.set(a,[]),t.get(a).push(i);}let n=[],s=Array.from(t.keys()).sort((i,a)=>i-a);for(let i of s){let a=t.get(i),m=document.createElement("span");m.setAttribute("aria-hidden","true"),m.style.display="inline-block",a.forEach((f,d)=>{let x=f.nextElementSibling;m.appendChild(f),d<a.length-1&&x&&x.style.whiteSpace==="pre"&&m.appendChild(x);}),n.push(m);}return e.textContent="",n.forEach((i,a)=>{e.appendChild(i),a<n.length-1&&e.appendChild(document.createTextNode(" "));}),n}function In(e,r,t,n){if(t<=1||n===0)return e;let s=(t-1)*n,i=r*n,a=i+(1-s);return a<=i?e>=i?1:0:Math.min(1,Math.max(0,(e-i)/(a-i)))}function Dn(e,r){let t=[];if(r?.y!==void 0&&t.push(`translateY(${r.y*(1-e)}px)`),r?.x!==void 0&&t.push(`translateX(${r.x*(1-e)}px)`),r?.rotate!==void 0&&t.push(`rotate(${r.rotate*(1-e)}deg)`),r?.scale!==void 0){let n=r.scale+(1-r.scale)*e;t.push(`scale(${n})`);}return t.join(" ")||""}var nn={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function St(e,r={}){if(typeof window>"u")return nn;let t=typeof e=="string"?document.querySelector(e):e;if(!t)return he("scrollText: element not found:",e),nn;let n=t;return Be(r,(s,i)=>Fn(n,s,i))}function Fn(e,r,t){let{split:n="words",stagger:s=.04,easing:i="ease-out",from:a={opacity:0,y:24},trigger:m={},once:f=true,onComplete:d}=r,x=typeof i=="function"?i:oe[i]??oe["ease-out"],R=ye(m.start??"top 85%"),C=ye(m.end??"top 40%"),Q=e.innerHTML,me=e.textContent??"",I;n==="chars"?I=On(e):n==="lines"?I=tn(e):I=rn(e),en(e,me);let se=I.length;function be(h,O){a?.opacity!==void 0&&(h.style.opacity=String(a.opacity+(1-a.opacity)*O));let te=Dn(O,a);te&&(h.style.transform=te);}function D(h){e.style.setProperty("--scroll-draw-progress",String(h)),I.forEach((O,te)=>{let pe=x(In(h,te,se,s));be(O,pe);});}if(t)return D(1),d?.(),{destroy(){e.innerHTML=Q;},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};D(0);let H=0,k=0,M=0,w=false,v=false,T=-1,U=0,N=false,B=()=>window.scrollY,L=()=>window.innerHeight;function fe(){let h=e.getBoundingClientRect(),O=Le({top:h.top,height:h.height},B(),L(),R,C);H=O.tStart,k=O.tEnd;}function Ee(){if(!w||v)return;let h=ee(B(),H,k,1);f&&(T=Math.max(T,h),h=T),U=h,D(h),h>=1&&!N?(N=true,d?.()):h<1&&!f&&(N=false),M=requestAnimationFrame(Ee);}fe();let ie=new IntersectionObserver(h=>{h.forEach(O=>{w=O.isIntersecting,w&&!v?M=requestAnimationFrame(Ee):cancelAnimationFrame(M);});}),z;function u(){clearTimeout(z),z=setTimeout(()=>{if(n==="lines"){let h=U;e.innerHTML=Q,I=tn(e),en(e,me),D(h);}fe();},150);}window.addEventListener("resize",u),window.addEventListener("orientationchange",u);let A=Fe([e],u);return ie.observe(e),Pe(e,{type:"text",getProgress:()=>U,getTrigger:()=>({tStart:H,tEnd:k})}),{destroy(){cancelAnimationFrame(M),ie.disconnect(),window.removeEventListener("resize",u),window.removeEventListener("orientationchange",u),A(),clearTimeout(z),e.innerHTML=Q,ke(e);},replay(){T=-1,N=false,U=0,v=false,D(0);},pause(){v=true,cancelAnimationFrame(M);},resume(){v&&(v=false,w&&(M=requestAnimationFrame(Ee)));},seek(h){let O=Math.min(1,Math.max(0,h));U=O,T=O,v=true,cancelAnimationFrame(M),D(O);},getProgress(){return U}}}function Re(e,r){let t,n,s,i;return solidJs.createEffect(()=>{i=typeof e=="function"?e():e;let a=jt(i);!t||a===s||(s=a,solidJs.untrack(()=>{n?.destroy(),n=r(t,Qt(i,()=>i));}));}),solidJs.onCleanup(()=>{n?.destroy(),n=s=void 0;}),{ref:a=>{t=a;},getInstance:()=>n}}function Zr(e={}){return Re(e,ht).ref}function Jr(e={}){return Re(e,ht)}function eo(e){return Re(e,bt).ref}function to(e){return Re(e,bt)}function no(e){return Re(e,vt).ref}function ro(e){return Re(e,vt)}function oo(e={}){return Re(e,Et).ref}function so(e={}){return Re(e,Et)}function io(e={}){return Re(e,St).ref}function ao(e={}){return Re(e,St)}exports.createScrollAnimate=to;exports.createScrollCounter=ro;exports.createScrollDraw=Jr;exports.createScrollText=ao;exports.createScrollVideo=so;exports.useScrollAnimate=eo;exports.useScrollCounter=no;exports.useScrollDraw=Zr;exports.useScrollText=io;exports.useScrollVideo=oo;
|
|
1
|
+
'use strict';var solidJs=require('solid-js');function yn({bounces:e=3,decay:r=.5}={}){let t=Math.max(1,Math.round(e)),n=Math.max(.01,Math.min(.99,r)),s=Math.sqrt(n),i=0,a=[];for(let y=0;y<t;y++){let E=Math.pow(s,y);a.push(E),i+=E;}let m=[0],p=0;for(let y=0;y<t;y++)p+=a[y]/i,m.push(p);return y=>{if(y<=0)return 0;if(y>=1)return 1;for(let E=0;E<t;E++)if(y<=m[E+1]){let D=(y-m[E])/(m[E+1]-m[E]);if(E===0)return D*(2-D);let S=1-Math.pow(n,E);return S+(1-S)*(2*D-1)*(2*D-1)}return 1}}function hn({amplitude:e=1,period:r=.4}={}){let t=Math.max(1,e),n=Math.max(.1,r),s=t<=1?n/4:n/(2*Math.PI)*Math.asin(1/t);return i=>i<=0?0:i>=1?1:t*Math.pow(2,-10*i)*Math.sin((i-s)*(2*Math.PI)/n)+1}var ee={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:yn(),elastic:hn()};function Ht(e,r,t){return Math.min(t,Math.max(r,e))}function de(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 Nt(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 Vt(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 U(e,r,t,n){return t===r?0:Ht((e-r)/(t-r)*n,0,1)}function Le(e,r,t,n,s){let i=Nt(e.top,e.height,r,n.element)-Vt(n.viewport,t),a=Nt(e.top,e.height,r,s.element)-Vt(s.viewport,t);return {tStart:i,tEnd:a}}function ot(e,r,t){let n=e.getBoundingClientRect(),s=t==="x"?n.width:n.height;return r?{top:t==="x"?n.left-r.getBoundingClientRect().left-r.clientLeft+r.scrollLeft:n.top-r.getBoundingClientRect().top-r.clientTop+r.scrollTop,height:s,scroll:0}:{top:t==="x"?n.left:n.top,height:s,scroll:t==="x"?window.scrollX:window.scrollY}}function st(e){let r=parseFloat(e.getAttribute("pathLength")??"");if(r>0)return r;let t=e.tagName.toLowerCase();if(t==="rect"){let n=parseFloat(e.getAttribute("width")??"0"),s=parseFloat(e.getAttribute("height")??"0");return 2*(n+s)}if(t==="circle"){let n=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*n}return e.getTotalLength()}function zt(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 it(e,r,t){let n=zt(e),s=zt(r);return !n||!s?e:`rgb(${Math.round(n[0]+(s[0]-n[0])*t)},${Math.round(n[1]+(s[1]-n[1])*t)},${Math.round(n[2]+(s[2]-n[2])*t)})`}var _t={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 ge(e,...r){je&&console.warn(`[svg-scroll-draw] ${e}`,...r);}var bn="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",wn="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Wt=33;function vn(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function En(e){let r=[];for(let t=0;t<Wt;t++){let n=t/(Wt-1);r.push(String(Math.round(e(n)*1e5)/1e5));}return `linear(${r.join(",")})`}function at(e){switch(e){case "linear":return "linear";case "ease-in":return bn;case "ease-out":return wn;case "ease-in-out":return vn()?En(ee["ease-in-out"]):null;default:return null}}var qt=Symbol.for("svg-scroll-draw.registry");function Bt(){let e=globalThis;return e[qt]||(e[qt]=new Map)}function Ce(e,r){Bt().set(e,r);}function Pe(e){Bt().delete(e);}var Ke,lt=new Set,ct=new WeakMap,Ze=new Map,Gt=e=>{let r=e.getBoundingClientRect();return r.width+" "+r.height};function Sn(e){let r=new Set;for(let t of e)for(;t&&t!==document.body;t=t.parentElement)for(let n=t;n;n=n.previousElementSibling)r.add(n);return r}function ke(e,r){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let t=()=>r();Ke??(Ke=new ResizeObserver(s=>{let i=false;for(let{target:a}of s)ct.get(a)!==Gt(a)&&(i=true),ct.set(a,"");i&<.forEach(a=>a());})),lt.add(t);let n=Sn(e);return [document.body,document.documentElement].forEach(s=>s&&n.add(s)),n.forEach(s=>{ct.has(s)||ct.set(s,Gt(s)),Ze.set(s,(Ze.get(s)??0)+1),Ke.observe(s);}),()=>{lt.delete(t)&&(n.forEach(s=>{let i=(Ze.get(s)??1)-1;if(i)return void Ze.set(s,i);Ze.delete(s),Ke?.unobserve(s);}),lt.size||(Ke?.disconnect(),Ke=void 0));}}function ut(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let r=window.matchMedia("(prefers-reduced-motion: reduce)"),t=s=>e(!!s.matches);if(typeof r.addEventListener=="function")return r.addEventListener("change",t),()=>r.removeEventListener("change",t);let n=r;return n.addListener?.(t),()=>n.removeListener?.(t)}function We(e,r){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return r(e,true);let t=r(e,false),n=ut(i=>{if(!i)return;n();let a=(t.getProgress?.()??0)>=1;t.destroy(),t=r(a?{...e,onComplete:void 0}:e,true);}),s={};for(let i of Object.keys(t))s[i]=(...a)=>t[i]?.(...a);return s.destroy=()=>{n(),t.destroy();},s}var Tn=0;function xn(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function jt(e,r){let t="";try{t=getComputedStyle(e).getPropertyValue(r).trim();}catch{}return t||(e.getAttribute(r)??"").trim()}var Qt=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function Mn(e){if(!je)return;let r=jt(e,"stroke");if(!r||r==="none"){ge("Element has no stroke \u2014 path will not be visible.",e);return}let t=(e.getAttribute("fill")??"").trim();t&&!Qt.has(t)&&!Qt.has(jt(e,"fill"))&&ge("Element has a fill \u2014 it may obscure the stroke animation.",e);}function Ln(e,r,t){let n=document.createElement("div");n.setAttribute("data-svg-scroll-draw-debug",""),n.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function s(){let i=t==="x"?window.scrollX:window.scrollY,a=e-i,m=r-i,p=t==="x";n.innerHTML=`
|
|
2
|
+
<div style="position:absolute;${p?`left:${a}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${a}px;left:0;right:0;border-top:2px dashed #22c55e;`}padding:2px 6px;color:#22c55e;background:rgba(0,0,0,.6)">\u25B6 start</div>
|
|
3
|
+
<div style="position:absolute;${p?`left:${m}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${m}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(n),window.addEventListener("scroll",s,{passive:true}),s(),{el:n,destroy(){window.removeEventListener("scroll",s),n.remove();}}}var Ut=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Yt=/[MmLlHhVvCcSsQqTtAaZz]/g;function An(e,r,t){if(!je)return;let n=(e.match(Yt)??[]).join("").toUpperCase(),s=(r.match(Yt)??[]).join("").toUpperCase(),i=(e.match(Ut)??[]).length,a=(r.match(Ut)??[]).length;if(n!==s){ge(`morphTo: command sequence differs (${n||"\u2205"} \u2192 ${s||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,t);return}i!==a&&ge(`morphTo: coordinate count differs (${i} \u2192 ${a}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,t);}function Cn(e,r,t){let n=(r.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),s=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,i=>{let a=parseFloat(i),m=n[s++]??a;return String(+(a+(m-a)*t).toFixed(4))})}function wt(e,r={}){return typeof window>"u"?{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0}:We(r,(t,n)=>Pn(e,t,n))}function Pn(e,r,t){let{preset:n,...s}=r,i=n?{..._t[n],...s}:s,{selector:a="path, polyline, line, polygon, rect, circle",speed:m=1,fade:p=false,easing:y="linear",trigger:E={},stagger:D=0,direction:S="forward",once:Y=false,debug:te=false,axis:L="y",scrollContainer:ne,autoReverse:we=false,delay:P=0,strokeColor:I,strokeWidth:O,fillOpacity:A,waypoints:b,velocityScale:h=false,threshold:v=0,rootMargin:G="0px",repeat:_=0,repeatDelay:q=0,morphTo:N,clip:R,autoplay:re=false,duration:Te=1e3,native:ce=true,onProgress:H,onStart:$,onComplete:k,onEnter:u,onLeave:d,onEnterBack:X,onLeaveBack:xe}=i,V=R===true?"left":typeof R=="string"?R:false,K=typeof y=="function"?y:ee[y]??ee.linear,Oe=de(E.start||"top bottom"),x=de(E.end||"bottom top"),T=typeof ne=="string"?document.querySelector(ne):ne??null,ue=Array.isArray(I)?I[0]:null,me=Array.isArray(I)?I[1]:typeof I=="string"?I:null,$e=Array.isArray(O)?O[0]:null,Re=Array.isArray(O)?O[1]:typeof O=="number"?O:null,Me=Array.isArray(A)?A[0]:null,Ne=Array.isArray(A)?A[1]:typeof A=="number"?A:null;function Fe(o){let l=o*100;switch(V){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 F=V?[]:Array.from(e.querySelectorAll(a)),ye=[],ve=[],oe=0,Z=0,qe=D,Je=0,j=false,c=false,f=0,Ae=false,fe=-1,J=[],Q=-1,w=false,se=0,he=0,Ve,ft=null;function Lt(){ft?.destroy(),ft=null;}let ze=new Set,At=NaN,_e=true,et=-1,Ct=performance.now(),Be=NaN;function Qe(){return T?L==="x"?T.scrollLeft:T.scrollTop:L==="x"?window.scrollX:window.scrollY}function Pt(){return T?L==="x"?T.clientWidth:T.clientHeight:L==="x"?window.innerWidth:window.innerHeight}function Ot(){let o=ot(e,T,L);return Le(o,o.scroll,Pt(),Oe,x)}function cn(){let o=Z-oe,l=F.length-1,g=T??document.documentElement,C=L==="x"?"Width":"Height";if(qe=D,D>0&&l>0&&o>0){let pe=g[`scroll${C}`]-g[`client${C}`]-1-oe-o/m;pe>=0&&(qe=Math.min(D,pe/(l*o)));}Je=Z+l*qe*o;}function $t(){(({tStart:oe,tEnd:Z}=Ot())),cn(),te&&je&&(Lt(),ft=Ln(oe,Z,L));}function pt(o,l=Ot){Ce(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:l});let g=o.destroy;return o.destroy=()=>{g.call(o),Pe(e);},o}function kt(o,l){return Y&&!we?Math.max(fe,K(J[o]=Math.max(J[o]??0,l))):K(l)}function un(o,l){if(e.style.setProperty("--scroll-draw-progress",String(o)),V){let g=l==="reverse"?1-o:o;e.style.clipPath=Fe(g);return}F.forEach((g,C)=>dt(g,C,o,l));}function dt(o,l,g,C){o.style.strokeDashoffset=C==="reverse"?`${ye[l]*g}`:`${ye[l]*(1-g)}`,p&&(o.style.opacity=C==="reverse"?`${1-g}`:`${g}`),ue&&me?o.style.stroke=it(ue,me,g):me&&(o.style.stroke=me),$e!==null&&Re!==null?o.style.strokeWidth=`${$e+(Re-$e)*g}`:Re!==null&&(o.style.strokeWidth=`${Re}`),Me!==null&&Ne!==null?o.style.fillOpacity=`${Me+(Ne-Me)*g}`:Ne!==null&&(o.style.fillOpacity=`${Ne}`),N&&o.tagName.toLowerCase()==="path"&&ve[l]&&o.setAttribute("d",Cn(ve[l],N,g));}function Ue(){if(e.style.setProperty("--scroll-draw-progress","0"),V){e.style.clipPath=Fe(S==="reverse"?1:0);return}F.forEach((o,l)=>{o.style.strokeDasharray=`${ye[l]}`,o.style.strokeDashoffset=S==="reverse"?"0":`${ye[l]}`,p?o.style.opacity=S==="reverse"?"1":"0":o.style.opacity="",ue&&(o.style.stroke=ue),$e!==null&&(o.style.strokeWidth=`${$e}`),Me!==null&&(o.style.fillOpacity=`${Me}`),N&&o.tagName.toLowerCase()==="path"&&ve[l]&&o.setAttribute("d",ve[l]);});}function Ye(o,l){let g=o.getAttribute("d"),C=st(o);if(N&&ve[l]){o.setAttribute("d",N);let pe=st(o);o.setAttribute("d",ve[l]),C=Math.max(st(o),pe),o.setAttribute("d",g);}ye[l]=C,o.style.strokeDasharray=`${C}`;}if(F.forEach((o,l)=>{Mn(o);let g=o.tagName.toLowerCase()==="path";g?ve.push(o.getAttribute("d")??""):ve.push(""),Ye(o,l);let C=ye[l];N&&(g?An(ve[ve.length-1],N,o):ge(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),t?(o.style.strokeDashoffset=S==="reverse"?`${C}`:"0",p&&(o.style.opacity="1"),me&&(o.style.stroke=me),Re!==null&&(o.style.strokeWidth=`${Re}`),Ne!==null&&(o.style.fillOpacity=`${Ne}`),N&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",N)):(o.style.strokeDashoffset=S==="reverse"?"0":`${C}`,p?o.style.opacity=S==="reverse"?"1":"0":o.style.opacity="",ue&&(o.style.stroke=ue),$e!==null&&(o.style.strokeWidth=`${$e}`),Me!==null&&(o.style.fillOpacity=`${Me}`));}),t)return V&&(e.style.clipPath=Fe(1)),k?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};V&&(e.style.clipPath=Fe(S==="reverse"?1:0));let It=typeof y=="string"?at(y):null;function mn(){return !(ce===false||re||te&&je||!xn()||!F.length||!It||V||L!=="y"||T||m!==1||D!==0||Y||we||h!==false||N||b||_||P>0||H||$||k||u||d||X||xe||I!=null||O!=null||A!=null||(E.start||"top bottom").trim()!=="top bottom"||(E.end||"bottom top").trim()!=="bottom top")}function fn(){let o=++Tn,l=`svg-scroll-draw-${o}`,g=`svg-scroll-draw-host-${o}`,C=`--svg-scroll-draw-${o}`,pe=S==="reverse"?"0":"var(--ssd-len)",De=S==="reverse"?"var(--ssd-len)":"0",Ee=`stroke-dashoffset:${pe};`,W=`stroke-dashoffset:${De};`;p&&(Ee+=`opacity:${S==="reverse"?1:0};`,W+=`opacity:${S==="reverse"?0:1};`);let B=document.createElement("style");B.setAttribute("data-svg-scroll-draw",""),B.textContent=`@keyframes ${l}{from{${Ee}}to{${W}}}.${g}{view-timeline-name:${C};view-timeline-axis:block;}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${It};animation-fill-mode:both;animation-timeline:${C};animation-range:cover 0% cover 100%;}`,document.head.appendChild(B),e.classList.add(g);function ie(M,z){M.style.setProperty("--ssd-len",String(ye[z])),M.style.strokeDasharray=`${ye[z]}`,M.style.strokeDashoffset="",M.style.opacity="",M.style.animationPlayState="",M.classList.add(l);}F.forEach(ie);let ae=false,be=-1;function Se(){if(be>=0)return be;let M=e.getBoundingClientRect(),{tStart:z,tEnd:le}=Le({top:M.top,height:M.height},Qe(),Pt(),Oe,x);return K(U(Qe(),z,le,m))}return {destroy(){e.classList.remove(g),F.forEach(M=>{M.classList.remove(l),M.style.removeProperty("--ssd-len"),M.style.animationPlayState="";}),B.remove();},replay(){ae=false,be=-1,F.forEach(ie);},pause(){ae=true,F.forEach(M=>{M.style.animationPlayState="paused";});},resume(){ae&&(ae=false,F.forEach(M=>{M.style.animationPlayState="running";}));},seek(M){let z=Math.min(1,Math.max(0,M));be=z,ae=true,F.forEach((le,He)=>{le.classList.remove(l),le.style.strokeDashoffset=S==="reverse"?`${ye[He]*z}`:`${ye[He]*(1-z)}`,p&&(le.style.opacity=S==="reverse"?`${1-z}`:`${z}`);});},getProgress(){return Se()},refresh(){F.forEach((M,z)=>{Ye(M,z),M.style.setProperty("--ssd-len",String(ye[z]));});}}}if(mn())return pt(fn());function pn(){let o=Math.max(1,Te),l=V?o:o*(1+Math.max(0,F.length-1)*D),g=0,C=0,pe=false;function De(be){let Se=true,M=Math.min(1,Math.max(0,be/l));if(V){let z=Math.min(1,Math.max(0,be/o)),le=K(z);se=le,e.style.setProperty("--scroll-draw-progress",String(le)),e.style.clipPath=Fe(S==="reverse"?1-le:le),H?.(le),z<1&&(Se=false);}else {F.forEach((le,He)=>{let gn=He*D*o,Dt=Math.min(1,Math.max(0,(be-gn)/o));dt(le,He,K(Dt),S),Dt<1&&(Se=false);});let z=K(M);se=z,H?.(z),e.style.setProperty("--scroll-draw-progress",String(z));}if(b){let z=K(M);for(let le in b){let He=parseFloat(le);z>=He&&!ze.has(He)&&(ze.add(He),b[le]?.());}}return Se}function Ee(be){if(w)return;let Se=be-g;c||(c=true,$?.());let M=De(Se);if(M&&!j){j=true,De(l),k?.(),he<(_==="infinite"?1/0:_??0)&&(he++,Ve=setTimeout(()=>{g=performance.now(),c=false,j=false,ze.clear(),Ue(),f=requestAnimationFrame(Ee);},q));return}M||(f=requestAnimationFrame(Ee));}function W(){cancelAnimationFrame(f),clearTimeout(Ve),g=performance.now(),C=0,w=false,c=false,j=false,he=0,pe=true,se=0,ze.clear(),Ue(),f=requestAnimationFrame(Ee);}let B=new IntersectionObserver(be=>{be.forEach(Se=>{Se.isIntersecting&&!(Y&&j)?W():!Se.isIntersecting&&!Y&&!j&&(cancelAnimationFrame(f),clearTimeout(Ve),pe=false);});},{root:T??null,threshold:v,rootMargin:G}),ie;function ae(){clearTimeout(ie),ie=setTimeout(()=>F.forEach(Ye),150);}return window.addEventListener("resize",ae),window.addEventListener("orientationchange",ae),P>0?setTimeout(()=>B.observe(e),P):B.observe(e),{destroy(){cancelAnimationFrame(f),clearTimeout(Ve),B.disconnect(),window.removeEventListener("resize",ae),window.removeEventListener("orientationchange",ae),clearTimeout(ie);},replay(){he=0,W();},pause(){w||!pe||(w=true,C=performance.now()-g,cancelAnimationFrame(f));},resume(){w&&(w=false,pe=true,g=performance.now()-C,f=requestAnimationFrame(Ee));},seek(be){let Se=Math.min(1,Math.max(0,be));se=Se,w=true,C=Se*l,g=performance.now()-C,cancelAnimationFrame(f),De(C);},getProgress(){return se},refresh(){clearTimeout(ie),F.forEach(Ye);}}}if(re)return pt(pn());$t();function Rt(){if(w||!Ge)return;let o=performance.now(),l=Qe();if(!_e&&h===false&&l===At){yt(l);return}_e=false,At=l;let g=m;if(h!==false){let W=o-Ct,B=W>0?Math.abs(l-(et<0?l:et))/W:0;g=m*Math.max(.2,1+B*(typeof h=="number"?h:1)*.04);}et=l,Ct=o;let C=we?Q===-1||l>=Q?"forward":"reverse":S;Q=l;let pe=Z-oe,De=true,Ee=pe===0?0:(l-oe)/pe;if(isNaN(Be)||(Be<=0&&Ee>0?u?.():Be>0&&Ee<=0&&xe?.(),Be<1&&Ee>=1?d?.():Be>=1&&Ee<1&&X?.()),Be=Ee,V){let W=kt(0,U(l,oe,Z,g));se=W,e.style.setProperty("--scroll-draw-progress",String(W));let B=C==="reverse"?1-W:W;e.style.clipPath=Fe(B),H?.(W),!c&&U(l,oe,Z,g)>0&&(c=true,$?.()),W>=1&&!j?(j=true,k?.(),he<(_==="infinite"?1/0:_??0)&&(he++,Ve=setTimeout(()=>{fe=-1,J=[],c=false,j=false,Ue();},q))):W<1&&!Y&&(j=false),yt(l);return}if(F.forEach((W,B)=>{let ie=B*qe*pe,ae=kt(B,U(l,oe+ie,Z+ie,g));dt(W,B,ae,C),B===0&&(se=ae,H?.(ae),e.style.setProperty("--scroll-draw-progress",String(ae))),ae<1&&(De=false);}),b){let W=K(U(l,oe,Z,g));for(let B in b){let ie=parseFloat(B);W>=ie&&!ze.has(ie)&&(ze.add(ie),b[B]?.());}}!c&&U(l,oe,Z,g)>0&&(c=true,$?.()),De&&!j?(j=true,k?.(),he<(_==="infinite"?1/0:_??0)&&(he++,Ve=setTimeout(()=>{fe=-1,J=[],c=false,j=false,ze.clear(),Ue(),_e=true;},q))):!De&&!Y&&(j=false),yt(l);}function gt(o){return o>=Z&&o<Je}function yt(o){Ae||gt(o)?f=requestAnimationFrame(Rt):Ge=false;}function ht(){return Ae||gt(Qe())}let Ge=false;function tt(){Ge||(Ge=true,f=requestAnimationFrame(function(){Rt();}));}function nt(){Ge=false,cancelAnimationFrame(f);}let bt=new IntersectionObserver(o=>{o.forEach(l=>{Ae=l.isIntersecting,Ae&&!w?(_e=true,tt()):Ge&&!w&>(Qe())||nt();});},{root:T??null,threshold:v,rootMargin:G});function Ft(){F.forEach(Ye),$t(),_e=true;}let rt;function Xe(){clearTimeout(rt),rt=setTimeout(Ft,150);}window.addEventListener("resize",Xe),window.addEventListener("orientationchange",Xe);let dn=ke([e],Xe);return P>0?setTimeout(()=>bt.observe(e),P):bt.observe(e),pt({destroy(){cancelAnimationFrame(f),clearTimeout(Ve),nt(),bt.disconnect(),dn(),window.removeEventListener("resize",Xe),window.removeEventListener("orientationchange",Xe),clearTimeout(rt),Lt();},replay(){fe=-1,J=[],Q=-1,et=-1,c=false,j=false,he=0,w=false,se=0,ze.clear(),clearTimeout(Ve),Ue(),_e=true,ht()&&tt();},pause(){w=true,nt();},resume(){w&&(w=false,_e=true,ht()&&tt());},seek(o){let l=Math.min(1,Math.max(0,o));se=l,fe=l,J=[],w=true,nt(),un(l,S),_e=true;},getProgress(){return se},refresh(){clearTimeout(rt),Ft(),ht()&&!w&&tt();}},()=>({tStart:oe,tEnd:Z}))}var Xt=new WeakMap,On=0;function Kt(e){return JSON.stringify(e,(r,t)=>{if(typeof t=="function")return "\u0192";if(typeof Element<"u"&&t instanceof Element){let n=Xt.get(t);return n===void 0&&Xt.set(t,n=++On),`el#${n}`}return t})}function Zt(e,r){let t={...e};for(let n of Object.keys(t))typeof t[n]=="function"&&(t[n]=(...s)=>r()[n]?.(...s));return t}function $n(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Jt(e){let r=[],t=/([\w]+)\(([^)]*)\)/g,n;for(;(n=t.exec(e))!==null;){let s=[],i=[],a=n[2].trim();if(a)for(let m of a.split(/[\s,]+/)){let p=m.match(/^([-+]?[\d.eE]+)(.*)$/);s.push(p?parseFloat(p[1]):0),i.push(p?p[2]:"");}r.push({fn:n[1],nums:s,units:i});}return r}function kn(e,r,t){let n=Jt(e),s=Jt(r);return n.length===0||n.length!==s.length?t<1?e:r:n.map((i,a)=>{let m=s[a];return i.fn!==m.fn||i.nums.length!==m.nums.length?t<1?`${i.fn}(${i.nums.map((p,y)=>`${p}${i.units[y]}`).join(", ")})`:`${m.fn}(${m.nums.map((p,y)=>`${p}${m.units[y]}`).join(", ")})`:`${i.fn}(${i.nums.map((p,y)=>`${p+(m.nums[y]-p)*t}${i.units[y]}`).join(", ")})`}).join(" ")}function en(e,r,t){if(typeof e=="number"&&typeof r=="number")return String(e+(r-e)*t);let n=String(e),s=String(r);if($n(n))return it(n,s,t);if(n.includes("("))return kn(n,s,t);let i=n.match(/^([-+]?[\d.]+)(.*)$/),a=s.match(/^([-+]?[\d.]+)(.*)$/);if(i&&a){let m=parseFloat(i[1]),p=parseFloat(a[1]);return `${m+(p-m)*t}${i[2]||a[2]}`}return t<1?n:s}function In(e){return e.replace(/([A-Z])/g,r=>`-${r.toLowerCase()}`)}var Rn=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Fn=0,tn="--scroll-draw-progress";function Dn(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var rn={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function vt(e,r){return typeof window>"u"?rn:r.respectReducedMotion===false?nn(e,r,false):We(r,(t,n)=>nn(e,t,n))}function nn(e,r,t){let{props:n,trigger:s={},easing:i="ease-out",speed:a=1,once:m=false,axis:p="y",scrollContainer:y,native:E=true,velocityScale:D=false,triggerElement:S,onProgress:Y,onComplete:te,onEnter:L,onLeave:ne,onEnterBack:we,onLeaveBack:P}=r,I=typeof i=="function"?i:ee[i]??ee["ease-out"],O=de(s.start||"top bottom"),A=de(s.end||"bottom top"),b=S??e,h=typeof y=="string"?document.querySelector(y):y??null,v=Object.entries(n).map(([c,f])=>({prop:In(c),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function G(){let c=window.getComputedStyle(e);for(let f of v)f.from===""&&(f.from=c.getPropertyValue(f.prop).trim()||"0");}function _(){for(let c of v)e.style.setProperty(c.prop,String(c.to));}let q=new Map;for(let c of [...v.map(f=>f.prop),tn])q.set(c,e.style.getPropertyValue(c));function N(){for(let[c,f]of q)f?e.style.setProperty(c,f):e.style.removeProperty(c);}if(t)return _(),te?.(),{...rn,destroy:N,getProgress:()=>1};G();let R=()=>h?p==="x"?h.scrollLeft:h.scrollTop:p==="x"?window.scrollX:window.scrollY,re=()=>h?p==="x"?h.clientWidth:h.clientHeight:p==="x"?window.innerWidth:window.innerHeight,Te=typeof i=="string"?at(i):null;function ce(){if(!E||!Dn()||!Te||p!=="y"||h||b!==e||m||a!==1||Y||te||L||ne||we||P||D!==false||(s.start||"top bottom").trim()!=="top bottom"||(s.end||"bottom top").trim()!=="bottom top")return false;for(let c of v)if(!Rn.has(c.prop))return false;return true}function H(){let c=`ssd-a-${++Fn}`,f=v.map(w=>`${w.prop}:${w.from}`).join(";"),Ae=v.map(w=>`${w.prop}:${w.to}`).join(";"),fe=document.createElement("style");fe.setAttribute("data-ssd-animate",""),fe.textContent=`@keyframes ${c}{from{${f}}to{${Ae}}}.${c}{animation-name:${c};animation-duration:auto;animation-timing-function:${Te};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(fe),e.classList.add(c);let J=()=>{let w=e.getBoundingClientRect();return Le({top:w.top,height:w.height},R(),re(),O,A)};Ce(e,{type:"animate",getProgress:()=>Q.getProgress(),getTrigger:J});let Q={refresh(){},destroy(){e.classList.remove(c),fe.remove(),e.style.animationPlayState="",N(),Pe(e);},replay(){e.classList.remove(c),e.offsetWidth,e.classList.add(c);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(w){let se=Math.min(1,Math.max(0,w));e.classList.remove(c);for(let he of v)e.style.setProperty(he.prop,en(he.from,he.to,se));},getProgress(){let{tStart:w,tEnd:se}=J();return I(U(R(),w,se,a))}};return Q}if(ce())return H();let $=0,k=0,u=0,d=NaN,X=false,xe=-1,V=0,K=0,Oe=false,x=NaN,T=-1,ue=0,me=b===e?v:[],$e=false;function Re(){let c=e.style,f=me.map(Q=>c.getPropertyValue(Q.prop)),Ae=c.transition;me.length&&(c.transition="none"),me.forEach(Q=>c.setProperty(Q.prop,q.get(Q.prop)??""));let fe=ot(b,h,p);me.forEach((Q,w)=>c.setProperty(Q.prop,f[w])),me.length&&(e.offsetWidth,c.transition=Ae);let J=Le(fe,fe.scroll,re(),O,A);$e&&Math.abs(J.tStart-$)<1&&Math.abs(J.tEnd-k)<1||($e=true,$=J.tStart,k=J.tEnd);}function Me(c){e.style.setProperty(tn,String(c));for(let f of v)e.style.setProperty(f.prop,en(f.from,f.to,c));Y?.(c);}function Ne(c){if(isNaN(x)){x=c;return}x<=0&&c>0?L?.():x>0&&c<=0&&P?.(),x<1&&c>=1?ne?.():x>=1&&c<1&&we?.(),x=c;}let Fe=c=>U(c,$,k,Math.min(a,1));function F(){!u&&!X&&Fe(R())!==d&&(u=requestAnimationFrame(ye));}function ye(){if(X)return;let c=performance.now(),f=R(),Ae=a;if(D!==false){let w=c-ue,se=w>0?Math.abs(f-(T<0?f:T))/w:0;Ae=a*Math.max(.2,1+se*(typeof D=="number"?D:1)*.04);}T=f,ue=c;let fe=k===$?0:(f-$)/(k-$);Ne(fe);let J=U(f,$,k,Ae),Q=m?Math.max(xe,I(V=Math.max(V,J))):I(J);K=Q,Me(Q),Q>=1&&!Oe?(Oe=true,te?.()):Q<1&&!m&&(Oe=false),!X&&(d=Fe(f),u=d>0&&d<1?requestAnimationFrame(ye):0);}Re(),k===$&&ge("scrollAnimate: zero-length trigger window, so it never animates. In a sticky stage, set triggerElement.",e),V=U(R(),$,k,a),K=I(V),Me(K);function ve(){Re(),F();}let oe;function Z(){clearTimeout(oe),oe=setTimeout(ve,150);}let qe=h??window;qe.addEventListener("scroll",F,{passive:true}),window.addEventListener("resize",Z),window.addEventListener("orientationchange",Z);let Je=ke([b],Z);F(),Ce(e,{type:"animate",getProgress:()=>K,getTrigger:()=>({tStart:$,tEnd:k})});function j(){X=true,cancelAnimationFrame(u),u=0,d=NaN;}return {destroy(){j(),qe.removeEventListener("scroll",F),window.removeEventListener("resize",Z),window.removeEventListener("orientationchange",Z),Je(),clearTimeout(oe),N(),Pe(e);},replay(){xe=-1,V=0,Oe=false,K=0,X=false,Me(0),d=0,F();},pause:j,resume(){X&&(X=false,F());},seek(c){let f=Math.min(1,Math.max(0,c));K=f,xe=f,V=0,j(),Me(f);},getProgress(){return K},refresh:ve}}var Et={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function St(e,r){if(typeof window>"u")return Et;let t=typeof e=="string"?document.querySelector(e):e;return t?We(r,(n,s)=>Hn(t,n,s)):(ge("scrollCounter: element not found:",e),Et)}function Hn(e,r,t){let{from:n=0,to:s,format:i,easing:a="ease-out",trigger:m={},once:p=true,decimals:y,onComplete:E}=r,D=y!==void 0?u=>u.toFixed(y):i??(u=>String(Math.round(u))),S=typeof a=="function"?a:ee[a]??ee["ease-out"],Y=de(m.start||"top 80%"),te=de(m.end||"top 20%");if(t)return e.textContent=D(s),E?.(),{...Et,getProgress:()=>1};let L=0,ne=0,we=false,P=0,I=false,O=false,A=-1,b=0,h=0,v=false,G=()=>window.scrollY,_=()=>window.innerHeight;function q(){let u=e.getBoundingClientRect(),d=Le({top:u.top,height:u.height},G(),_(),Y,te);we&&Math.abs(d.tStart-L)<1&&Math.abs(d.tEnd-ne)<1||(we=true,L=d.tStart,ne=d.tEnd);}let N=e.style.getPropertyValue("--scroll-draw-progress");function R(u){e.textContent=D(n+(s-n)*u),e.style.setProperty("--scroll-draw-progress",String(u));}function re(){if(!I||O)return;let u=U(G(),L,ne,1),d=p?Math.max(A,S(b=Math.max(b,u))):S(u);h=d,R(d),d>=1&&!v?(v=true,E?.()):d<1&&!p&&(v=false),P=requestAnimationFrame(re);}q();{b=U(G(),L,ne,1);let u=S(b);h=u,R(u);}let Te=new IntersectionObserver(u=>{u.forEach(d=>{I=d.isIntersecting,I&&!O?P=requestAnimationFrame(re):cancelAnimationFrame(P);});}),ce;function H(){clearTimeout(ce),ce=setTimeout(q,150);}window.addEventListener("resize",H),window.addEventListener("orientationchange",H);let $=ke([e],H);Te.observe(e),Ce(e,{type:"counter",getProgress:()=>h,getTrigger:()=>({tStart:L,tEnd:ne})});function k(){O&&(O=false,I&&(P=requestAnimationFrame(re)));}return {destroy(){cancelAnimationFrame(P),Te.disconnect(),window.removeEventListener("resize",H),window.removeEventListener("orientationchange",H),$(),clearTimeout(ce),e.style.setProperty("--scroll-draw-progress",N),Pe(e);},replay(){A=-1,b=0,v=false,h=0,R(0),k();},pause(){O=true,cancelAnimationFrame(P);},resume:k,seek(u){let d=Math.min(1,Math.max(0,u));h=d,A=d,b=0,O=true,cancelAnimationFrame(P),R(d);},getProgress(){return h}}}var on={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Tt(e,r={}){if(typeof window>"u")return on;let t=typeof e=="string"?document.querySelector(e):e;if(!t||t.tagName.toLowerCase()!=="video")return ge("scrollVideo: <video> element not found:",e),on;let n=t,{trigger:s={},easing:i="linear",once:a=false,axis:m="y",preload:p="auto",triggerElement:y,onReady:E,onComplete:D,onProgress:S}=r,Y=y??n,te=window.matchMedia("(prefers-reduced-motion: reduce)").matches,L=typeof i=="function"?i:ee[i]??ee.linear,ne=de(s.start||"top top"),we=de(s.end||"bottom top");n.pause(),n.hasAttribute("preload")||(n.preload=p);let P=r.from??0,I=r.to,O=0,A=0,b=0,h=false,v=false,G=-1,_=0,q=0,N=false,R=false,re=()=>m==="x"?window.scrollX:window.scrollY,Te=()=>m==="x"?window.innerWidth:window.innerHeight;function ce(){let x=Y.getBoundingClientRect(),T=m==="x"?x.left:x.top,ue=m==="x"?x.width:x.height,me=Le({top:T,height:ue},re(),Te(),ne,we);O=me.tStart,A=me.tEnd,R&&A===O&&ge("scrollVideo: zero-length trigger window, so it never scrubs. In a sticky stage, set triggerElement.",n);}let H=NaN;function $(x){if(!R)return;let T=I??n.duration??0,ue=P+(T-P)*x;ue!==H&&(H=ue,n.currentTime=ue),n.style.setProperty("--scroll-draw-progress",String(x)),S?.(x);}function k(){if(!h||v||!R||te)return;let x=U(re(),O,A,1),T=a?Math.max(G,L(_=Math.max(_,x))):L(x);q=T,$(T),T>=1&&!N?(N=true,D?.()):T<1&&!a&&(N=false),b=requestAnimationFrame(k);}function u(){if(R=true,I===void 0&&(I=n.duration),te){$(1),E?.();return}ce(),E?.(),v?$(q):h&&(b=requestAnimationFrame(k));}n.readyState>=1?u():n.addEventListener("loadedmetadata",u,{once:true}),R||ce();let d=te?()=>{}:ut(x=>{x&&(d(),te=true,cancelAnimationFrame(b),$(1));}),X=new IntersectionObserver(x=>{x.forEach(T=>{h=T.isIntersecting,h&&!v&&R?b=requestAnimationFrame(k):cancelAnimationFrame(b);});}),xe;function V(){clearTimeout(xe),xe=setTimeout(ce,150);}window.addEventListener("resize",V),window.addEventListener("orientationchange",V);let K=ke([Y],V);X.observe(n),Ce(n,{type:"video",getProgress:()=>q,getTrigger:()=>({tStart:O,tEnd:A})});function Oe(){v&&(v=false,h&&R&&(b=requestAnimationFrame(k)));}return {destroy(){cancelAnimationFrame(b),X.disconnect(),n.removeEventListener("loadedmetadata",u),window.removeEventListener("resize",V),window.removeEventListener("orientationchange",V),K(),d(),clearTimeout(xe),Pe(n);},replay(){G=-1,_=0,N=false,q=0,H=NaN,$(0),Oe();},pause(){v=true,cancelAnimationFrame(b);},resume:Oe,seek(x){let T=Math.min(1,Math.max(0,x));q=T,G=T,_=0,v=true,cancelAnimationFrame(b),H=NaN,$(T);},getProgress(){return q}}}function sn(e,r){let t=document.createElement("span");t.textContent=r,t.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;user-select:none",e.appendChild(t);}function mt(e=""){let r=document.createElement("span");return r.setAttribute("aria-hidden","true"),r.textContent=e,r}function ln(e){let r=e.textContent??"";return e.textContent="",r.split(/(\s+)/).filter(Boolean).map(t=>{let n=e.appendChild(mt(t)),s=/^\s+$/.test(t);return s?n.style.whiteSpace="pre":n.style.display="inline-block",s?null:n}).filter(t=>t!==null)}function Nn(e){let r=e.textContent??"";e.textContent="";let t=[],n=null;for(let s of r){let i=mt(s),a=s===" ";a?i.style.whiteSpace="pre":(i.style.display="inline-block",t.push(i)),a||s>"\u0DFF"?n=null:n||(n=e.appendChild(mt()),n.style.cssText="display:inline-block;white-space:nowrap"),(n??e).appendChild(i);}return t}function an(e){let r=ln(e),t=new Map;for(let i of r){let a=i.offsetTop;t.has(a)||t.set(a,[]),t.get(a).push(i);}let n=[],s=Array.from(t.keys()).sort((i,a)=>i-a);for(let i of s){let a=t.get(i),m=mt();m.style.display="inline-block",a.forEach((p,y)=>{let E=p.nextElementSibling;m.appendChild(p),y<a.length-1&&E&&E.style.whiteSpace==="pre"&&m.appendChild(E);}),n.push(m);}return e.textContent="",n.forEach((i,a)=>{e.appendChild(i),a<n.length-1&&e.appendChild(document.createTextNode(" "));}),n}function Vn(e,r,t,n){if(t<=1||n===0)return e;n=Math.min(n,1/t);let s=(t-1)*n,i=r*n,a=i+(1-s);return a<=i?e>=i?1:0:Math.min(1,Math.max(0,(e-i)/(a-i)))}function zn(e,r){let t=[];if(r?.y!==void 0&&t.push(`translateY(${r.y*(1-e)}px)`),r?.x!==void 0&&t.push(`translateX(${r.x*(1-e)}px)`),r?.rotate!==void 0&&t.push(`rotate(${r.rotate*(1-e)}deg)`),r?.scale!==void 0){let n=r.scale+(1-r.scale)*e;t.push(`scale(${n})`);}return t.join(" ")}var xt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Mt(e,r={}){if(typeof window>"u")return xt;let t=typeof e=="string"?document.querySelector(e):e;if(!t)return ge("scrollText: element not found:",e),xt;let n=t;return We(r,(s,i)=>_n(n,s,i))}function _n(e,r,t){let{split:n="words",stagger:s=.04,easing:i="ease-out",from:a={opacity:0,y:24},trigger:m={},once:p=true,onComplete:y}=r,E=typeof i=="function"?i:ee[i]??ee["ease-out"],D=de(m.start||"top 85%"),S=de(m.end||"top 40%"),Y=e.innerHTML,te=e.textContent??"",L;n==="chars"?L=Nn(e):n==="lines"?L=an(e):L=ln(e),sn(e,te);let ne=L.length;function we(u,d){a?.opacity!==void 0&&(u.style.opacity=String(a.opacity+(1-a.opacity)*d));let X=zn(d,a);X&&(u.style.transform=X);}function P(u){e.style.setProperty("--scroll-draw-progress",String(u)),L.forEach((d,X)=>{let xe=E(Vn(u,X,ne,s));we(d,xe);});}if(t)return P(1),y?.(),{...xt,destroy:()=>{e.innerHTML=Y;},getProgress:()=>1};P(0);let I=0,O=0,A=0,b=false,h=false,v=-1,G=0,_=false,q=()=>window.scrollY,N=()=>window.innerHeight;function R(){let u=e.getBoundingClientRect(),d=Le({top:u.top,height:u.height},q(),N(),D,S);I=d.tStart,O=d.tEnd;}function re(){if(!b||h)return;let u=U(q(),I,O,1);p&&(v=Math.max(v,u),u=v),G=u,P(u),u>=1&&!_?(_=true,y?.()):u<1&&!p&&(_=false),A=requestAnimationFrame(re);}R();let Te=new IntersectionObserver(u=>{u.forEach(d=>{b=d.isIntersecting,b&&!h?A=requestAnimationFrame(re):cancelAnimationFrame(A);});}),ce;function H(){clearTimeout(ce),ce=setTimeout(()=>{if(n==="lines"){let u=G;e.innerHTML=Y,L=an(e),sn(e,te),P(u);}R();},150);}window.addEventListener("resize",H),window.addEventListener("orientationchange",H);let $=ke([e],H);Te.observe(e),Ce(e,{type:"text",getProgress:()=>G,getTrigger:()=>({tStart:I,tEnd:O})});function k(){h&&(h=false,b&&(A=requestAnimationFrame(re)));}return {destroy(){cancelAnimationFrame(A),Te.disconnect(),window.removeEventListener("resize",H),window.removeEventListener("orientationchange",H),$(),clearTimeout(ce),e.innerHTML=Y,Pe(e);},replay(){v=-1,_=false,G=0,P(0),k();},pause(){h=true,cancelAnimationFrame(A);},resume:k,seek(u){let d=Math.min(1,Math.max(0,u));G=d,v=d,h=true,cancelAnimationFrame(A),P(d);},getProgress(){return G}}}function Ie(e,r){let t,n,s,i;return solidJs.createEffect(()=>{i=typeof e=="function"?e():e;let a=Kt(i);!t||a===s||(s=a,solidJs.untrack(()=>{n?.destroy(),n=r(t,Zt(i,()=>i));}));}),solidJs.onCleanup(()=>{n?.destroy(),n=s=void 0;}),{ref:a=>{t=a;},getInstance:()=>n}}function oo(e={}){return Ie(e,wt).ref}function so(e={}){return Ie(e,wt)}function io(e){return Ie(e,vt).ref}function ao(e){return Ie(e,vt)}function lo(e){return Ie(e,St).ref}function co(e){return Ie(e,St)}function uo(e={}){return Ie(e,Tt).ref}function mo(e={}){return Ie(e,Tt)}function fo(e={}){return Ie(e,Mt).ref}function po(e={}){return Ie(e,Mt)}exports.createScrollAnimate=ao;exports.createScrollCounter=co;exports.createScrollDraw=so;exports.createScrollText=po;exports.createScrollVideo=mo;exports.useScrollAnimate=io;exports.useScrollCounter=lo;exports.useScrollDraw=oo;exports.useScrollText=fo;exports.useScrollVideo=uo;
|
package/dist/solid/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a,b}from'../chunk-XSVTHCLO.mjs';import {a as a$3}from'../chunk-
|
|
1
|
+
import {a,b}from'../chunk-XSVTHCLO.mjs';import {a as a$3}from'../chunk-QFSTKVA3.mjs';import {a as a$4}from'../chunk-NLPSVYFP.mjs';import {a as a$2}from'../chunk-I73SOXBN.mjs';import {a as a$1}from'../chunk-OPXWNJBG.mjs';import {b as b$1}from'../chunk-6TWFLRUB.mjs';import'../chunk-OJFWQ6CU.mjs';import'../chunk-UPWWULKI.mjs';import'../chunk-XC5NR2MU.mjs';import'../chunk-2PYLM3E7.mjs';import'../chunk-A4JCC3QQ.mjs';import'../chunk-DM6EDKWH.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import'../chunk-LFSU6LR3.mjs';import {createEffect,onCleanup,untrack}from'solid-js';function o(e,f){let l,t,c,r;return createEffect(()=>{r=typeof e=="function"?e():e;let n=a(r);!l||n===c||(c=n,untrack(()=>{t?.destroy(),t=f(l,b(r,()=>r));}));}),onCleanup(()=>{t?.destroy(),t=c=void 0;}),{ref:n=>{l=n;},getInstance:()=>t}}function D(e={}){return o(e,b$1).ref}function V(e={}){return o(e,b$1)}function C(e){return o(e,a$1).ref}function H(e){return o(e,a$1)}function L(e){return o(e,a$2).ref}function g(e){return o(e,a$2)}function I(e={}){return o(e,a$3).ref}function k(e={}){return o(e,a$3)}function v(e={}){return o(e,a$4).ref}function j(e={}){return o(e,a$4)}export{H as createScrollAnimate,g as createScrollCounter,V as createScrollDraw,j as createScrollText,k as createScrollVideo,C as useScrollAnimate,L as useScrollCounter,D as useScrollDraw,v as useScrollText,I as useScrollVideo};
|