svg-scroll-draw 2.21.0 → 2.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -15
- package/dist/angular/index.cjs +3 -3
- package/dist/angular/index.d.mts +1 -1
- package/dist/angular/index.d.ts +1 -1
- package/dist/angular/index.mjs +1 -1
- package/dist/aos/index.cjs +2 -2
- package/dist/aos/index.mjs +1 -1
- package/dist/aos/react/index.cjs +2 -2
- package/dist/aos/react/index.mjs +1 -1
- package/dist/astro/index.cjs +3 -3
- package/dist/astro/index.mjs +1 -1
- package/dist/cdn/aos.global.js +2 -2
- package/dist/cdn/scrollreveal.global.js +2 -2
- package/dist/cdn/svg-scroll-draw.dev.global.js +83 -29
- package/dist/cdn/svg-scroll-draw.global.js +3 -3
- package/dist/cdn/vivus.global.js +1 -1
- package/dist/chunk-2PYLM3E7.mjs +1 -0
- package/dist/chunk-DWK6XXY6.mjs +2 -0
- package/dist/chunk-DY5JCXVR.mjs +1 -0
- package/dist/chunk-EAWFBJUR.mjs +2 -0
- package/dist/{chunk-MTEGM4RR.mjs → chunk-GVBO5GRD.mjs} +1 -1
- package/dist/chunk-HX4SP5WN.mjs +3 -0
- package/dist/chunk-JCXMBI4G.mjs +2 -0
- package/dist/chunk-KV3WCPQ5.mjs +1 -0
- package/dist/chunk-LTCJVVSC.mjs +1 -0
- package/dist/{chunk-SMRTRZSD.mjs → chunk-OTDD2ROH.mjs} +1 -1
- package/dist/{chunk-MENZ5DS4.mjs → chunk-VMUJMXKO.mjs} +1 -1
- package/dist/chunk-WXUOF4NM.mjs +1 -0
- package/dist/chunk-YNNA33A5.mjs +2 -0
- package/dist/cinematic/index.cjs +2 -2
- package/dist/cinematic/index.mjs +1 -1
- package/dist/{engine-DQyBzZDl.d.ts → engine-B7UpB4fT.d.ts} +2 -1
- package/dist/{engine-P8u6OK4m.d.mts → engine-o1VSQ1lX.d.mts} +2 -1
- package/dist/group/index.cjs +3 -3
- package/dist/group/index.d.mts +2 -2
- package/dist/group/index.d.ts +2 -2
- package/dist/group/index.mjs +1 -1
- package/dist/horizontal/index.cjs +1 -1
- package/dist/horizontal/index.d.mts +2 -1
- package/dist/horizontal/index.d.ts +2 -1
- package/dist/horizontal/index.mjs +1 -1
- package/dist/{index-CMqK0GCT.d.mts → index-BY-CNE8c.d.mts} +1 -1
- package/dist/{index-DPqPEnO-.d.ts → index-DqXXiDIk.d.ts} +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/nuxt/index.cjs +3 -3
- package/dist/nuxt/index.d.mts +1 -1
- package/dist/nuxt/index.d.ts +1 -1
- package/dist/nuxt/index.mjs +1 -1
- package/dist/react/index.cjs +3 -3
- package/dist/react/index.d.mts +1 -1
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.mjs +1 -1
- package/dist/reveal/index.cjs +1 -1
- package/dist/reveal/index.mjs +1 -1
- package/dist/scrollreveal/index.cjs +2 -2
- package/dist/scrollreveal/index.mjs +1 -1
- package/dist/scrollreveal/react/index.cjs +2 -2
- package/dist/scrollreveal/react/index.mjs +1 -1
- package/dist/snap/index.mjs +1 -1
- package/dist/solid/index.cjs +2 -2
- package/dist/solid/index.d.mts +1 -1
- package/dist/solid/index.d.ts +1 -1
- package/dist/solid/index.mjs +1 -1
- package/dist/svelte/index.cjs +3 -3
- package/dist/svelte/index.d.mts +1 -1
- package/dist/svelte/index.d.ts +1 -1
- 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.mjs +1 -1
- package/dist/video/index.cjs +1 -1
- package/dist/video/index.mjs +1 -1
- package/dist/vivus/index.cjs +2 -2
- package/dist/vivus/index.d.mts +3 -0
- package/dist/vivus/index.d.ts +3 -0
- package/dist/vivus/index.mjs +1 -1
- package/dist/vivus/react/index.cjs +2 -2
- package/dist/vivus/react/index.mjs +1 -1
- package/dist/vue/index.cjs +3 -3
- package/dist/vue/index.d.mts +1 -1
- package/dist/vue/index.d.ts +1 -1
- 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-426RAN5I.mjs +0 -1
- package/dist/chunk-4T5R3ZTL.mjs +0 -2
- package/dist/chunk-7SBTYJGH.mjs +0 -1
- package/dist/chunk-BFX2CSQ3.mjs +0 -1
- package/dist/chunk-ENACACPZ.mjs +0 -3
- package/dist/chunk-KGAJQP2N.mjs +0 -2
- package/dist/chunk-KHQ7OGQK.mjs +0 -1
- package/dist/chunk-OMI46IXL.mjs +0 -2
- package/dist/chunk-WQZKXAXK.mjs +0 -2
package/dist/reveal/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function Xe({bounces:e=3,decay:t=.5}={}){let n=Math.max(1,Math.round(e)),r=Math.max(.01,Math.min(.99,t)),s=Math.sqrt(r),i=0,c=[];for(let l=0;l<n;l++){let p=Math.pow(s,l);c.push(p),i+=p;}let m=[0],u=0;for(let l=0;l<n;l++)u+=c[l]/i,m.push(u);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 Ye({amplitude:e=1,period:t=.4}={}){let n=Math.max(1,e),r=Math.max(.1,t),s=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-s)*(2*Math.PI)/r)+1}var H={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:Xe(),elastic:Ye()};function Ee(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 ve(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 we(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 G(e,t,n,r){return n===t?0:Ee((e-t)/(n-t)*r,0,1)}function ue(e,t,n,r,s){let i=ve(e.top,e.height,t,r.element)-we(r.viewport,n),c=ve(e.top,e.height,t,s.element)-we(s.viewport,n);return {tStart:i,tEnd:c}}function Se(e,t,n){let r=e.getBoundingClientRect(),s=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:s,scroll:0}:{top:n==="x"?r.left:r.top,height:s,scroll:n==="x"?window.scrollX:window.scrollY}}function xe(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 Me(e,t,n){let r=xe(e),s=xe(t);return !r||!s?e:`rgb(${Math.round(r[0]+(s[0]-r[0])*n)},${Math.round(r[1]+(s[1]-r[1])*n)},${Math.round(r[2]+(s[2]-r[2])*n)})`}var je="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",qe="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Re=33;function Ge(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function Ue(e){let t=[];for(let n=0;n<Re;n++){let r=n/(Re-1);t.push(String(Math.round(e(r)*1e5)/1e5));}return `linear(${t.join(",")})`}function Te(e){switch(e){case "linear":return "linear";case "ease-in":return je;case "ease-out":return qe;case "ease-in-out":return Ge()?Ue(H["ease-in-out"]):null;default:return null}}var Le=Symbol.for("svg-scroll-draw.registry");function Pe(){let e=globalThis;return e[Le]||(e[Le]=new Map)}function ce(e,t){Pe().set(e,t);}function le(e){Pe().delete(e);}var Qe=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function U(e,...t){Qe&&console.warn(`[svg-scroll-draw] ${e}`,...t);}var z,Q=new Set,K=new WeakMap,k=new Map,$e=e=>{let t=e.getBoundingClientRect();return t.width+" "+t.height};function Ke(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 Ae(e,t){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let n=()=>t();z??(z=new ResizeObserver(s=>{let i=false;for(let{target:c}of s)K.get(c)!==$e(c)&&(i=true),K.set(c,"");i&&Q.forEach(c=>c());})),Q.add(n);let r=Ke(e);return [document.body,document.documentElement].forEach(s=>s&&r.add(s)),r.forEach(s=>{K.has(s)||K.set(s,$e(s)),k.set(s,(k.get(s)??0)+1),z.observe(s);}),()=>{Q.delete(n)&&(r.forEach(s=>{let i=(k.get(s)??1)-1;if(i)return void k.set(s,i);k.delete(s),z?.unobserve(s);}),Q.size||(z?.disconnect(),z=void 0));}}function Ze(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 s=[],i=[],c=r[2].trim();if(c)for(let m of c.split(/[\s,]+/)){let u=m.match(/^([-+]?[\d.eE]+)(.*)$/);s.push(u?parseFloat(u[1]):0),i.push(u?u[2]:"");}t.push({fn:r[1],nums:s,units:i});}return t}function Je(e,t,n){let r=Ie(e),s=Ie(t);return r.length===0||r.length!==s.length?n<1?e:t:r.map((i,c)=>{let m=s[c];return i.fn!==m.fn||i.nums.length!==m.nums.length?n<1?`${i.fn}(${i.nums.map((u,l)=>`${u}${i.units[l]}`).join(", ")})`:`${m.fn}(${m.nums.map((u,l)=>`${u}${m.units[l]}`).join(", ")})`:`${i.fn}(${i.nums.map((u,l)=>`${u+(m.nums[l]-u)*n}${i.units[l]}`).join(", ")})`}).join(" ")}function _e(e,t,n){if(typeof e=="number"&&typeof t=="number")return String(e+(t-e)*n);let r=String(e),s=String(t);if(Ze(r))return Me(r,s,n);if(r.includes("("))return Je(r,s,n);let i=r.match(/^([-+]?[\d.]+)(.*)$/),c=s.match(/^([-+]?[\d.]+)(.*)$/);if(i&&c){let m=parseFloat(i[1]),u=parseFloat(c[1]);return `${m+(u-m)*n}${i[2]||c[2]}`}return n<1?r:s}function et(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}var tt=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),nt=0,Ce="--scroll-draw-progress";function rt(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function Ne(e,t){let n={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return n;let{props:r,trigger:s={},easing:i="ease-out",speed:c=1,once:m=false,axis:u="y",scrollContainer:l,native:p=true,velocityScale:g=false,respectReducedMotion:T=true,triggerElement:N,onProgress:L,onComplete:P,onEnter:F,onLeave:B,onEnterBack:W,onLeaveBack:$}=t,O=T&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,S=typeof i=="function"?i:H[i]??H["ease-out"],pe=ae(s.start??"top bottom"),fe=ae(s.end??"bottom top"),X=N??e,h=typeof l=="string"?document.querySelector(l):l??null,y=Object.entries(r).map(([o,a])=>({prop:et(o),from:Array.isArray(a)?a[0]:"",to:Array.isArray(a)?a[1]:a}));function Ve(){let o=window.getComputedStyle(e);for(let a of y)a.from===""&&(a.from=o.getPropertyValue(a.prop).trim()||"0");}function De(){for(let o of y)e.style.setProperty(o.prop,String(o.to));}let Z=new Map;for(let o of [...y.map(a=>a.prop),Ce])Z.set(o,e.style.getPropertyValue(o));function J(){for(let[o,a]of Z)a?e.style.setProperty(o,a):e.style.removeProperty(o);}if(O)return De(),P?.(),{...n,destroy:J,getProgress:()=>1};Ve();let de=typeof i=="string"?Te(i):null;function He(){if(!p||!rt()||!de||u!=="y"||h||X!==e||m||c!==1||L||P||F||B||W||$||g!==false||(s.start??"top bottom").trim()!=="top bottom"||(s.end??"bottom top").trim()!=="bottom top")return false;for(let o of y)if(!tt.has(o.prop))return false;return true}function ze(){let o=`ssd-a-${++nt}`,a=y.map(d=>`${d.prop}:${d.from}`).join(";"),_=y.map(d=>`${d.prop}:${d.to}`).join(";"),v=document.createElement("style");v.setAttribute("data-ssd-animate",""),v.textContent=`@keyframes ${o}{from{${a}}to{${_}}}.${o}{animation-name:${o};animation-duration:auto;animation-timing-function:${de};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(v),e.classList.add(o);let f=()=>u==="x"?window.scrollX:window.scrollY,b=()=>u==="x"?window.innerWidth:window.innerHeight,C=()=>{let d=e.getBoundingClientRect();return ue({top:d.top,height:d.height},f(),b(),pe,fe)};ce(e,{type:"animate",getProgress:()=>oe.getProgress(),getTrigger:C});let oe={refresh(){},destroy(){e.classList.remove(o),v.remove(),e.style.animationPlayState="",J(),le(e);},replay(){e.classList.remove(o),e.offsetWidth,e.classList.add(o);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(d){let se=Math.min(1,Math.max(0,d));e.classList.remove(o);for(let ie of y)e.style.setProperty(ie.prop,_e(ie.from,ie.to,se));},getProgress(){let{tStart:d,tEnd:se}=C();return S(G(f(),d,se,c))}};return oe}if(He())return ze();let E=0,w=0,x=0,Y=false,M=false,A=-1,I=0,j=false,R=NaN,ee=-1,ge=0,be=()=>h?u==="x"?h.scrollLeft:h.scrollTop:u==="x"?window.scrollX:window.scrollY,ke=()=>h?u==="x"?h.clientWidth:h.clientHeight:u==="x"?window.innerWidth:window.innerHeight,V=X===e?y:[],he=false;function te(){let o=e.style,a=V.map(b=>o.getPropertyValue(b.prop)),_=o.transition;V.length&&(o.transition="none"),V.forEach(b=>o.setProperty(b.prop,Z.get(b.prop)??""));let v=Se(X,h,u);V.forEach((b,C)=>o.setProperty(b.prop,a[C])),V.length&&(e.offsetWidth,o.transition=_);let f=ue(v,v.scroll,ke(),pe,fe);he&&Math.abs(f.tStart-E)<1&&Math.abs(f.tEnd-w)<1||(he=true,E=f.tStart,w=f.tEnd);}function q(o){e.style.setProperty(Ce,String(o));for(let a of y)e.style.setProperty(a.prop,_e(a.from,a.to,o));L?.(o);}function Be(o){if(isNaN(R)){R=o;return}R<=0&&o>0?F?.():R>0&&o<=0&&$?.(),R<1&&o>=1?B?.():R>=1&&o<1&&W?.(),R=o;}function ne(){if(!Y||M)return;let o=performance.now(),a=be(),_=c;if(g!==false){let b=o-ge,C=b>0?Math.abs(a-(ee<0?a:ee))/b:0;_=c*Math.max(.2,1+C*(typeof g=="number"?g:1)*.04);}ee=a,ge=o;let v=w===E?0:(a-E)/(w-E);Be(v);let f=S(G(a,E,w,_));m&&(A=Math.max(A,f),f=A),I=f,q(f),f>=1&&!j?(j=true,P?.()):f<1&&!m&&(j=false),x=requestAnimationFrame(ne);}te(),w===E&&U("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 o=S(G(be(),E,w,c));m&&o>0&&(A=o),I=o,q(o);}let ye=new IntersectionObserver(o=>{o.forEach(a=>{Y=a.isIntersecting,Y&&!M?x=requestAnimationFrame(ne):cancelAnimationFrame(x);});},{root:h??null}),re;function D(){clearTimeout(re),re=setTimeout(te,150);}window.addEventListener("resize",D),window.addEventListener("orientationchange",D);let We=Ae([X],D);return ye.observe(e),ce(e,{type:"animate",getProgress:()=>I,getTrigger:()=>({tStart:E,tEnd:w})}),{destroy(){cancelAnimationFrame(x),ye.disconnect(),window.removeEventListener("resize",D),window.removeEventListener("orientationchange",D),We(),clearTimeout(re),J(),le(e);},replay(){A=-1,j=false,I=0,M=false,q(0);},pause(){M=true,cancelAnimationFrame(x);},resume(){M&&(M=false,Y&&(x=requestAnimationFrame(ne)));},seek(o){let a=Math.min(1,Math.max(0,o));I=a,A=a,M=true,cancelAnimationFrame(x),q(a);},getProgress(){return I},refresh(){te();}}}var ot={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 st(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 it(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 Fe(e,t){let[n,r]=me(e);return `${n} ${+Math.max(0,r-t).toFixed(3)}%`}function at(e){let t=NaN,n=0,r=0;return e.map(s=>{let i=s.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 Oe={destroy:()=>{}};function At(e,t={}){if(typeof window>"u")return Oe;let n=it(e);if(!n.length)return U("scrollReveal: no elements found:",e),Oe;let{preset:r="fadeUp",from:s,stagger:i=.15,easing:c="ease-out",once:m=true,trigger:u,onEnter:l,onLeave:p}=t,g={...ot[r],...s},T=st(g),N=u?.start??"top 88%",L=u?.end??"top 53%",P=Math.abs(me(N)[1]-me(L)[1]),F=Math.min(Math.max(i,0),1)*P,B=F>0?at(n):n.map(()=>0),W=n.map(($,O)=>{let S=Math.min(B[O]*F,P);return Ne($,{props:T,easing:c,once:m,native:false,trigger:S>0?{start:Fe(N,S),end:Fe(L,S)}:{start:N,end:L},onEnter:O===0?l:void 0,onLeave:O===n.length-1?p:void 0})});return {destroy(){W.forEach($=>$.destroy());}}}exports.scrollReveal=At;
|
|
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;
|
package/dist/reveal/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'../chunk-
|
|
1
|
+
import {a}from'../chunk-LTCJVVSC.mjs';import'../chunk-OJFWQ6CU.mjs';import'../chunk-YWKPTYSG.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};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';Object.defineProperty(exports,'__esModule',{value:true});function
|
|
2
|
-
\u2014 ${t}`).join("")}`,"color: #ea654b;");}var T=()=>[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function oe(e,n){let t=[];for(let o=0;o<4;o++)for(let i=0;i<4;i++){let r=0;for(let s=0;s<4;s++)r+=e[i+4*s]*n[4*o+s];t[i+4*o]=r;}return t}function ie(e){let n=/matrix(3d)?\(([^)]+)\)/.exec(e||"");if(!n)return T();let t=n[2].split(", ").map(parseFloat);if(t.length===16)return t;let o=T();return [o[0],o[1],o[4],o[5],o[12],o[13]]=t,o}function z(e,n){let t=Math.PI/180*n,o=Math.cos(t),i=Math.sin(t),r=T(),[s,a,c,h]=e==="x"?[5,10,6,9]:e==="y"?[0,10,8,2]:[0,5,1,4];return r[s]=r[a]=o,r[c]=i,r[h]=-i,r}function re(e,n){let t=T();return t[e==="X"?12:13]=n,t}function se(e){let n=T();return n[0]=n[5]=e,n}function v(e,n){for(let t of n.split(";")){let o=t.indexOf(":");if(o<1)continue;let i=t.slice(0,o).trim(),r=t.slice(o+1).trim();i&&r&&e.style.setProperty(i,r);}}function ae(e){let{node:n,config:t}=e,o=window.getComputedStyle(n),i=(n.getAttribute("style")||"").match(/[\w-]+\s*:\s*[^;]+\s*/gi)||[],r=i.map(d=>d.trim()),s=`${r.join("; ")};`,a=i.some(d=>/visibility\s?:\s?visible/i.test(d))?s:`${[...r,"visibility: visible"].join("; ")};`,c=parseFloat(o.opacity),h=t.opacity!==null&&!isNaN(parseFloat(String(t.opacity)))?parseFloat(String(t.opacity)):c,b=c!==h?{computed:`opacity: ${c};`,generated:`opacity: ${h};`}:{computed:"",generated:""},u=[];if(parseFloat(t.distance)){let d=t.origin==="top"||t.origin==="bottom"?"Y":"X",f=t.distance;(t.origin==="top"||t.origin==="left")&&(f=f.startsWith("-")?f.slice(1):`-${f}`);let E=f.match(/(^-?\d+\.?\d?)|(em$|px$|%$)/g)||[],m=Number(E[0]),A=E[1],I;if(A==="em")I=parseInt(o.fontSize,10)*m;else if(A==="px")I=m;else if(A==="%"){let Y=n.getBoundingClientRect();I=(d==="Y"?Y.height:Y.width)*m/100;}else throw new RangeError("Unrecognized or missing distance unit.");u.push(re(d,I));}t.rotate.x&&u.push(z("x",t.rotate.x)),t.rotate.y&&u.push(z("y",t.rotate.y)),t.rotate.z&&u.push(z("z",t.rotate.z)),t.scale!==1&&u.push(se(t.scale===0?2e-4:t.scale));let g={initial:"",final:""};if(u.length){let d=ie(o.transform);g={initial:`transform: matrix3d(${u.reduce(oe,d).join(", ")});`,final:`transform: matrix3d(${d.join(", ")});`};}let w={delayed:"",instant:""};if(b.generated||g.initial){let d=m=>`${m/1e3}s`,f=[],E=m=>({delayed:`${m} ${d(t.duration)} ${t.easing} ${d(t.delay)}`,instant:`${m} ${d(t.duration)} ${t.easing} 0s`});o.transition&&!/all 0s|none 0s/.test(o.transition)&&f.push({delayed:o.transition,instant:o.transition}),b.generated&&f.push(E("opacity")),g.initial&&f.push(E("transform")),w={delayed:`transition: ${f.map(m=>m.delayed).join(", ")};`,instant:`transition: ${f.map(m=>m.instant).join(", ")};`};}return {inline:{computed:s,generated:a},opacity:b,position:o.position,transform:g,transition:w}}var x=(...e)=>e.filter(n=>n!=="").join(" "),le=()=>({delay:0,distance:"0",duration:600,easing:"cubic-bezier(0.5, 0, 0, 1)",interval:0,opacity:0,origin:"bottom",rotate:{x:0,y:0,z:0},scale:1,cleanup:false,container:document.documentElement,desktop:true,mobile:true,reset:false,useDelay:"always",viewFactor:0,viewOffset:{top:0,right:0,bottom:0,left:0},afterReset:()=>{},afterReveal:()=>{},beforeReset:()=>{},beforeReveal:()=>{}}),p=null,M=null,l={containers:{},elements:{},history:[],sequences:{}},W=true,j=null,R=0,D=false,ce=0,H=()=>ce++;function U(e,n=false){let t=e,o=n?t.clientHeight:t.offsetHeight,i=n?t.clientWidth:t.offsetWidth,r=0,s=0,a=t;for(;a;)isNaN(a.offsetTop)||(r+=a.offsetTop),isNaN(a.offsetLeft)||(s+=a.offsetLeft),a=a.offsetParent;return {bounds:{top:r,right:s+i,bottom:r+o,left:s},height:o,width:i}}var de=e=>e.node===document.documentElement?{top:window.pageYOffset,left:window.pageXOffset}:{top:e.node.scrollTop,left:e.node.scrollLeft};function ue(e){let n=l.containers[e.containerId];if(!n||!n.geometry||!n.scroll||!e.geometry)return false;let t=Math.max(0,Math.min(1,e.config.viewFactor)),o=e.config.viewOffset,i=e.geometry,r={top:i.bounds.top+i.height*t,right:i.bounds.right-i.width*t,bottom:i.bounds.bottom-i.height*t,left:i.bounds.left+i.width*t},s={top:n.geometry.bounds.top+n.scroll.top+o.top,right:n.geometry.bounds.right+n.scroll.left-o.right,bottom:n.geometry.bounds.bottom+n.scroll.top-o.bottom,left:n.geometry.bounds.left+n.scroll.left+o.left};return r.top<s.bottom&&r.right>s.left&&r.bottom>s.top&&r.left<s.right||e.styles.position==="fixed"}function Q(e,n=false){let t=n?e.config.duration+e.config.delay:e.config.duration,o=0;e.timer&&(o=Date.now()-e.timer.start,clearTimeout(e.timer.clock)),(e.revealed?e.config.beforeReveal:e.config.beforeReset)(e.node),e.timer={start:Date.now(),clock:setTimeout(()=>{(e.revealed?e.config.afterReveal:e.config.afterReset)(e.node),e.timer=null,e.revealed&&!e.config.reset&&e.config.cleanup&&B(e.node);},t-o)};}function fe(e,n){let t=e.styles;e.revealed=e.seen=true,v(e.node,x(t.inline.generated,t.opacity.computed,t.transform.final,n?t.transition.delayed:t.transition.instant)),Q(e,n);}function me(e){let n=e.styles;e.revealed=false,v(e.node,x(n.inline.generated,n.opacity.generated,n.transform.initial,n.transition.instant)),Q(e);}function k(e,n={}){let t=n.pristine||W,o=e.config.useDelay,i=o==="always"||o==="onload"&&t||o==="once"&&!e.seen;if(n.reveal||e.visible&&!e.revealed)return fe(e,i);if(n.reset||!e.visible&&e.revealed&&e.config.reset)return me(e)}function J(e,n){let t=[],o=[],i=[];return e.members.forEach((r,s)=>{l.elements[r]?.[n]&&o.push(s);}),o.length&&e.members.forEach((r,s)=>{let a=l.elements[r];a&&!a[n]&&(s<o[0]?t:i).push(s);}),{head:t,body:o,foot:i}}function O(e,n,t,o){let i=t<0?"head":"foot",r=l.elements[e.members[n+t]];e.blocked[i]=true,setTimeout(()=>{e.blocked[i]=false,r&&Z(r,o);},e.interval);}function Z(e,n=W){if(!e.visible&&e.revealed&&e.config.reset)return k(e,{reset:true});let t=e.sequence&&l.sequences[e.sequence.id];if(!t||!e.sequence)return;let o=e.sequence.index,i=J(t,"visible"),r=J(t,"revealed");if(!r.body.length){let a=i.body[0],c=l.elements[t.members[a]];if(c)return O(t,a,-1,n),O(t,a,1,n),k(c,{reveal:true,pristine:n})}let s=a=>a[a.length-1];if(!t.blocked.head&&o===s(r.head)&&o>=(i.body[0]??1/0))return O(t,o,-1,n),k(e,{reveal:true,pristine:n});if(!t.blocked.foot&&o===r.foot[0]&&o<=(s(i.body)??-1/0))return O(t,o,1,n),k(e,{reveal:true,pristine:n})}function be(){R=0;let e=D;D=false;for(let t of Object.values(l.containers))(e||!t.geometry)&&(t.geometry=U(t.node,true)),t.scroll=de(t);let n=Object.values(l.elements);for(let t of n)(e||!t.geometry)&&(t.geometry=U(t.node)),t.visible=ue(t);for(let t of n)t.sequence?Z(t):k(t);W=false;}function y(e){let n=e?e.type:"init";(n==="init"||n==="resize")&&(D=true),R||(R=requestAnimationFrame(be));}var S=e=>e.node===document.documentElement?window:e.node;function _(){let e=new Set(Array.from(document.querySelectorAll("[data-sr-id]")).map(o=>parseInt(o.getAttribute("data-sr-id")||"",10)));for(let o of Object.values(l.elements))e.has(o.id)||delete l.elements[o.id];let n=new Set,t=new Set;for(let o of Object.values(l.elements))n.add(o.containerId),o.sequence&&t.add(o.sequence.id);for(let o of Object.values(l.containers))n.has(o.id)||(S(o).removeEventListener("scroll",y),S(o).removeEventListener("resize",y),delete l.containers[o.id]);for(let o of Object.values(l.sequences))t.has(o.id)||delete l.sequences[o.id];}function ee(){j=null,_();let e=V();for(let n of Object.values(l.elements)){let t=n.styles;e?(n.visible=n.revealed=n.seen=true,v(n.node,x(t.inline.generated,t.opacity.computed,t.transform.final,"transition: none;"))):n.visible?(n.revealed=true,v(n.node,x(t.inline.generated,t.opacity.computed,t.transform.final))):(n.revealed=false,v(n.node,x(t.inline.generated,t.opacity.generated,t.transform.initial)));}if(!e){for(let n of Object.values(l.containers))S(n).addEventListener("scroll",y),S(n).addEventListener("resize",y);y();}}function te(e,n={},t=false){if(!p)return;let o=[],i=n.interval||0,r,s;try{if(i){let c=Math.abs(i);if(isNaN(c))throw new RangeError("Invalid sequence interval.");r={id:H(),interval:Math.max(c,16),members:[],blocked:{head:!1,foot:!1}};}let a=L(e);if(!a.length)throw new Error("Invalid reveal target.");s=[];for(let c of a){let h=c.getAttribute("data-sr-id"),b=h!==null?l.elements[Number(h)]:void 0,u=b?q({},b):{id:H(),node:c,seen:!1,revealed:!1,visible:!1};b&&v(c,b.styles.inline.computed);let g=q({},b?b.config:p,n);if(!g.mobile&&$()||!g.desktop&&!$()){b&&B(c);continue}let w=L(g.container)[0];if(!w)throw new Error("Invalid container.");if(!w.contains(c))continue;let d=[...o,...Object.values(l.containers)].find(f=>f.node===w)?.id;d===void 0&&(d=H(),o.push({id:d,node:w})),u.config=g,u.containerId=d,u.styles=ae(u),r&&(u.sequence={id:r.id,index:r.members.length},r.members.push(u.id)),s.push(u);}for(let c of s)l.elements[c.id]=c,c.node.setAttribute("data-sr-id",String(c.id));}catch(a){return P("Reveal failed.",a.message)}for(let a of o)l.containers[a.id]=a;r&&(l.sequences[r.id]=r),t||(l.history.push({target:e,options:n}),j&&clearTimeout(j),j=setTimeout(ee,0));}function B(e){let n=false;for(let t of L(e)){let o=t.getAttribute("data-sr-id");if(o===null)continue;n=true;let i=l.elements[Number(o)];i&&(i.timer&&clearTimeout(i.timer.clock),v(i.node,i.styles.inline.generated),delete l.elements[i.id]),t.removeAttribute("data-sr-id");}n&&_();}function ge(){for(let e of Object.values(l.elements))v(e.node,e.styles.inline.generated),e.node.removeAttribute("data-sr-id");for(let e of Object.values(l.containers))S(e).removeEventListener("scroll",y),S(e).removeEventListener("resize",y);R&&cancelAnimationFrame(R),R=0,l={containers:{},elements:{},history:[],sequences:{}};}function pe(){for(let e of l.history)te(e.target,e.options,true);ee();}var N=()=>(G()&&document.documentElement.classList.remove("sr"),{reveal(){},clean(){},destroy(){},sync(){},defaults:{},version:K,noop:true});function ne(){if(!G())return false;let e=document.documentElement.style;return ("transform"in e||"WebkitTransform"in e)&&("transition"in e||"WebkitTransition"in e)}function ve(){document.documentElement.classList.add("sr"),document.body?document.body.style.height="100%":document.addEventListener("DOMContentLoaded",()=>{document.body.style.height="100%";},{once:true});}function ye(e={}){if(!G()||!ne())return N();let n;try{if(n=q({},p??le(),e),!L(n.container)[0])throw new Error("Invalid container.")}catch(t){return P("Invalid configuration.",t.message),N()}return p=n,!p.mobile&&$()||!p.desktop&&!$()?(P("This device is disabled.",`desktop: ${p.desktop}`,`mobile: ${p.mobile}`),N()):(ve(),M||(M={reveal:(t,o)=>te(t,o),clean:B,destroy:ge,sync:pe,get defaults(){return p},version:K,noop:false},Object.defineProperty(M,"delegate",{value:y})),M)}var X=ye;X.isSupported=ne;Object.defineProperty(X,"debug",{get:()=>F,set:e=>{typeof e=="boolean"&&(F=e);}});var Re=X;exports.ScrollReveal=X;exports.default=Re;
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});function F(){return typeof window>"u"||typeof window.matchMedia!="function"?false:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function K(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let n=window.matchMedia("(prefers-reduced-motion: reduce)"),t=i=>e(!!i.matches);if(typeof n.addEventListener=="function")return n.addEventListener("change",t),()=>n.removeEventListener("change",t);let o=n;return o.addListener?.(t),()=>o.removeListener?.(t)}var ee="4.0.9",B=()=>typeof window<"u"&&typeof document<"u",H=e=>e!==null&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]";function q(e,...n){for(let t of n)if(H(t))for(let o of Object.keys(t)){let i=t[o];H(i)?(H(e[o])||(e[o]={}),q(e[o],i)):e[o]=i;}return e}function $(e){if(typeof e=="string")try{return Array.from(document.querySelectorAll(e))}catch{return []}return e instanceof Element?[e]:e&&typeof e.length=="number"?Array.from(e).filter(n=>n instanceof Element):[]}var A=(e=navigator.userAgent)=>/Android|iPhone|iPad|iPod/i.test(e),D=false;function G(e,...n){D&&typeof console<"u"&&console.log(`%cScrollReveal: ${e}${n.map(t=>`
|
|
2
|
+
\u2014 ${t}`).join("")}`,"color: #ea654b;");}var L=()=>[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function se(e,n){let t=[];for(let o=0;o<4;o++)for(let i=0;i<4;i++){let r=0;for(let s=0;s<4;s++)r+=e[i+4*s]*n[4*o+s];t[i+4*o]=r;}return t}function ae(e){let n=/matrix(3d)?\(([^)]+)\)/.exec(e||"");if(!n)return L();let t=n[2].split(", ").map(parseFloat);if(t.length===16)return t;let o=L();return [o[0],o[1],o[4],o[5],o[12],o[13]]=t,o}function N(e,n){let t=Math.PI/180*n,o=Math.cos(t),i=Math.sin(t),r=L(),[s,l,c,R]=e==="x"?[5,10,6,9]:e==="y"?[0,10,8,2]:[0,5,1,4];return r[s]=r[l]=o,r[c]=i,r[R]=-i,r}function le(e,n){let t=L();return t[e==="X"?12:13]=n,t}function ce(e){let n=L();return n[0]=n[5]=e,n}function w(e,n){for(let t of n.split(";")){let o=t.indexOf(":");if(o<1)continue;let i=t.slice(0,o).trim(),r=t.slice(o+1).trim();i&&r&&e.style.setProperty(i,r);}}function de(e){let{node:n,config:t}=e,o=window.getComputedStyle(n),i=(n.getAttribute("style")||"").match(/[\w-]+\s*:\s*[^;]+\s*/gi)||[],r=i.map(d=>d.trim()),s=`${r.join("; ")};`,l=i.some(d=>/visibility\s?:\s?visible/i.test(d))?s:`${[...r,"visibility: visible"].join("; ")};`,c=parseFloat(o.opacity),R=t.opacity!==null&&!isNaN(parseFloat(String(t.opacity)))?parseFloat(String(t.opacity)):c,b=c!==R?{computed:`opacity: ${c};`,generated:`opacity: ${R};`}:{computed:"",generated:""},u=[];if(parseFloat(t.distance)){let d=t.origin==="top"||t.origin==="bottom"?"Y":"X",f=t.distance;(t.origin==="top"||t.origin==="left")&&(f=f.startsWith("-")?f.slice(1):`-${f}`);let M=f.match(/(^-?\d+\.?\d?)|(em$|px$|%$)/g)||[],m=Number(M[0]),z=M[1],T;if(z==="em")T=parseInt(o.fontSize,10)*m;else if(z==="px")T=m;else if(z==="%"){let J=n.getBoundingClientRect();T=(d==="Y"?J.height:J.width)*m/100;}else throw new RangeError("Unrecognized or missing distance unit.");u.push(le(d,T));}t.rotate.x&&u.push(N("x",t.rotate.x)),t.rotate.y&&u.push(N("y",t.rotate.y)),t.rotate.z&&u.push(N("z",t.rotate.z)),t.scale!==1&&u.push(ce(t.scale===0?2e-4:t.scale));let g={initial:"",final:""};if(u.length){let d=ae(o.transform);g={initial:`transform: matrix3d(${u.reduce(se,d).join(", ")});`,final:`transform: matrix3d(${d.join(", ")});`};}let E={delayed:"",instant:""};if(b.generated||g.initial){let d=m=>`${m/1e3}s`,f=[],M=m=>({delayed:`${m} ${d(t.duration)} ${t.easing} ${d(t.delay)}`,instant:`${m} ${d(t.duration)} ${t.easing} 0s`});o.transition&&!/all 0s|none 0s/.test(o.transition)&&f.push({delayed:o.transition,instant:o.transition}),b.generated&&f.push(M("opacity")),g.initial&&f.push(M("transform")),E={delayed:`transition: ${f.map(m=>m.delayed).join(", ")};`,instant:`transition: ${f.map(m=>m.instant).join(", ")};`};}return {inline:{computed:s,generated:l},opacity:b,position:o.position,transform:g,transition:E}}var k=(...e)=>e.filter(n=>n!=="").join(" "),ue=()=>({delay:0,distance:"0",duration:600,easing:"cubic-bezier(0.5, 0, 0, 1)",interval:0,opacity:0,origin:"bottom",rotate:{x:0,y:0,z:0},scale:1,cleanup:false,container:document.documentElement,desktop:true,mobile:true,reset:false,useDelay:"always",viewFactor:0,viewOffset:{top:0,right:0,bottom:0,left:0},afterReset:()=>{},afterReveal:()=>{},beforeReset:()=>{},beforeReveal:()=>{}}),p=null,I=null,a={containers:{},elements:{},history:[],sequences:{}},X=true,j=null,y=0,C=false,S=null,W=false,fe=0,P=()=>fe++;function Z(e,n=false){let t=e,o=n?t.clientHeight:t.offsetHeight,i=n?t.clientWidth:t.offsetWidth,r=0,s=0,l=t;for(;l;)isNaN(l.offsetTop)||(r+=l.offsetTop),isNaN(l.offsetLeft)||(s+=l.offsetLeft),l=l.offsetParent;return {bounds:{top:r,right:s+i,bottom:r+o,left:s},height:o,width:i}}var me=e=>e.node===document.documentElement?{top:window.pageYOffset,left:window.pageXOffset}:{top:e.node.scrollTop,left:e.node.scrollLeft};function be(e){let n=a.containers[e.containerId];if(!n||!n.geometry||!n.scroll||!e.geometry)return false;let t=Math.max(0,Math.min(1,e.config.viewFactor)),o=e.config.viewOffset,i=e.geometry,r={top:i.bounds.top+i.height*t,right:i.bounds.right-i.width*t,bottom:i.bounds.bottom-i.height*t,left:i.bounds.left+i.width*t},s={top:n.geometry.bounds.top+n.scroll.top+o.top,right:n.geometry.bounds.right+n.scroll.left-o.right,bottom:n.geometry.bounds.bottom+n.scroll.top-o.bottom,left:n.geometry.bounds.left+n.scroll.left+o.left};return r.top<s.bottom&&r.right>s.left&&r.bottom>s.top&&r.left<s.right||e.styles.position==="fixed"}function te(e,n=false){let t=n?e.config.duration+e.config.delay:e.config.duration,o=0;e.timer&&(o=Date.now()-e.timer.start,clearTimeout(e.timer.clock)),(e.revealed?e.config.beforeReveal:e.config.beforeReset)(e.node),e.timer={start:Date.now(),clock:setTimeout(()=>{(e.revealed?e.config.afterReveal:e.config.afterReset)(e.node),e.timer=null,e.revealed&&!e.config.reset&&e.config.cleanup&&V(e.node);},t-o)};}function ve(e,n){let t=e.styles;e.revealed=e.seen=true,w(e.node,k(t.inline.generated,t.opacity.computed,t.transform.final,n?t.transition.delayed:t.transition.instant)),te(e,n);}function ge(e){let n=e.styles;e.revealed=false,w(e.node,k(n.inline.generated,n.opacity.generated,n.transform.initial,n.transition.instant)),te(e);}function x(e,n={}){let t=n.pristine||X,o=e.config.useDelay,i=o==="always"||o==="onload"&&t||o==="once"&&!e.seen;if(n.reveal||e.visible&&!e.revealed)return ve(e,i);if(n.reset||!e.visible&&e.revealed&&e.config.reset)return ge(e)}function _(e,n){let t=[],o=[],i=[];return e.members.forEach((r,s)=>{a.elements[r]?.[n]&&o.push(s);}),o.length&&e.members.forEach((r,s)=>{let l=a.elements[r];l&&!l[n]&&(s<o[0]?t:i).push(s);}),{head:t,body:o,foot:i}}function O(e,n,t,o){let i=t<0?"head":"foot",r=a.elements[e.members[n+t]];e.blocked[i]=true,setTimeout(()=>{e.blocked[i]=false,r&&ne(r,o);},e.interval);}function ne(e,n=X){if(!e.visible&&e.revealed&&e.config.reset)return x(e,{reset:true});let t=e.sequence&&a.sequences[e.sequence.id];if(!t||!e.sequence)return;let o=e.sequence.index,i=_(t,"visible"),r=_(t,"revealed");if(!r.body.length){let l=i.body[0],c=a.elements[t.members[l]];if(c)return O(t,l,-1,n),O(t,l,1,n),x(c,{reveal:true,pristine:n})}let s=l=>l[l.length-1];if(!t.blocked.head&&o===s(r.head)&&o>=(i.body[0]??1/0))return O(t,o,-1,n),x(e,{reveal:true,pristine:n});if(!t.blocked.foot&&o===r.foot[0]&&o<=(s(i.body)??-1/0))return O(t,o,1,n),x(e,{reveal:true,pristine:n})}function pe(){y=0;let e=W;W=false;for(let t of Object.values(a.containers))(e||!t.geometry)&&(t.geometry=Z(t.node,true)),t.scroll=me(t);let n=Object.values(a.elements);for(let t of n)(e||!t.geometry)&&(t.geometry=Z(t.node)),t.visible=be(t);for(let t of n)t.sequence?ne(t):x(t);X=false;}function v(e){let n=e?e.type:"init";(n==="init"||n==="resize")&&(W=true),y||(y=requestAnimationFrame(pe));}var h=e=>e.node===document.documentElement?window:e.node;function oe(){let e=new Set(Array.from(document.querySelectorAll("[data-sr-id]")).map(o=>parseInt(o.getAttribute("data-sr-id")||"",10)));for(let o of Object.values(a.elements))e.has(o.id)||delete a.elements[o.id];let n=new Set,t=new Set;for(let o of Object.values(a.elements))n.add(o.containerId),o.sequence&&t.add(o.sequence.id);for(let o of Object.values(a.containers))n.has(o.id)||(h(o).removeEventListener("scroll",v),h(o).removeEventListener("resize",v),delete a.containers[o.id]);for(let o of Object.values(a.sequences))t.has(o.id)||delete a.sequences[o.id];}function Y(){j=null,oe();let e=C||F();for(let n of Object.values(a.elements)){let t=n.styles;e?(n.visible=n.revealed=n.seen=true,w(n.node,k(t.inline.generated,t.opacity.computed,t.transform.final,"transition: none;"))):n.visible?(n.revealed=true,w(n.node,k(t.inline.generated,t.opacity.computed,t.transform.final))):(n.revealed=false,w(n.node,k(t.inline.generated,t.opacity.generated,t.transform.initial)));}if(e){for(let n of Object.values(a.containers))h(n).removeEventListener("scroll",v),h(n).removeEventListener("resize",v);y&&cancelAnimationFrame(y),y=0;return}for(let n of Object.values(a.containers))h(n).addEventListener("scroll",v),h(n).addEventListener("resize",v);v();}function ie(e,n={},t=false){if(!p)return;let o=[],i=n.interval||0,r,s;try{if(i){let c=Math.abs(i);if(isNaN(c))throw new RangeError("Invalid sequence interval.");r={id:P(),interval:Math.max(c,16),members:[],blocked:{head:!1,foot:!1}};}let l=$(e);if(!l.length)throw new Error("Invalid reveal target.");s=[];for(let c of l){let R=c.getAttribute("data-sr-id"),b=R!==null?a.elements[Number(R)]:void 0,u=b?q({},b):{id:P(),node:c,seen:!1,revealed:!1,visible:!1};b&&w(c,b.styles.inline.computed);let g=q({},b?b.config:p,n);if(!g.mobile&&A()||!g.desktop&&!A()){b&&V(c);continue}let E=$(g.container)[0];if(!E)throw new Error("Invalid container.");if(!E.contains(c))continue;let d=[...o,...Object.values(a.containers)].find(f=>f.node===E)?.id;d===void 0&&(d=P(),o.push({id:d,node:E})),u.config=g,u.containerId=d,u.styles=de(u),r&&(u.sequence={id:r.id,index:r.members.length},r.members.push(u.id)),s.push(u);}for(let c of s)a.elements[c.id]=c,c.node.setAttribute("data-sr-id",String(c.id));}catch(l){return G("Reveal failed.",l.message)}for(let l of o)a.containers[l.id]=l;r&&(a.sequences[r.id]=r),t||(a.history.push({target:e,options:n}),j&&clearTimeout(j),j=setTimeout(Y,0));}function V(e){let n=false;for(let t of $(e)){let o=t.getAttribute("data-sr-id");if(o===null)continue;n=true;let i=a.elements[Number(o)];i&&(i.timer&&clearTimeout(i.timer.clock),w(i.node,i.styles.inline.generated),delete a.elements[i.id]),t.removeAttribute("data-sr-id");}n&&oe();}function ye(){for(let e of Object.values(a.elements))w(e.node,e.styles.inline.generated),e.node.removeAttribute("data-sr-id");for(let e of Object.values(a.containers))h(e).removeEventListener("scroll",v),h(e).removeEventListener("resize",v);y&&cancelAnimationFrame(y),y=0,a={containers:{},elements:{},history:[],sequences:{}},S?.(),S=null,C=false;}function he(){for(let e of a.history)ie(e.target,e.options,true);Y();}var Q=()=>(B()&&document.documentElement.classList.remove("sr"),{reveal(){},clean(){},destroy(){},sync(){},defaults:{},version:ee,noop:true});function re(){if(!B())return false;let e=document.documentElement.style;return ("transform"in e||"WebkitTransform"in e)&&("transition"in e||"WebkitTransition"in e)}function we(){document.documentElement.classList.add("sr"),document.body?document.body.style.height="100%":document.addEventListener("DOMContentLoaded",()=>{document.body.style.height="100%";},{once:true});}function Re(e={}){if(!B()||!re())return Q();let n;try{if(n=q({},p??ue(),e),!$(n.container)[0])throw new Error("Invalid container.")}catch(t){return G("Invalid configuration.",t.message),Q()}return p=n,!p.mobile&&A()||!p.desktop&&!A()?(G("This device is disabled.",`desktop: ${p.desktop}`,`mobile: ${p.mobile}`),Q()):(we(),!S&&!C&&!F()&&(S=K(t=>{t&&(S?.(),S=null,C=true,Y());})),I||(I={reveal:(t,o)=>ie(t,o),clean:V,destroy:ye,sync:he,get defaults(){return p},version:ee,noop:false},Object.defineProperty(I,"delegate",{value:v})),I)}var U=Re;U.isSupported=re;Object.defineProperty(U,"debug",{get:()=>D,set:e=>{typeof e=="boolean"&&(D=e);}});var ke=U;exports.ScrollReveal=U;exports.default=ke;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as ScrollReveal,b as default}from'../chunk-
|
|
1
|
+
export{a as ScrollReveal,b as default}from'../chunk-DWK6XXY6.mjs';import'../chunk-AJ22VSHC.mjs';import'../chunk-5PJEKEEP.mjs';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
'use strict';var react=require('react');function
|
|
3
|
-
\u2014 ${t}`).join("")}`,"color: #ea654b;");}var T=()=>[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function ie(e,n){let t=[];for(let o=0;o<4;o++)for(let r=0;r<4;r++){let i=0;for(let s=0;s<4;s++)i+=e[r+4*s]*n[4*o+s];t[r+4*o]=i;}return t}function se(e){let n=/matrix(3d)?\(([^)]+)\)/.exec(e||"");if(!n)return T();let t=n[2].split(", ").map(parseFloat);if(t.length===16)return t;let o=T();return [o[0],o[1],o[4],o[5],o[12],o[13]]=t,o}function z(e,n){let t=Math.PI/180*n,o=Math.cos(t),r=Math.sin(t),i=T(),[s,l,c,h]=e==="x"?[5,10,6,9]:e==="y"?[0,10,8,2]:[0,5,1,4];return i[s]=i[l]=o,i[c]=r,i[h]=-r,i}function le(e,n){let t=T();return t[e==="X"?12:13]=n,t}function ae(e){let n=T();return n[0]=n[5]=e,n}function v(e,n){for(let t of n.split(";")){let o=t.indexOf(":");if(o<1)continue;let r=t.slice(0,o).trim(),i=t.slice(o+1).trim();r&&i&&e.style.setProperty(r,i);}}function ce(e){let{node:n,config:t}=e,o=window.getComputedStyle(n),r=(n.getAttribute("style")||"").match(/[\w-]+\s*:\s*[^;]+\s*/gi)||[],i=r.map(d=>d.trim()),s=`${i.join("; ")};`,l=r.some(d=>/visibility\s?:\s?visible/i.test(d))?s:`${[...i,"visibility: visible"].join("; ")};`,c=parseFloat(o.opacity),h=t.opacity!==null&&!isNaN(parseFloat(String(t.opacity)))?parseFloat(String(t.opacity)):c,b=c!==h?{computed:`opacity: ${c};`,generated:`opacity: ${h};`}:{computed:"",generated:""},u=[];if(parseFloat(t.distance)){let d=t.origin==="top"||t.origin==="bottom"?"Y":"X",f=t.distance;(t.origin==="top"||t.origin==="left")&&(f=f.startsWith("-")?f.slice(1):`-${f}`);let E=f.match(/(^-?\d+\.?\d?)|(em$|px$|%$)/g)||[],m=Number(E[0]),$=E[1],O;if($==="em")O=parseInt(o.fontSize,10)*m;else if($==="px")O=m;else if($==="%"){let Y=n.getBoundingClientRect();O=(d==="Y"?Y.height:Y.width)*m/100;}else throw new RangeError("Unrecognized or missing distance unit.");u.push(le(d,O));}t.rotate.x&&u.push(z("x",t.rotate.x)),t.rotate.y&&u.push(z("y",t.rotate.y)),t.rotate.z&&u.push(z("z",t.rotate.z)),t.scale!==1&&u.push(ae(t.scale===0?2e-4:t.scale));let g={initial:"",final:""};if(u.length){let d=se(o.transform);g={initial:`transform: matrix3d(${u.reduce(ie,d).join(", ")});`,final:`transform: matrix3d(${d.join(", ")});`};}let w={delayed:"",instant:""};if(b.generated||g.initial){let d=m=>`${m/1e3}s`,f=[],E=m=>({delayed:`${m} ${d(t.duration)} ${t.easing} ${d(t.delay)}`,instant:`${m} ${d(t.duration)} ${t.easing} 0s`});o.transition&&!/all 0s|none 0s/.test(o.transition)&&f.push({delayed:o.transition,instant:o.transition}),b.generated&&f.push(E("opacity")),g.initial&&f.push(E("transform")),w={delayed:`transition: ${f.map(m=>m.delayed).join(", ")};`,instant:`transition: ${f.map(m=>m.instant).join(", ")};`};}return {inline:{computed:s,generated:l},opacity:b,position:o.position,transform:g,transition:w}}var k=(...e)=>e.filter(n=>n!=="").join(" "),de=()=>({delay:0,distance:"0",duration:600,easing:"cubic-bezier(0.5, 0, 0, 1)",interval:0,opacity:0,origin:"bottom",rotate:{x:0,y:0,z:0},scale:1,cleanup:false,container:document.documentElement,desktop:true,mobile:true,reset:false,useDelay:"always",viewFactor:0,viewOffset:{top:0,right:0,bottom:0,left:0},afterReset:()=>{},afterReveal:()=>{},beforeReset:()=>{},beforeReveal:()=>{}}),p=null,M=null,a={containers:{},elements:{},history:[],sequences:{}},W=true,j=null,R=0,D=false,ue=0,H=()=>ue++;function V(e,n=false){let t=e,o=n?t.clientHeight:t.offsetHeight,r=n?t.clientWidth:t.offsetWidth,i=0,s=0,l=t;for(;l;)isNaN(l.offsetTop)||(i+=l.offsetTop),isNaN(l.offsetLeft)||(s+=l.offsetLeft),l=l.offsetParent;return {bounds:{top:i,right:s+r,bottom:i+o,left:s},height:o,width:r}}var fe=e=>e.node===document.documentElement?{top:window.pageYOffset,left:window.pageXOffset}:{top:e.node.scrollTop,left:e.node.scrollLeft};function me(e){let n=a.containers[e.containerId];if(!n||!n.geometry||!n.scroll||!e.geometry)return false;let t=Math.max(0,Math.min(1,e.config.viewFactor)),o=e.config.viewOffset,r=e.geometry,i={top:r.bounds.top+r.height*t,right:r.bounds.right-r.width*t,bottom:r.bounds.bottom-r.height*t,left:r.bounds.left+r.width*t},s={top:n.geometry.bounds.top+n.scroll.top+o.top,right:n.geometry.bounds.right+n.scroll.left-o.right,bottom:n.geometry.bounds.bottom+n.scroll.top-o.bottom,left:n.geometry.bounds.left+n.scroll.left+o.left};return i.top<s.bottom&&i.right>s.left&&i.bottom>s.top&&i.left<s.right||e.styles.position==="fixed"}function Q(e,n=false){let t=n?e.config.duration+e.config.delay:e.config.duration,o=0;e.timer&&(o=Date.now()-e.timer.start,clearTimeout(e.timer.clock)),(e.revealed?e.config.beforeReveal:e.config.beforeReset)(e.node),e.timer={start:Date.now(),clock:setTimeout(()=>{(e.revealed?e.config.afterReveal:e.config.afterReset)(e.node),e.timer=null,e.revealed&&!e.config.reset&&e.config.cleanup&&B(e.node);},t-o)};}function be(e,n){let t=e.styles;e.revealed=e.seen=true,v(e.node,k(t.inline.generated,t.opacity.computed,t.transform.final,n?t.transition.delayed:t.transition.instant)),Q(e,n);}function ge(e){let n=e.styles;e.revealed=false,v(e.node,k(n.inline.generated,n.opacity.generated,n.transform.initial,n.transition.instant)),Q(e);}function x(e,n={}){let t=n.pristine||W,o=e.config.useDelay,r=o==="always"||o==="onload"&&t||o==="once"&&!e.seen;if(n.reveal||e.visible&&!e.revealed)return be(e,r);if(n.reset||!e.visible&&e.revealed&&e.config.reset)return ge(e)}function J(e,n){let t=[],o=[],r=[];return e.members.forEach((i,s)=>{a.elements[i]?.[n]&&o.push(s);}),o.length&&e.members.forEach((i,s)=>{let l=a.elements[i];l&&!l[n]&&(s<o[0]?t:r).push(s);}),{head:t,body:o,foot:r}}function I(e,n,t,o){let r=t<0?"head":"foot",i=a.elements[e.members[n+t]];e.blocked[r]=true,setTimeout(()=>{e.blocked[r]=false,i&&Z(i,o);},e.interval);}function Z(e,n=W){if(!e.visible&&e.revealed&&e.config.reset)return x(e,{reset:true});let t=e.sequence&&a.sequences[e.sequence.id];if(!t||!e.sequence)return;let o=e.sequence.index,r=J(t,"visible"),i=J(t,"revealed");if(!i.body.length){let l=r.body[0],c=a.elements[t.members[l]];if(c)return I(t,l,-1,n),I(t,l,1,n),x(c,{reveal:true,pristine:n})}let s=l=>l[l.length-1];if(!t.blocked.head&&o===s(i.head)&&o>=(r.body[0]??1/0))return I(t,o,-1,n),x(e,{reveal:true,pristine:n});if(!t.blocked.foot&&o===i.foot[0]&&o<=(s(r.body)??-1/0))return I(t,o,1,n),x(e,{reveal:true,pristine:n})}function pe(){R=0;let e=D;D=false;for(let t of Object.values(a.containers))(e||!t.geometry)&&(t.geometry=V(t.node,true)),t.scroll=fe(t);let n=Object.values(a.elements);for(let t of n)(e||!t.geometry)&&(t.geometry=V(t.node)),t.visible=me(t);for(let t of n)t.sequence?Z(t):x(t);W=false;}function y(e){let n=e?e.type:"init";(n==="init"||n==="resize")&&(D=true),R||(R=requestAnimationFrame(pe));}var S=e=>e.node===document.documentElement?window:e.node;function _(){let e=new Set(Array.from(document.querySelectorAll("[data-sr-id]")).map(o=>parseInt(o.getAttribute("data-sr-id")||"",10)));for(let o of Object.values(a.elements))e.has(o.id)||delete a.elements[o.id];let n=new Set,t=new Set;for(let o of Object.values(a.elements))n.add(o.containerId),o.sequence&&t.add(o.sequence.id);for(let o of Object.values(a.containers))n.has(o.id)||(S(o).removeEventListener("scroll",y),S(o).removeEventListener("resize",y),delete a.containers[o.id]);for(let o of Object.values(a.sequences))t.has(o.id)||delete a.sequences[o.id];}function ee(){j=null,_();let e=U();for(let n of Object.values(a.elements)){let t=n.styles;e?(n.visible=n.revealed=n.seen=true,v(n.node,k(t.inline.generated,t.opacity.computed,t.transform.final,"transition: none;"))):n.visible?(n.revealed=true,v(n.node,k(t.inline.generated,t.opacity.computed,t.transform.final))):(n.revealed=false,v(n.node,k(t.inline.generated,t.opacity.generated,t.transform.initial)));}if(!e){for(let n of Object.values(a.containers))S(n).addEventListener("scroll",y),S(n).addEventListener("resize",y);y();}}function te(e,n={},t=false){if(!p)return;let o=[],r=n.interval||0,i,s;try{if(r){let c=Math.abs(r);if(isNaN(c))throw new RangeError("Invalid sequence interval.");i={id:H(),interval:Math.max(c,16),members:[],blocked:{head:!1,foot:!1}};}let l=L(e);if(!l.length)throw new Error("Invalid reveal target.");s=[];for(let c of l){let h=c.getAttribute("data-sr-id"),b=h!==null?a.elements[Number(h)]:void 0,u=b?q({},b):{id:H(),node:c,seen:!1,revealed:!1,visible:!1};b&&v(c,b.styles.inline.computed);let g=q({},b?b.config:p,n);if(!g.mobile&&A()||!g.desktop&&!A()){b&&B(c);continue}let w=L(g.container)[0];if(!w)throw new Error("Invalid container.");if(!w.contains(c))continue;let d=[...o,...Object.values(a.containers)].find(f=>f.node===w)?.id;d===void 0&&(d=H(),o.push({id:d,node:w})),u.config=g,u.containerId=d,u.styles=ce(u),i&&(u.sequence={id:i.id,index:i.members.length},i.members.push(u.id)),s.push(u);}for(let c of s)a.elements[c.id]=c,c.node.setAttribute("data-sr-id",String(c.id));}catch(l){return P("Reveal failed.",l.message)}for(let l of o)a.containers[l.id]=l;i&&(a.sequences[i.id]=i),t||(a.history.push({target:e,options:n}),j&&clearTimeout(j),j=setTimeout(ee,0));}function B(e){let n=false;for(let t of L(e)){let o=t.getAttribute("data-sr-id");if(o===null)continue;n=true;let r=a.elements[Number(o)];r&&(r.timer&&clearTimeout(r.timer.clock),v(r.node,r.styles.inline.generated),delete a.elements[r.id]),t.removeAttribute("data-sr-id");}n&&_();}function ve(){for(let e of Object.values(a.elements))v(e.node,e.styles.inline.generated),e.node.removeAttribute("data-sr-id");for(let e of Object.values(a.containers))S(e).removeEventListener("scroll",y),S(e).removeEventListener("resize",y);R&&cancelAnimationFrame(R),R=0,a={containers:{},elements:{},history:[],sequences:{}};}function ye(){for(let e of a.history)te(e.target,e.options,true);ee();}var N=()=>(G()&&document.documentElement.classList.remove("sr"),{reveal(){},clean(){},destroy(){},sync(){},defaults:{},version:K,noop:true});function ne(){if(!G())return false;let e=document.documentElement.style;return ("transform"in e||"WebkitTransform"in e)&&("transition"in e||"WebkitTransition"in e)}function he(){document.documentElement.classList.add("sr"),document.body?document.body.style.height="100%":document.addEventListener("DOMContentLoaded",()=>{document.body.style.height="100%";},{once:true});}function we(e={}){if(!G()||!ne())return N();let n;try{if(n=q({},p??de(),e),!L(n.container)[0])throw new Error("Invalid container.")}catch(t){return P("Invalid configuration.",t.message),N()}return p=n,!p.mobile&&A()||!p.desktop&&!A()?(P("This device is disabled.",`desktop: ${p.desktop}`,`mobile: ${p.mobile}`),N()):(he(),M||(M={reveal:(t,o)=>te(t,o),clean:B,destroy:ve,sync:ye,get defaults(){return p},version:K,noop:false},Object.defineProperty(M,"delegate",{value:y})),M)}var X=we;X.isSupported=ne;Object.defineProperty(X,"debug",{get:()=>F,set:e=>{typeof e=="boolean"&&(F=e);}});var oe=X;function Oe(e={}){let n=react.useRef(null),t=react.useRef(e);return t.current=e,react.useEffect(()=>{let o=n.current;if(!o)return;let{selector:r,...i}=t.current,s=r?Array.from(o.querySelectorAll(r)):o,l=oe();return l.reveal(s,i),()=>l.clean(s)},[]),n}exports.useScrollReveal=Oe;
|
|
2
|
+
'use strict';var react=require('react');function H(){return typeof window>"u"||typeof window.matchMedia!="function"?false:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function K(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let n=window.matchMedia("(prefers-reduced-motion: reduce)"),t=i=>e(!!i.matches);if(typeof n.addEventListener=="function")return n.addEventListener("change",t),()=>n.removeEventListener("change",t);let o=n;return o.addListener?.(t),()=>o.removeListener?.(t)}var ee="4.0.9",B=()=>typeof window<"u"&&typeof document<"u",F=e=>e!==null&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]";function q(e,...n){for(let t of n)if(F(t))for(let o of Object.keys(t)){let i=t[o];F(i)?(F(e[o])||(e[o]={}),q(e[o],i)):e[o]=i;}return e}function A(e){if(typeof e=="string")try{return Array.from(document.querySelectorAll(e))}catch{return []}return e instanceof Element?[e]:e&&typeof e.length=="number"?Array.from(e).filter(n=>n instanceof Element):[]}var $=(e=navigator.userAgent)=>/Android|iPhone|iPad|iPod/i.test(e),D=false;function G(e,...n){D&&typeof console<"u"&&console.log(`%cScrollReveal: ${e}${n.map(t=>`
|
|
3
|
+
\u2014 ${t}`).join("")}`,"color: #ea654b;");}var L=()=>[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function le(e,n){let t=[];for(let o=0;o<4;o++)for(let i=0;i<4;i++){let r=0;for(let s=0;s<4;s++)r+=e[i+4*s]*n[4*o+s];t[i+4*o]=r;}return t}function ce(e){let n=/matrix(3d)?\(([^)]+)\)/.exec(e||"");if(!n)return L();let t=n[2].split(", ").map(parseFloat);if(t.length===16)return t;let o=L();return [o[0],o[1],o[4],o[5],o[12],o[13]]=t,o}function N(e,n){let t=Math.PI/180*n,o=Math.cos(t),i=Math.sin(t),r=L(),[s,a,c,R]=e==="x"?[5,10,6,9]:e==="y"?[0,10,8,2]:[0,5,1,4];return r[s]=r[a]=o,r[c]=i,r[R]=-i,r}function de(e,n){let t=L();return t[e==="X"?12:13]=n,t}function ue(e){let n=L();return n[0]=n[5]=e,n}function w(e,n){for(let t of n.split(";")){let o=t.indexOf(":");if(o<1)continue;let i=t.slice(0,o).trim(),r=t.slice(o+1).trim();i&&r&&e.style.setProperty(i,r);}}function fe(e){let{node:n,config:t}=e,o=window.getComputedStyle(n),i=(n.getAttribute("style")||"").match(/[\w-]+\s*:\s*[^;]+\s*/gi)||[],r=i.map(d=>d.trim()),s=`${r.join("; ")};`,a=i.some(d=>/visibility\s?:\s?visible/i.test(d))?s:`${[...r,"visibility: visible"].join("; ")};`,c=parseFloat(o.opacity),R=t.opacity!==null&&!isNaN(parseFloat(String(t.opacity)))?parseFloat(String(t.opacity)):c,b=c!==R?{computed:`opacity: ${c};`,generated:`opacity: ${R};`}:{computed:"",generated:""},u=[];if(parseFloat(t.distance)){let d=t.origin==="top"||t.origin==="bottom"?"Y":"X",f=t.distance;(t.origin==="top"||t.origin==="left")&&(f=f.startsWith("-")?f.slice(1):`-${f}`);let x=f.match(/(^-?\d+\.?\d?)|(em$|px$|%$)/g)||[],m=Number(x[0]),z=x[1],T;if(z==="em")T=parseInt(o.fontSize,10)*m;else if(z==="px")T=m;else if(z==="%"){let J=n.getBoundingClientRect();T=(d==="Y"?J.height:J.width)*m/100;}else throw new RangeError("Unrecognized or missing distance unit.");u.push(de(d,T));}t.rotate.x&&u.push(N("x",t.rotate.x)),t.rotate.y&&u.push(N("y",t.rotate.y)),t.rotate.z&&u.push(N("z",t.rotate.z)),t.scale!==1&&u.push(ue(t.scale===0?2e-4:t.scale));let p={initial:"",final:""};if(u.length){let d=ce(o.transform);p={initial:`transform: matrix3d(${u.reduce(le,d).join(", ")});`,final:`transform: matrix3d(${d.join(", ")});`};}let E={delayed:"",instant:""};if(b.generated||p.initial){let d=m=>`${m/1e3}s`,f=[],x=m=>({delayed:`${m} ${d(t.duration)} ${t.easing} ${d(t.delay)}`,instant:`${m} ${d(t.duration)} ${t.easing} 0s`});o.transition&&!/all 0s|none 0s/.test(o.transition)&&f.push({delayed:o.transition,instant:o.transition}),b.generated&&f.push(x("opacity")),p.initial&&f.push(x("transform")),E={delayed:`transition: ${f.map(m=>m.delayed).join(", ")};`,instant:`transition: ${f.map(m=>m.instant).join(", ")};`};}return {inline:{computed:s,generated:a},opacity:b,position:o.position,transform:p,transition:E}}var k=(...e)=>e.filter(n=>n!=="").join(" "),me=()=>({delay:0,distance:"0",duration:600,easing:"cubic-bezier(0.5, 0, 0, 1)",interval:0,opacity:0,origin:"bottom",rotate:{x:0,y:0,z:0},scale:1,cleanup:false,container:document.documentElement,desktop:true,mobile:true,reset:false,useDelay:"always",viewFactor:0,viewOffset:{top:0,right:0,bottom:0,left:0},afterReset:()=>{},afterReveal:()=>{},beforeReset:()=>{},beforeReveal:()=>{}}),g=null,O=null,l={containers:{},elements:{},history:[],sequences:{}},X=true,j=null,y=0,C=false,S=null,W=false,be=0,P=()=>be++;function Z(e,n=false){let t=e,o=n?t.clientHeight:t.offsetHeight,i=n?t.clientWidth:t.offsetWidth,r=0,s=0,a=t;for(;a;)isNaN(a.offsetTop)||(r+=a.offsetTop),isNaN(a.offsetLeft)||(s+=a.offsetLeft),a=a.offsetParent;return {bounds:{top:r,right:s+i,bottom:r+o,left:s},height:o,width:i}}var ve=e=>e.node===document.documentElement?{top:window.pageYOffset,left:window.pageXOffset}:{top:e.node.scrollTop,left:e.node.scrollLeft};function pe(e){let n=l.containers[e.containerId];if(!n||!n.geometry||!n.scroll||!e.geometry)return false;let t=Math.max(0,Math.min(1,e.config.viewFactor)),o=e.config.viewOffset,i=e.geometry,r={top:i.bounds.top+i.height*t,right:i.bounds.right-i.width*t,bottom:i.bounds.bottom-i.height*t,left:i.bounds.left+i.width*t},s={top:n.geometry.bounds.top+n.scroll.top+o.top,right:n.geometry.bounds.right+n.scroll.left-o.right,bottom:n.geometry.bounds.bottom+n.scroll.top-o.bottom,left:n.geometry.bounds.left+n.scroll.left+o.left};return r.top<s.bottom&&r.right>s.left&&r.bottom>s.top&&r.left<s.right||e.styles.position==="fixed"}function te(e,n=false){let t=n?e.config.duration+e.config.delay:e.config.duration,o=0;e.timer&&(o=Date.now()-e.timer.start,clearTimeout(e.timer.clock)),(e.revealed?e.config.beforeReveal:e.config.beforeReset)(e.node),e.timer={start:Date.now(),clock:setTimeout(()=>{(e.revealed?e.config.afterReveal:e.config.afterReset)(e.node),e.timer=null,e.revealed&&!e.config.reset&&e.config.cleanup&&U(e.node);},t-o)};}function ge(e,n){let t=e.styles;e.revealed=e.seen=true,w(e.node,k(t.inline.generated,t.opacity.computed,t.transform.final,n?t.transition.delayed:t.transition.instant)),te(e,n);}function ye(e){let n=e.styles;e.revealed=false,w(e.node,k(n.inline.generated,n.opacity.generated,n.transform.initial,n.transition.instant)),te(e);}function M(e,n={}){let t=n.pristine||X,o=e.config.useDelay,i=o==="always"||o==="onload"&&t||o==="once"&&!e.seen;if(n.reveal||e.visible&&!e.revealed)return ge(e,i);if(n.reset||!e.visible&&e.revealed&&e.config.reset)return ye(e)}function _(e,n){let t=[],o=[],i=[];return e.members.forEach((r,s)=>{l.elements[r]?.[n]&&o.push(s);}),o.length&&e.members.forEach((r,s)=>{let a=l.elements[r];a&&!a[n]&&(s<o[0]?t:i).push(s);}),{head:t,body:o,foot:i}}function I(e,n,t,o){let i=t<0?"head":"foot",r=l.elements[e.members[n+t]];e.blocked[i]=true,setTimeout(()=>{e.blocked[i]=false,r&&ne(r,o);},e.interval);}function ne(e,n=X){if(!e.visible&&e.revealed&&e.config.reset)return M(e,{reset:true});let t=e.sequence&&l.sequences[e.sequence.id];if(!t||!e.sequence)return;let o=e.sequence.index,i=_(t,"visible"),r=_(t,"revealed");if(!r.body.length){let a=i.body[0],c=l.elements[t.members[a]];if(c)return I(t,a,-1,n),I(t,a,1,n),M(c,{reveal:true,pristine:n})}let s=a=>a[a.length-1];if(!t.blocked.head&&o===s(r.head)&&o>=(i.body[0]??1/0))return I(t,o,-1,n),M(e,{reveal:true,pristine:n});if(!t.blocked.foot&&o===r.foot[0]&&o<=(s(i.body)??-1/0))return I(t,o,1,n),M(e,{reveal:true,pristine:n})}function he(){y=0;let e=W;W=false;for(let t of Object.values(l.containers))(e||!t.geometry)&&(t.geometry=Z(t.node,true)),t.scroll=ve(t);let n=Object.values(l.elements);for(let t of n)(e||!t.geometry)&&(t.geometry=Z(t.node)),t.visible=pe(t);for(let t of n)t.sequence?ne(t):M(t);X=false;}function v(e){let n=e?e.type:"init";(n==="init"||n==="resize")&&(W=true),y||(y=requestAnimationFrame(he));}var h=e=>e.node===document.documentElement?window:e.node;function oe(){let e=new Set(Array.from(document.querySelectorAll("[data-sr-id]")).map(o=>parseInt(o.getAttribute("data-sr-id")||"",10)));for(let o of Object.values(l.elements))e.has(o.id)||delete l.elements[o.id];let n=new Set,t=new Set;for(let o of Object.values(l.elements))n.add(o.containerId),o.sequence&&t.add(o.sequence.id);for(let o of Object.values(l.containers))n.has(o.id)||(h(o).removeEventListener("scroll",v),h(o).removeEventListener("resize",v),delete l.containers[o.id]);for(let o of Object.values(l.sequences))t.has(o.id)||delete l.sequences[o.id];}function Y(){j=null,oe();let e=C||H();for(let n of Object.values(l.elements)){let t=n.styles;e?(n.visible=n.revealed=n.seen=true,w(n.node,k(t.inline.generated,t.opacity.computed,t.transform.final,"transition: none;"))):n.visible?(n.revealed=true,w(n.node,k(t.inline.generated,t.opacity.computed,t.transform.final))):(n.revealed=false,w(n.node,k(t.inline.generated,t.opacity.generated,t.transform.initial)));}if(e){for(let n of Object.values(l.containers))h(n).removeEventListener("scroll",v),h(n).removeEventListener("resize",v);y&&cancelAnimationFrame(y),y=0;return}for(let n of Object.values(l.containers))h(n).addEventListener("scroll",v),h(n).addEventListener("resize",v);v();}function ie(e,n={},t=false){if(!g)return;let o=[],i=n.interval||0,r,s;try{if(i){let c=Math.abs(i);if(isNaN(c))throw new RangeError("Invalid sequence interval.");r={id:P(),interval:Math.max(c,16),members:[],blocked:{head:!1,foot:!1}};}let a=A(e);if(!a.length)throw new Error("Invalid reveal target.");s=[];for(let c of a){let R=c.getAttribute("data-sr-id"),b=R!==null?l.elements[Number(R)]:void 0,u=b?q({},b):{id:P(),node:c,seen:!1,revealed:!1,visible:!1};b&&w(c,b.styles.inline.computed);let p=q({},b?b.config:g,n);if(!p.mobile&&$()||!p.desktop&&!$()){b&&U(c);continue}let E=A(p.container)[0];if(!E)throw new Error("Invalid container.");if(!E.contains(c))continue;let d=[...o,...Object.values(l.containers)].find(f=>f.node===E)?.id;d===void 0&&(d=P(),o.push({id:d,node:E})),u.config=p,u.containerId=d,u.styles=fe(u),r&&(u.sequence={id:r.id,index:r.members.length},r.members.push(u.id)),s.push(u);}for(let c of s)l.elements[c.id]=c,c.node.setAttribute("data-sr-id",String(c.id));}catch(a){return G("Reveal failed.",a.message)}for(let a of o)l.containers[a.id]=a;r&&(l.sequences[r.id]=r),t||(l.history.push({target:e,options:n}),j&&clearTimeout(j),j=setTimeout(Y,0));}function U(e){let n=false;for(let t of A(e)){let o=t.getAttribute("data-sr-id");if(o===null)continue;n=true;let i=l.elements[Number(o)];i&&(i.timer&&clearTimeout(i.timer.clock),w(i.node,i.styles.inline.generated),delete l.elements[i.id]),t.removeAttribute("data-sr-id");}n&&oe();}function we(){for(let e of Object.values(l.elements))w(e.node,e.styles.inline.generated),e.node.removeAttribute("data-sr-id");for(let e of Object.values(l.containers))h(e).removeEventListener("scroll",v),h(e).removeEventListener("resize",v);y&&cancelAnimationFrame(y),y=0,l={containers:{},elements:{},history:[],sequences:{}},S?.(),S=null,C=false;}function Re(){for(let e of l.history)ie(e.target,e.options,true);Y();}var Q=()=>(B()&&document.documentElement.classList.remove("sr"),{reveal(){},clean(){},destroy(){},sync(){},defaults:{},version:ee,noop:true});function re(){if(!B())return false;let e=document.documentElement.style;return ("transform"in e||"WebkitTransform"in e)&&("transition"in e||"WebkitTransition"in e)}function Ee(){document.documentElement.classList.add("sr"),document.body?document.body.style.height="100%":document.addEventListener("DOMContentLoaded",()=>{document.body.style.height="100%";},{once:true});}function Se(e={}){if(!B()||!re())return Q();let n;try{if(n=q({},g??me(),e),!A(n.container)[0])throw new Error("Invalid container.")}catch(t){return G("Invalid configuration.",t.message),Q()}return g=n,!g.mobile&&$()||!g.desktop&&!$()?(G("This device is disabled.",`desktop: ${g.desktop}`,`mobile: ${g.mobile}`),Q()):(Ee(),!S&&!C&&!H()&&(S=K(t=>{t&&(S?.(),S=null,C=true,Y());})),O||(O={reveal:(t,o)=>ie(t,o),clean:U,destroy:we,sync:Re,get defaults(){return g},version:ee,noop:false},Object.defineProperty(O,"delegate",{value:v})),O)}var V=Se;V.isSupported=re;Object.defineProperty(V,"debug",{get:()=>D,set:e=>{typeof e=="boolean"&&(D=e);}});var se=V;function qe(e={}){let n=react.useRef(null),t=react.useRef(e);return t.current=e,react.useEffect(()=>{let o=n.current;if(!o)return;let{selector:i,...r}=t.current,s=i?Array.from(o.querySelectorAll(i)):o,a=se();return a.reveal(s,r),()=>a.clean(s)},[]),n}exports.useScrollReveal=qe;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {b}from'../../chunk-
|
|
2
|
+
import {b}from'../../chunk-DWK6XXY6.mjs';import'../../chunk-AJ22VSHC.mjs';import'../../chunk-5PJEKEEP.mjs';import {useRef,useEffect}from'react';function m(t={}){let r=useRef(null),l=useRef(t);return l.current=t,useEffect(()=>{let e=r.current;if(!e)return;let{selector:n,...f}=l.current,o=n?Array.from(e.querySelectorAll(n)):e,c=b();return c.reveal(o,f),()=>c.clean(o)},[]),r}export{m as useScrollReveal};
|
package/dist/snap/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a
|
|
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 O={destroy:()=>{},snapTo:()=>{},getCurrentIndex:()=>0};function G(s){return typeof s=="string"?Array.from(document.querySelectorAll(s)):s instanceof NodeList?Array.from(s):s}function Q(s,q={}){if(typeof window>"u")return O;let r=G(s);if(!r.length)return b("scrollSnap: no sections found"),O;let{direction:z="vertical",duration:B=600,easing:m="ease-in-out",threshold:b$2=.3,scrollContainer:d$1,onSnap:p,respectReducedMotion:y=true}=q,E=y&&a(),P=y?a$1(e=>{E=e;}):()=>{},X=typeof m=="function"?m:d[m]??d["ease-in-out"],i=z==="horizontal",o=typeof d$1=="string"?document.querySelector(d$1):d$1??null,n=0,l=false,f=0;function L(){return o?i?o.scrollLeft:o.scrollTop:i?window.scrollX:window.scrollY}function M(e){o?i?o.scrollLeft=e:o.scrollTop=e:window.scrollTo(i?{left:e}:{top:e});}function g(){return r.map(e=>{let t=e.getBoundingClientRect();if(o){let c=o.getBoundingClientRect();return i?t.left-c.left+o.scrollLeft:t.top-c.top+o.scrollTop}return i?t.left+window.scrollX:t.top+window.scrollY})}function u(e){let t=a$3(e,0,r.length-1);l&&(cancelAnimationFrame(f),l=false),l=true;let c=g(),a=L(),T=c[t];if(Math.abs(a-T)<1){l=false,n=t,p?.(t);return}if(E){M(T),l=false,n=t,p?.(t);return}let Y=performance.now();function I(_){let A=a$3((_-Y)/B,0,1);M(a+(T-a)*X(A)),A<1?f=requestAnimationFrame(I):(l=false,n=t,p?.(t));}f=requestAnimationFrame(I);}let S;function v(){l||(clearTimeout(S),S=setTimeout(()=>{let e=L(),t=g();if(Math.abs(e-t[n])<1)return;let c=i?r[n].offsetWidth:r[n].offsetHeight,a=e-t[n];a>c*b$2&&n<r.length-1?u(n+1):a<-(c*b$2)&&n>0?u(n-1):u(n);},100));}let x=o??window;return x.addEventListener("scroll",v,{passive:true}),a$2(r[0],{type:"snap",getProgress:()=>n/(r.length-1||1),getTrigger:()=>{let e=g();return {tStart:e[0],tEnd:e[e.length-1]}}}),{destroy(){cancelAnimationFrame(f),clearTimeout(S),x.removeEventListener("scroll",v),P(),b$1(r[0]);},snapTo:u,getCurrentIndex(){return n}}}export{Q as scrollSnap};
|
package/dist/solid/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
'use strict';var solidJs=require('solid-js');function
|
|
1
|
+
'use strict';var solidJs=require('solid-js');function mn({bounces:e=3,decay:r=.5}={}){let t=Math.max(1,Math.round(e)),n=Math.max(.01,Math.min(.99,r)),s=Math.sqrt(n),i=0,a=[];for(let d=0;d<t;d++){let x=Math.pow(s,d);a.push(x),i+=x;}let m=[0],f=0;for(let d=0;d<t;d++)f+=a[d]/i,m.push(f);return d=>{if(d<=0)return 0;if(d>=1)return 1;for(let x=0;x<t;x++)if(d<=m[x+1]){let R=(d-m[x])/(m[x+1]-m[x]);if(x===0)return R*(2-R);let C=1-Math.pow(n,x);return C+(1-C)*(2*R-1)*(2*R-1)}return 1}}function fn({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 oe={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:mn(),elastic:fn()};function Ot(e,r,t){return Math.min(t,Math.max(r,e))}function ye(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 It(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 Dt(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 ee(e,r,t,n){return t===r?0:Ot((e-r)/(t-r)*n,0,1)}function Le(e,r,t,n,s){let i=It(e.top,e.height,r,n.element)-Dt(n.viewport,t),a=It(e.top,e.height,r,s.element)-Dt(s.viewport,t);return {tStart:i,tEnd:a}}function st(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.scrollLeft:n.top-r.getBoundingClientRect().top+r.scrollTop,height:s,scroll:0}:{top:t==="x"?n.left:n.top,height:s,scroll:t==="x"?window.scrollX:window.scrollY}}function Qe(e){let r=e.tagName.toLowerCase();if(r==="rect"){let t=parseFloat(e.getAttribute("width")??"0"),n=parseFloat(e.getAttribute("height")??"0");return 2*(t+n)}if(r==="circle"){let t=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*t}return e.getTotalLength()}function Ft(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 Ue(e,r,t){let n=Ft(e),s=Ft(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 Rt={sketch:{easing:"ease-in",stagger:.1,speed:.9,fade:false},reveal:{easing:"ease-out",fade:true,speed:1.2,once:true},typewriter:{easing:"linear",stagger:.05,speed:1.5},cinematic:{easing:"ease-in-out",fade:true,speed:.75},spring:{easing:"spring",speed:1.1}};var Ke=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function he(e,...r){Ke&&console.warn(`[svg-scroll-draw] ${e}`,...r);}var pn="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",dn="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Ht=33;function gn(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function yn(e){let r=[];for(let t=0;t<Ht;t++){let n=t/(Ht-1);r.push(String(Math.round(e(n)*1e5)/1e5));}return `linear(${r.join(",")})`}function it(e){switch(e){case "linear":return "linear";case "ease-in":return pn;case "ease-out":return dn;case "ease-in-out":return gn()?yn(oe["ease-in-out"]):null;default:return null}}var Nt=Symbol.for("svg-scroll-draw.registry");function Vt(){let e=globalThis;return e[Nt]||(e[Nt]=new Map)}function Pe(e,r){Vt().set(e,r);}function ke(e){Vt().delete(e);}var Ze,at=new Set,lt=new WeakMap,Je=new Map,zt=e=>{let r=e.getBoundingClientRect();return r.width+" "+r.height};function hn(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 Fe(e,r){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let t=()=>r();Ze??(Ze=new ResizeObserver(s=>{let i=false;for(let{target:a}of s)lt.get(a)!==zt(a)&&(i=true),lt.set(a,"");i&&at.forEach(a=>a());})),at.add(t);let n=hn(e);return [document.body,document.documentElement].forEach(s=>s&&n.add(s)),n.forEach(s=>{lt.has(s)||lt.set(s,zt(s)),Je.set(s,(Je.get(s)??0)+1),Ze.observe(s);}),()=>{at.delete(t)&&(n.forEach(s=>{let i=(Je.get(s)??1)-1;if(i)return void Je.set(s,i);Je.delete(s),Ze?.unobserve(s);}),at.size||(Ze?.disconnect(),Ze=void 0));}}function ct(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 Be(e,r){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return r(e,true);let t=r(e,false),n=ct(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 bn=0;function wn(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function _t(e,r){let t="";try{t=getComputedStyle(e).getPropertyValue(r).trim();}catch{}return t||(e.getAttribute(r)??"").trim()}var Wt=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function vn(e){if(!Ke)return;let r=_t(e,"stroke");if(!r||r==="none"){he("Element has no stroke \u2014 path will not be visible.",e);return}let t=(e.getAttribute("fill")??"").trim();t&&!Wt.has(t)&&!Wt.has(_t(e,"fill"))&&he("Element has a fill \u2014 it may obscure the stroke animation.",e);}function En(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,f=t==="x";n.innerHTML=`
|
|
2
2
|
<div style="position:absolute;${f?`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;${f?`left:${u}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${u}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(t),window.addEventListener("scroll",i,{passive:true}),i(),{el:t,destroy(){window.removeEventListener("scroll",i),t.remove();}}}var _t=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Wt=/[MmLlHhVvCcSsQqTtAaZz]/g;function hr(e,n,r){if(!Ke)return;let t=(e.match(Wt)??[]).join("").toUpperCase(),i=(n.match(Wt)??[]).join("").toUpperCase(),s=(e.match(_t)??[]).length,a=(n.match(_t)??[]).length;if(t!==i){be(`morphTo: command sequence differs (${t||"\u2205"} \u2192 ${i||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,r);return}s!==a&&be(`morphTo: coordinate count differs (${s} \u2192 ${a}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,r);}function dt(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),i=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,s=>{let a=parseFloat(s),u=t[i++]??a;return String(+(a+(u-a)*r).toFixed(4))})}function gt(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,i=r?{...Ft[r],...t}:t,s=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:a="path, polyline, line, polygon, rect, circle",speed:u=1,fade:f=false,easing:p="linear",trigger:S={},stagger:H=0,direction:C="forward",once:oe=false,debug:Pe=false,axis:G="y",scrollContainer:Ae,autoReverse:N=false,delay:Y=0,strokeColor:X,strokeWidth:L,fillOpacity:I,waypoints:T,velocityScale:$=false,threshold:P=0,rootMargin:x="0px",repeat:w=0,repeatDelay:K=0,morphTo:M,clip:te,autoplay:xe=false,duration:we=1e3,native:ce=true,onProgress:q,onStart:F,onComplete:m,onEnter:O,onLeave:v,onEnterBack:A,onLeaveBack:ue}=i,y=te===true?"left":typeof te=="string"?te:false,V=typeof p=="function"?p:le[p]??le.linear,me=he(S.start??"top bottom"),He=he(S.end??"bottom top"),ve=typeof Ae=="string"?document.querySelector(Ae):Ae??null,Me=Array.isArray(X)?X[0]:null,fe=Array.isArray(X)?X[1]:typeof X=="string"?X:null,Q=Array.isArray(L)?L[0]:null,se=Array.isArray(L)?L[1]:typeof L=="number"?L:null,ie=Array.isArray(I)?I[0]:null,Z=Array.isArray(I)?I[1]:typeof I=="number"?I:null;function Ne(o){let l=o*100;switch(y){case "right":return `inset(0 0 0 ${100-l}%)`;case "top":return `inset(0 0 ${100-l}% 0)`;case "bottom":return `inset(${100-l}% 0 0 0)`;case "center":return `circle(${o*150}% at 50% 50%)`;default:return `inset(0 ${100-l}% 0 0)`}}let z=y?[]:Array.from(e.querySelectorAll(a)),D=[],pe=[],re=0,Ee=0,c=H,h=0,_=false,B=false,k=0,de=false,ye=-1,Ve=[],ae=-1,j=false,Se=0,ze=0,_e,lt=null;function Et(){lt?.destroy(),lt=null;}let We=new Set,St=NaN,qe=true,Je=-1,Tt=performance.now(),Be=NaN;function Ye(){return ve?G==="x"?ve.scrollLeft:ve.scrollTop:G==="x"?window.scrollX:window.scrollY}function xt(){return ve?G==="x"?ve.clientWidth:ve.clientHeight:G==="x"?window.innerWidth:window.innerHeight}function Mt(){let o=ot(e,ve,G);return Ce(o,o.scroll,xt(),me,He)}function er(){let o=Ee-re,l=z.length-1,g=ve??document.documentElement,J=G==="x"?"Width":"Height";if(c=H,H>0&&l>0&&o>0){let Le=g[`scroll${J}`]-g[`client${J}`]-1-re-o/u;Le>=0&&(c=Math.min(H,Le/(l*o)));}h=Ee+l*c*o;}function At(){(({tStart:re,tEnd:Ee}=Mt())),er(),Pe&&Ke&&(Et(),lt=yr(re,Ee,G));}function ct(o,l=Mt){Oe(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:l});let g=o.destroy;return o.destroy=()=>{g.call(o),Ie(e);},o}function tr(o,l){if(e.style.setProperty("--scroll-draw-progress",String(o)),y){let g=l==="reverse"?1-o:o;e.style.clipPath=Ne(g);return}z.forEach((g,J)=>{g.style.strokeDashoffset=l==="reverse"?`${D[J]*o}`:`${D[J]*(1-o)}`,f&&(g.style.opacity=l==="reverse"?`${1-o}`:`${o}`),Me&&fe?g.style.stroke=Ue(Me,fe,o):fe&&(g.style.stroke=fe),Q!==null&&se!==null?g.style.strokeWidth=`${Q+(se-Q)*o}`:se!==null&&(g.style.strokeWidth=`${se}`),ie!==null&&Z!==null?g.style.fillOpacity=`${ie+(Z-ie)*o}`:Z!==null&&(g.style.fillOpacity=`${Z}`),M&&g.tagName.toLowerCase()==="path"&&pe[J]&&g.setAttribute("d",dt(pe[J],M,o));});}function et(){if(e.style.setProperty("--scroll-draw-progress","0"),y){e.style.clipPath=Ne(0);return}z.forEach((o,l)=>{o.style.strokeDasharray=`${D[l]}`,o.style.strokeDashoffset=C==="reverse"?"0":`${D[l]}`,f?o.style.opacity=C==="reverse"?"1":"0":o.style.opacity="",Me&&(o.style.stroke=Me),Q!==null&&(o.style.strokeWidth=`${Q}`),ie!==null&&(o.style.fillOpacity=`${ie}`),M&&o.tagName.toLowerCase()==="path"&&pe[l]&&o.setAttribute("d",pe[l]);});}if(z.forEach(o=>{gr(o);let l=je(o);D.push(l);let g=o.tagName.toLowerCase()==="path";g?pe.push(o.getAttribute("d")??""):pe.push(""),M&&(g?hr(pe[pe.length-1],M,o):be(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),s?(o.style.strokeDasharray=`${l}`,o.style.strokeDashoffset=C==="reverse"?`${l}`:"0",f&&(o.style.opacity="1"),fe&&(o.style.stroke=fe),se!==null&&(o.style.strokeWidth=`${se}`),Z!==null&&(o.style.fillOpacity=`${Z}`),M&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",M)):(o.style.strokeDasharray=`${l}`,o.style.strokeDashoffset=C==="reverse"?"0":`${l}`,f?o.style.opacity=C==="reverse"?"1":"0":o.style.opacity="",Me&&(o.style.stroke=Me),Q!==null&&(o.style.strokeWidth=`${Q}`),ie!==null&&(o.style.fillOpacity=`${ie}`));}),y){if(s)return e.style.clipPath=Ne(1),m?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Ne(0);}else if(s)return m?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let Lt=typeof p=="string"?st(p):null;function rr(){return !(ce===false||!dr()||!z.length||!Lt||y||G!=="y"||ve||u!==1||H!==0||oe||N||$!==false||M||T||w||Y>0||q||F||m||O||v||A||ue||X!=null||L!=null||I!=null||(S.start??"top bottom").trim()!=="top bottom"||(S.end??"bottom top").trim()!=="bottom top")}function nr(){let o=++pr,l=`svg-scroll-draw-${o}`,g=`svg-scroll-draw-host-${o}`,J=`--svg-scroll-draw-${o}`,Le=C==="reverse"?"0":"var(--ssd-len)",Fe=C==="reverse"?"var(--ssd-len)":"0",ke=`stroke-dashoffset:${Le};`,E=`stroke-dashoffset:${Fe};`;f&&(ke+=`opacity:${C==="reverse"?1:0};`,E+=`opacity:${C==="reverse"?0:1};`);let R=document.createElement("style");R.setAttribute("data-svg-scroll-draw",""),R.textContent=`@keyframes ${l}{from{${ke}}to{${E}}}.${g}{view-timeline-name:${J};view-timeline-axis:block;}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${Lt};animation-fill-mode:both;animation-timeline:${J};animation-range:cover 0% cover 100%;}`,document.head.appendChild(R),e.classList.add(g);function ge(d,ee){d.style.setProperty("--ssd-len",String(D[ee])),d.style.strokeDasharray=`${D[ee]}`,d.style.strokeDashoffset="",d.style.opacity="",d.style.animationPlayState="",d.classList.add(l);}z.forEach(ge);let b=false,W=-1;function U(){if(W>=0)return W;let d=e.getBoundingClientRect(),{tStart:ee,tEnd:$e}=Ce({top:d.top,height:d.height},Ye(),xt(),me,He);return V(ne(Ye(),ee,$e,u))}return {destroy(){e.classList.remove(g),z.forEach(d=>{d.classList.remove(l),d.style.removeProperty("--ssd-len"),d.style.animationPlayState="";}),R.remove();},replay(){b=false,W=-1,z.forEach(ge);},pause(){b=true,z.forEach(d=>{d.style.animationPlayState="paused";});},resume(){b&&(b=false,z.forEach(d=>{d.style.animationPlayState="running";}));},seek(d){let ee=Math.min(1,Math.max(0,d));W=ee,b=true,z.forEach(($e,Te)=>{$e.classList.remove(l),$e.style.strokeDashoffset=C==="reverse"?`${D[Te]*ee}`:`${D[Te]*(1-ee)}`,f&&($e.style.opacity=C==="reverse"?`${1-ee}`:`${ee}`);});},getProgress(){return U()},refresh(){z.forEach((d,ee)=>{D[ee]=je(d),d.style.setProperty("--ssd-len",String(D[ee])),d.style.strokeDasharray=`${D[ee]}`;});}}}if(rr())return ct(nr());function or(){let o=Math.max(1,we),l=0,g=0,J=false;function Le(b){let W=true;if(y){let U=Math.min(1,Math.max(0,b/o)),d=V(U);Se=d,e.style.setProperty("--scroll-draw-progress",String(d)),e.style.clipPath=Ne(C==="reverse"?1-d:d),q?.(d),U<1&&(W=false);}else z.forEach((U,d)=>{let ee=d*H*o,$e=Math.min(1,Math.max(0,(b-ee)/o)),Te=V($e);U.style.strokeDashoffset=C==="reverse"?`${D[d]*Te}`:`${D[d]*(1-Te)}`,f&&(U.style.opacity=C==="reverse"?`${1-Te}`:`${Te}`),Me&&fe?U.style.stroke=Ue(Me,fe,Te):fe&&(U.style.stroke=fe),Q!==null&&se!==null?U.style.strokeWidth=`${Q+(se-Q)*Te}`:se!==null&&(U.style.strokeWidth=`${se}`),ie!==null&&Z!==null?U.style.fillOpacity=`${ie+(Z-ie)*Te}`:Z!==null&&(U.style.fillOpacity=`${Z}`),M&&U.tagName.toLowerCase()==="path"&&pe[d]&&U.setAttribute("d",dt(pe[d],M,Te)),d===0&&(Se=Te,q?.(Te),e.style.setProperty("--scroll-draw-progress",String(Te))),$e<1&&(W=false);});if(T){let U=Math.min(1,Math.max(0,b/o)),d=V(U);for(let ee in T){let $e=parseFloat(ee);d>=$e&&!We.has($e)&&(We.add($e),T[ee]?.());}}return W}function Fe(b){if(j)return;let W=b-l;B||(B=true,F?.());let U=Le(W);if(U&&!_){_=true,Le(o*(1+Math.max(0,z.length-1)*H)),m?.(),ze<(w==="infinite"?1/0:w??0)&&(ze++,_e=setTimeout(()=>{l=performance.now(),B=false,_=false,We.clear(),et(),k=requestAnimationFrame(Fe);},K));return}U||(k=requestAnimationFrame(Fe));}function ke(){cancelAnimationFrame(k),clearTimeout(_e),l=performance.now(),g=0,j=false,B=false,_=false,ze=0,J=true,Se=0,We.clear(),et(),k=requestAnimationFrame(Fe);}let E=new IntersectionObserver(b=>{b.forEach(W=>{W.isIntersecting&&!(oe&&_)?ke():!W.isIntersecting&&!oe&&!_&&(cancelAnimationFrame(k),clearTimeout(_e),J=false);});},{root:ve??null,threshold:P,rootMargin:x}),R;function ge(){clearTimeout(R),R=setTimeout(()=>{z.forEach((b,W)=>{D[W]=je(b),b.style.strokeDasharray=`${D[W]}`;});},150);}return window.addEventListener("resize",ge),window.addEventListener("orientationchange",ge),Y>0?setTimeout(()=>E.observe(e),Y):E.observe(e),{destroy(){cancelAnimationFrame(k),clearTimeout(_e),E.disconnect(),window.removeEventListener("resize",ge),window.removeEventListener("orientationchange",ge),clearTimeout(R);},replay(){ze=0,ke();},pause(){j||!J||(j=true,g=performance.now()-l,cancelAnimationFrame(k));},resume(){j&&(j=false,J=true,l=performance.now()-g,k=requestAnimationFrame(Fe));},seek(b){let W=Math.min(1,Math.max(0,b));Se=W,j=true,g=W*o,l=performance.now()-g,cancelAnimationFrame(k),Le(g);},getProgress(){return Se},refresh(){clearTimeout(R),z.forEach((b,W)=>{D[W]=je(b),b.style.strokeDasharray=`${D[W]}`;});}}}if(xe)return ct(or());At();function $t(){if(j||!Ge)return;let o=performance.now(),l=Ye();if(!qe&&$===false&&l===St){mt(l);return}qe=false,St=l;let g=u;if($!==false){let E=o-Tt,R=E>0?Math.abs(l-(Je<0?l:Je))/E:0;g=u*Math.max(.2,1+R*(typeof $=="number"?$:1)*.04);}Je=l,Tt=o;let J=N?ae===-1||l>=ae?"forward":"reverse":C;ae=l;let Le=Ee-re,Fe=true,ke=Le===0?0:(l-re)/Le;if(isNaN(Be)||(Be<=0&&ke>0?O?.():Be>0&&ke<=0&&ue?.(),Be<1&&ke>=1?v?.():Be>=1&&ke<1&&A?.()),Be=ke,y){let E=V(ne(l,re,Ee,g));oe&&!N&&(ye=Math.max(ye,E),E=ye),Se=E,e.style.setProperty("--scroll-draw-progress",String(E));let R=J==="reverse"?1-E:E;e.style.clipPath=Ne(R),q?.(E),!B&&ne(l,re,Ee,g)>0&&(B=true,F?.()),E>=1&&!_?(_=true,m?.(),ze<(w==="infinite"?1/0:w??0)&&(ze++,_e=setTimeout(()=>{ye=-1,B=false,_=false,e.style.clipPath=Ne(0);},K))):E<1&&!oe&&(_=false),mt(l);return}if(z.forEach((E,R)=>{let ge=R*c*Le,b=V(ne(l,re+ge,Ee+ge,g));oe&&!N&&(b=Ve[R]=Math.max(Ve[R]??ye,b)),E.style.strokeDashoffset=J==="reverse"?`${D[R]*b}`:`${D[R]*(1-b)}`,f&&(E.style.opacity=J==="reverse"?`${1-b}`:`${b}`),Me&&fe?E.style.stroke=Ue(Me,fe,b):fe&&(E.style.stroke=fe),Q!==null&&se!==null?E.style.strokeWidth=`${Q+(se-Q)*b}`:se!==null&&(E.style.strokeWidth=`${se}`),ie!==null&&Z!==null?E.style.fillOpacity=`${ie+(Z-ie)*b}`:Z!==null&&(E.style.fillOpacity=`${Z}`),M&&E.tagName.toLowerCase()==="path"&&pe[R]&&E.setAttribute("d",dt(pe[R],M,b)),R===0&&(Se=b,q?.(b),e.style.setProperty("--scroll-draw-progress",String(b))),b<1&&(Fe=false);}),T){let E=V(ne(l,re,Ee,g));for(let R in T){let ge=parseFloat(R);E>=ge&&!We.has(ge)&&(We.add(ge),T[R]?.());}}!B&&ne(l,re,Ee,g)>0&&(B=true,F?.()),Fe&&!_?(_=true,m?.(),ze<(w==="infinite"?1/0:w??0)&&(ze++,_e=setTimeout(()=>{ye=-1,Ve=[],B=false,_=false,We.clear(),et(),qe=true;},K))):!Fe&&!oe&&(_=false),mt(l);}function ut(o){return o>=Ee&&o<h}function mt(o){de||ut(o)?k=requestAnimationFrame($t):Ge=false;}function ft(){return de||ut(Ye())}let Ge=false;function tt(){Ge||(Ge=true,k=requestAnimationFrame(function(){$t();}));}function rt(){Ge=false,cancelAnimationFrame(k);}let pt=new IntersectionObserver(o=>{o.forEach(l=>{de=l.isIntersecting,de&&!j?(qe=true,tt()):Ge&&!j&&ut(Ye())||rt();});},{root:ve??null,threshold:P,rootMargin:x});function Ct(){z.forEach((o,l)=>{D[l]=je(o),o.style.strokeDasharray=`${D[l]}`;}),At(),qe=true;}let nt;function Xe(){clearTimeout(nt),nt=setTimeout(Ct,150);}window.addEventListener("resize",Xe),window.addEventListener("orientationchange",Xe);let sr=De([e],Xe);return Y>0?setTimeout(()=>pt.observe(e),Y):pt.observe(e),ct({destroy(){cancelAnimationFrame(k),clearTimeout(_e),rt(),pt.disconnect(),sr(),window.removeEventListener("resize",Xe),window.removeEventListener("orientationchange",Xe),clearTimeout(nt),Et();},replay(){ye=-1,Ve=[],ae=-1,Je=-1,B=false,_=false,ze=0,j=false,Se=0,We.clear(),clearTimeout(_e),et(),qe=true,ft()&&tt();},pause(){j=true,rt();},resume(){j&&(j=false,qe=true,ft()&&tt());},seek(o){let l=Math.min(1,Math.max(0,o));Se=l,ye=l,Ve=[],j=true,rt(),tr(l,C),qe=true;},getProgress(){return Se},refresh(){clearTimeout(nt),Ct(),ft()&&!j&&tt();}},()=>({tStart:re,tEnd:Ee}))}var qt=new WeakMap,br=0;function Bt(e){return JSON.stringify(e,(n,r)=>{if(typeof r=="function")return "\u0192";if(typeof Element<"u"&&r instanceof Element){let t=qt.get(r);return t===void 0&&qt.set(r,t=++br),`el#${t}`}return r})}function Gt(e,n){let r={...e};for(let t of Object.keys(r))typeof r[t]=="function"&&(r[t]=(...i)=>n()[t]?.(...i));return r}function wr(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function jt(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let i=[],s=[],a=t[2].trim();if(a)for(let u of a.split(/[\s,]+/)){let f=u.match(/^([-+]?[\d.eE]+)(.*)$/);i.push(f?parseFloat(f[1]):0),s.push(f?f[2]:"");}n.push({fn:t[1],nums:i,units:s});}return n}function vr(e,n,r){let t=jt(e),i=jt(n);return t.length===0||t.length!==i.length?r<1?e:n:t.map((s,a)=>{let u=i[a];return s.fn!==u.fn||s.nums.length!==u.nums.length?r<1?`${s.fn}(${s.nums.map((f,p)=>`${f}${s.units[p]}`).join(", ")})`:`${u.fn}(${u.nums.map((f,p)=>`${f}${u.units[p]}`).join(", ")})`:`${s.fn}(${s.nums.map((f,p)=>`${f+(u.nums[p]-f)*r}${s.units[p]}`).join(", ")})`}).join(" ")}function Ut(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),i=String(n);if(wr(t))return Ue(t,i,r);if(t.includes("("))return vr(t,i,r);let s=t.match(/^([-+]?[\d.]+)(.*)$/),a=i.match(/^([-+]?[\d.]+)(.*)$/);if(s&&a){let u=parseFloat(s[1]),f=parseFloat(a[1]);return `${u+(f-u)*r}${s[2]||a[2]}`}return r<1?t:i}function Er(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var Sr=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Tr=0,Yt="--scroll-draw-progress";function xr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function yt(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:i={},easing:s="ease-out",speed:a=1,once:u=false,axis:f="y",scrollContainer:p,native:S=true,velocityScale:H=false,respectReducedMotion:C=true,triggerElement:oe,onProgress:Pe,onComplete:G,onEnter:Ae,onLeave:N,onEnterBack:Y,onLeaveBack:X}=n,L=C&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,I=typeof s=="function"?s:le[s]??le["ease-out"],T=he(i.start??"top bottom"),$=he(i.end??"bottom top"),P=oe??e,x=typeof p=="string"?document.querySelector(p):p??null,w=Object.entries(t).map(([c,h])=>({prop:Er(c),from:Array.isArray(h)?h[0]:"",to:Array.isArray(h)?h[1]:h}));function K(){let c=window.getComputedStyle(e);for(let h of w)h.from===""&&(h.from=c.getPropertyValue(h.prop).trim()||"0");}function M(){for(let c of w)e.style.setProperty(c.prop,String(c.to));}let te=new Map;for(let c of [...w.map(h=>h.prop),Yt])te.set(c,e.style.getPropertyValue(c));function xe(){for(let[c,h]of te)h?e.style.setProperty(c,h):e.style.removeProperty(c);}if(L)return M(),G?.(),{...r,destroy:xe,getProgress:()=>1};K();let we=typeof s=="string"?st(s):null;function ce(){if(!S||!xr()||!we||f!=="y"||x||P!==e||u||a!==1||Pe||G||Ae||N||Y||X||H!==false||(i.start??"top bottom").trim()!=="top bottom"||(i.end??"bottom top").trim()!=="bottom top")return false;for(let c of w)if(!Sr.has(c.prop))return false;return true}function q(){let c=`ssd-a-${++Tr}`,h=w.map(ae=>`${ae.prop}:${ae.from}`).join(";"),_=w.map(ae=>`${ae.prop}:${ae.to}`).join(";"),B=document.createElement("style");B.setAttribute("data-ssd-animate",""),B.textContent=`@keyframes ${c}{from{${h}}to{${_}}}.${c}{animation-name:${c};animation-duration:auto;animation-timing-function:${we};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(B),e.classList.add(c);let k=()=>f==="x"?window.scrollX:window.scrollY,de=()=>f==="x"?window.innerWidth:window.innerHeight,ye=()=>{let ae=e.getBoundingClientRect();return Ce({top:ae.top,height:ae.height},k(),de(),T,$)};Oe(e,{type:"animate",getProgress:()=>Ve.getProgress(),getTrigger:ye});let Ve={refresh(){},destroy(){e.classList.remove(c),B.remove(),e.style.animationPlayState="",xe(),Ie(e);},replay(){e.classList.remove(c),e.offsetWidth,e.classList.add(c);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(ae){let j=Math.min(1,Math.max(0,ae));e.classList.remove(c);for(let Se of w)e.style.setProperty(Se.prop,Ut(Se.from,Se.to,j));},getProgress(){let{tStart:ae,tEnd:j}=ye();return I(ne(k(),ae,j,a))}};return Ve}if(ce())return q();let F=0,m=0,O=0,v=false,A=false,ue=-1,y=0,V=false,me=NaN,He=-1,ve=0,Me=()=>x?f==="x"?x.scrollLeft:x.scrollTop:f==="x"?window.scrollX:window.scrollY,fe=()=>x?f==="x"?x.clientWidth:x.clientHeight:f==="x"?window.innerWidth:window.innerHeight,Q=P===e?w:[],se=false;function ie(){let c=e.style,h=Q.map(de=>c.getPropertyValue(de.prop)),_=c.transition;Q.length&&(c.transition="none"),Q.forEach(de=>c.setProperty(de.prop,te.get(de.prop)??""));let B=ot(P,x,f);Q.forEach((de,ye)=>c.setProperty(de.prop,h[ye])),Q.length&&(e.offsetWidth,c.transition=_);let k=Ce(B,B.scroll,fe(),T,$);se&&Math.abs(k.tStart-F)<1&&Math.abs(k.tEnd-m)<1||(se=true,F=k.tStart,m=k.tEnd);}function Z(c){e.style.setProperty(Yt,String(c));for(let h of w)e.style.setProperty(h.prop,Ut(h.from,h.to,c));Pe?.(c);}function Ne(c){if(isNaN(me)){me=c;return}me<=0&&c>0?Ae?.():me>0&&c<=0&&X?.(),me<1&&c>=1?N?.():me>=1&&c<1&&Y?.(),me=c;}function z(){if(!v||A)return;let c=performance.now(),h=Me(),_=a;if(H!==false){let de=c-ve,ye=de>0?Math.abs(h-(He<0?h:He))/de:0;_=a*Math.max(.2,1+ye*(typeof H=="number"?H:1)*.04);}He=h,ve=c;let B=m===F?0:(h-F)/(m-F);Ne(B);let k=I(ne(h,F,m,_));u&&(ue=Math.max(ue,k),k=ue),y=k,Z(k),k>=1&&!V?(V=true,G?.()):k<1&&!u&&(V=false),O=requestAnimationFrame(z);}ie(),m===F&&be("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 c=I(ne(Me(),F,m,a));u&&c>0&&(ue=c),y=c,Z(c);}let D=new IntersectionObserver(c=>{c.forEach(h=>{v=h.isIntersecting,v&&!A?O=requestAnimationFrame(z):cancelAnimationFrame(O);});},{root:x??null}),pe;function re(){clearTimeout(pe),pe=setTimeout(ie,150);}window.addEventListener("resize",re),window.addEventListener("orientationchange",re);let Ee=De([P],re);return D.observe(e),Oe(e,{type:"animate",getProgress:()=>y,getTrigger:()=>({tStart:F,tEnd:m})}),{destroy(){cancelAnimationFrame(O),D.disconnect(),window.removeEventListener("resize",re),window.removeEventListener("orientationchange",re),Ee(),clearTimeout(pe),xe(),Ie(e);},replay(){ue=-1,V=false,y=0,A=false,Z(0);},pause(){A=true,cancelAnimationFrame(O);},resume(){A&&(A=false,v&&(O=requestAnimationFrame(z)));},seek(c){let h=Math.min(1,Math.max(0,c));y=h,ue=h,A=true,cancelAnimationFrame(O),Z(h);},getProgress(){return y},refresh(){ie();}}}var ht={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function bt(e,n){if(typeof window>"u")return ht;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return be("scrollCounter: element not found:",e),ht;let t=r,{from:i=0,to:s,format:a,easing:u="ease-out",trigger:f={},once:p=true,decimals:S,onComplete:H}=n,C=S!==void 0?m=>m.toFixed(S):a??(m=>String(Math.round(m))),oe=typeof u=="function"?u:le[u]??le["ease-out"],Pe=he(f.start??"top 80%"),G=he(f.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=C(s),H?.(),ht;let N=0,Y=0,X=false,L=0,I=false,T=false,$=-1,P=0,x=false,w=()=>window.scrollY,K=()=>window.innerHeight;function M(){let m=t.getBoundingClientRect(),O=Ce({top:m.top,height:m.height},w(),K(),Pe,G);X&&Math.abs(O.tStart-N)<1&&Math.abs(O.tEnd-Y)<1||(X=true,N=O.tStart,Y=O.tEnd);}function te(m){t.textContent=C(i+(s-i)*m),t.style.setProperty("--scroll-draw-progress",String(m));}function xe(){if(!I||T)return;let m=oe(ne(w(),N,Y,1));p&&($=Math.max($,m),m=$),P=m,te(m),m>=1&&!x?(x=true,H?.()):m<1&&!p&&(x=false),L=requestAnimationFrame(xe);}M();{let m=oe(ne(w(),N,Y,1));p&&m>0&&($=m),P=m,te(m);}let we=new IntersectionObserver(m=>{m.forEach(O=>{I=O.isIntersecting,I&&!T?L=requestAnimationFrame(xe):cancelAnimationFrame(L);});}),ce;function q(){clearTimeout(ce),ce=setTimeout(M,150);}window.addEventListener("resize",q),window.addEventListener("orientationchange",q);let F=De([t],q);return we.observe(t),Oe(t,{type:"counter",getProgress:()=>P,getTrigger:()=>({tStart:N,tEnd:Y})}),{destroy(){cancelAnimationFrame(L),we.disconnect(),window.removeEventListener("resize",q),window.removeEventListener("orientationchange",q),F(),clearTimeout(ce),Ie(t);},replay(){$=-1,x=false,P=0,T=false,te(0);},pause(){T=true,cancelAnimationFrame(L);},resume(){T&&(T=false,I&&(L=requestAnimationFrame(xe)));},seek(m){let O=Math.min(1,Math.max(0,m));P=O,$=O,T=true,cancelAnimationFrame(L),te(O);},getProgress(){return P}}}var Xt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function wt(e,n={}){if(typeof window>"u")return Xt;let r=typeof e=="string"?document.querySelector(e):e;if(!r||r.tagName.toLowerCase()!=="video")return be("scrollVideo: <video> element not found:",e),Xt;let t=r,{trigger:i={},easing:s="linear",once:a=false,axis:u="y",preload:f="auto",triggerElement:p,onReady:S,onComplete:H,onProgress:C}=n,oe=p??t,Pe=window.matchMedia("(prefers-reduced-motion: reduce)").matches,G=typeof s=="function"?s:le[s]??le.linear,Ae=he(i.start??"top top"),N=he(i.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=f);let Y=n.from??0,X=n.to,L=0,I=0,T=0,$=false,P=false,x=-1,w=0,K=false,M=false,te=()=>u==="x"?window.scrollX:window.scrollY,xe=()=>u==="x"?window.innerWidth:window.innerHeight;function we(){let y=oe.getBoundingClientRect(),V=u==="x"?y.left:y.top,me=u==="x"?y.width:y.height,He=Ce({top:V,height:me},te(),xe(),Ae,N);L=He.tStart,I=He.tEnd,M&&I===L&&be("scrollVideo: zero-length trigger window, so it never scrubs. In a sticky stage, set triggerElement.",t);}let ce=NaN;function q(y){if(!M)return;let V=X??t.duration??0,me=Y+(V-Y)*y;me!==ce&&(ce=me,t.currentTime=me),t.style.setProperty("--scroll-draw-progress",String(y)),C?.(y);}function F(){if(!$||P||!M||Pe)return;let y=G(ne(te(),L,I,1));a&&(x=Math.max(x,y),y=x),w=y,q(y),y>=1&&!K?(K=true,H?.()):y<1&&!a&&(K=false),T=requestAnimationFrame(F);}function m(){if(M=true,X===void 0&&(X=t.duration),Pe){q(1),S?.();return}we(),S?.(),$&&!P&&(T=requestAnimationFrame(F));}t.readyState>=1?m():t.addEventListener("loadedmetadata",m,{once:true}),M||we();let O=new IntersectionObserver(y=>{y.forEach(V=>{$=V.isIntersecting,$&&!P&&M?T=requestAnimationFrame(F):cancelAnimationFrame(T);});}),v;function A(){clearTimeout(v),v=setTimeout(we,150);}window.addEventListener("resize",A),window.addEventListener("orientationchange",A);let ue=De([oe],A);return O.observe(t),Oe(t,{type:"video",getProgress:()=>w,getTrigger:()=>({tStart:L,tEnd:I})}),{destroy(){cancelAnimationFrame(T),O.disconnect(),t.removeEventListener("loadedmetadata",m),window.removeEventListener("resize",A),window.removeEventListener("orientationchange",A),ue(),clearTimeout(v),Ie(t);},replay(){x=-1,K=false,w=0,P=false,ce=NaN,q(0);},pause(){P=true,cancelAnimationFrame(T);},resume(){P&&(P=false,$&&M&&(T=requestAnimationFrame(F)));},seek(y){let V=Math.min(1,Math.max(0,y));w=V,x=V,P=true,cancelAnimationFrame(T),ce=NaN,q(V);},getProgress(){return w}}}function Kt(e,n){let r=document.createElement("span");r.textContent=n,r.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;user-select:none",e.appendChild(r);}function Jt(e){let n=e.textContent??"";return e.textContent="",n.split(/(\s+)/).filter(Boolean).map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(r)?(t.textContent=r,t.style.whiteSpace="pre"):(t.textContent=r,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(r)?null:t}).filter(r=>r!==null)}function Mr(e){let n=e.textContent??"";return e.textContent="",n.split("").map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=r,r===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),r===" "?null:t}).filter(r=>r!==null)}function Qt(e){let n=Jt(e),r=new Map;for(let s of n){let a=s.offsetTop;r.has(a)||r.set(a,[]),r.get(a).push(s);}let t=[],i=Array.from(r.keys()).sort((s,a)=>s-a);for(let s of i){let a=r.get(s),u=document.createElement("span");u.setAttribute("aria-hidden","true"),u.style.display="inline-block",a.forEach((f,p)=>{let S=f.nextElementSibling;u.appendChild(f),p<a.length-1&&S&&S.style.whiteSpace==="pre"&&u.appendChild(S);}),t.push(u);}return e.textContent="",t.forEach((s,a)=>{e.appendChild(s),a<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function Ar(e,n,r,t){if(r<=1||t===0)return e;let i=(r-1)*t,s=n*t,a=s+(1-i);return a<=s?e>=s?1:0:Math.min(1,Math.max(0,(e-s)/(a-s)))}function Lr(e,n){let r=[];if(n?.y!==void 0&&r.push(`translateY(${n.y*(1-e)}px)`),n?.x!==void 0&&r.push(`translateX(${n.x*(1-e)}px)`),n?.rotate!==void 0&&r.push(`rotate(${n.rotate*(1-e)}deg)`),n?.scale!==void 0){let t=n.scale+(1-n.scale)*e;r.push(`scale(${t})`);}return r.join(" ")||""}var Zt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function vt(e,n={}){if(typeof window>"u")return Zt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return be("scrollText: element not found:",e),Zt;let t=r,{split:i="words",stagger:s=.04,easing:a="ease-out",from:u={opacity:0,y:24},trigger:f={},once:p=true,onComplete:S}=n,H=window.matchMedia("(prefers-reduced-motion: reduce)").matches,C=typeof a=="function"?a:le[a]??le["ease-out"],oe=he(f.start??"top 85%"),Pe=he(f.end??"top 40%"),G=t.innerHTML,Ae=t.textContent??"",N;i==="chars"?N=Mr(t):i==="lines"?N=Qt(t):N=Jt(t),Kt(t,Ae);let Y=N.length;function X(v,A){u?.opacity!==void 0&&(v.style.opacity=String(u.opacity+(1-u.opacity)*A));let ue=Lr(A,u);ue&&(v.style.transform=ue);}function L(v){t.style.setProperty("--scroll-draw-progress",String(v)),N.forEach((A,ue)=>{let y=C(Ar(v,ue,Y,s));X(A,y);});}if(H)return L(1),S?.(),{destroy(){t.innerHTML=G;},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};L(0);let I=0,T=0,$=0,P=false,x=false,w=-1,K=0,M=false,te=()=>window.scrollY,xe=()=>window.innerHeight;function we(){let v=t.getBoundingClientRect(),A=Ce({top:v.top,height:v.height},te(),xe(),oe,Pe);I=A.tStart,T=A.tEnd;}function ce(){if(!P||x)return;let v=ne(te(),I,T,1);p&&(w=Math.max(w,v),v=w),K=v,L(v),v>=1&&!M?(M=true,S?.()):v<1&&!p&&(M=false),$=requestAnimationFrame(ce);}we();let q=new IntersectionObserver(v=>{v.forEach(A=>{P=A.isIntersecting,P&&!x?$=requestAnimationFrame(ce):cancelAnimationFrame($);});}),F;function m(){clearTimeout(F),F=setTimeout(()=>{if(i==="lines"){let v=K;t.innerHTML=G,N=Qt(t),Kt(t,Ae),L(v);}we();},150);}window.addEventListener("resize",m),window.addEventListener("orientationchange",m);let O=De([t],m);return q.observe(t),Oe(t,{type:"text",getProgress:()=>K,getTrigger:()=>({tStart:I,tEnd:T})}),{destroy(){cancelAnimationFrame($),q.disconnect(),window.removeEventListener("resize",m),window.removeEventListener("orientationchange",m),O(),clearTimeout(F),t.innerHTML=G,Ie(t);},replay(){w=-1,M=false,K=0,x=false,L(0);},pause(){x=true,cancelAnimationFrame($);},resume(){x&&(x=false,P&&($=requestAnimationFrame(ce)));},seek(v){let A=Math.min(1,Math.max(0,v));K=A,w=A,x=true,cancelAnimationFrame($),L(A);},getProgress(){return K}}}function Re(e,n){let r,t,i,s;return solidJs.createEffect(()=>{s=typeof e=="function"?e():e;let a=Bt(s);!r||a===i||(i=a,solidJs.untrack(()=>{t?.destroy(),t=n(r,Gt(s,()=>s));}));}),solidJs.onCleanup(()=>{t?.destroy(),t=i=void 0;}),{ref:a=>{r=a;},getInstance:()=>t}}function Hn(e={}){return Re(e,gt).ref}function Nn(e={}){return Re(e,gt)}function Vn(e){return Re(e,yt).ref}function zn(e){return Re(e,yt)}function _n(e){return Re(e,bt).ref}function Wn(e){return Re(e,bt)}function qn(e={}){return Re(e,wt).ref}function Bn(e={}){return Re(e,wt)}function Gn(e={}){return Re(e,vt).ref}function jn(e={}){return Re(e,vt)}exports.createScrollAnimate=zn;exports.createScrollCounter=Wn;exports.createScrollDraw=Nn;exports.createScrollText=jn;exports.createScrollVideo=Bn;exports.useScrollAnimate=Vn;exports.useScrollCounter=_n;exports.useScrollDraw=Hn;exports.useScrollText=Gn;exports.useScrollVideo=qn;
|
|
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;
|
package/dist/solid/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { S as ScrollDrawInstance, a as ScrollDrawOptions } from '../types-MswK0erX.mjs';
|
|
2
|
-
import { S as ScrollAnimateOptions } from '../engine-
|
|
2
|
+
import { S as ScrollAnimateOptions } from '../engine-o1VSQ1lX.mjs';
|
|
3
3
|
import { S as ScrollCounterOptions } from '../index-CdaBYn3A.mjs';
|
|
4
4
|
import { ScrollVideoOptions } from '../video/index.mjs';
|
|
5
5
|
import { ScrollTextOptions } from '../text/index.mjs';
|
package/dist/solid/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { S as ScrollDrawInstance, a as ScrollDrawOptions } from '../types-MswK0erX.js';
|
|
2
|
-
import { S as ScrollAnimateOptions } from '../engine-
|
|
2
|
+
import { S as ScrollAnimateOptions } from '../engine-B7UpB4fT.js';
|
|
3
3
|
import { S as ScrollCounterOptions } from '../index-D3o4vT3e.js';
|
|
4
4
|
import { ScrollVideoOptions } from '../video/index.js';
|
|
5
5
|
import { ScrollTextOptions } from '../text/index.js';
|
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-KV3WCPQ5.mjs';import {a as a$4}from'../chunk-DY5JCXVR.mjs';import {a as a$2}from'../chunk-WXUOF4NM.mjs';import {a as a$1}from'../chunk-LTCJVVSC.mjs';import {b as b$1}from'../chunk-HX4SP5WN.mjs';import'../chunk-OJFWQ6CU.mjs';import'../chunk-YWKPTYSG.mjs';import'../chunk-YZV4Z3EQ.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};
|