svg-scroll-draw 2.22.0 → 2.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +10 -6
  2. package/dist/angular/index.mjs +1 -1
  3. package/dist/aos/index.cjs +2 -2
  4. package/dist/aos/index.mjs +1 -1
  5. package/dist/aos/react/index.cjs +2 -2
  6. package/dist/aos/react/index.mjs +1 -1
  7. package/dist/astro/index.mjs +1 -1
  8. package/dist/cdn/aos.global.js +2 -2
  9. package/dist/cdn/scrollreveal.global.js +2 -2
  10. package/dist/cdn/vivus.global.js +1 -1
  11. package/dist/chunk-DWK6XXY6.mjs +2 -0
  12. package/dist/chunk-EAWFBJUR.mjs +2 -0
  13. package/dist/chunk-JCXMBI4G.mjs +2 -0
  14. package/dist/{chunk-VDTAYUAR.mjs → chunk-KV3WCPQ5.mjs} +1 -1
  15. package/dist/{chunk-PKY27MO4.mjs → chunk-VMUJMXKO.mjs} +1 -1
  16. package/dist/{chunk-N6PDF6O6.mjs → chunk-YNNA33A5.mjs} +1 -1
  17. package/dist/cinematic/index.mjs +1 -1
  18. package/dist/group/index.mjs +1 -1
  19. package/dist/horizontal/index.mjs +1 -1
  20. package/dist/index.mjs +1 -1
  21. package/dist/nuxt/index.mjs +1 -1
  22. package/dist/react/index.mjs +1 -1
  23. package/dist/reveal/index.mjs +1 -1
  24. package/dist/scrollreveal/index.cjs +2 -2
  25. package/dist/scrollreveal/index.mjs +1 -1
  26. package/dist/scrollreveal/react/index.cjs +2 -2
  27. package/dist/scrollreveal/react/index.mjs +1 -1
  28. package/dist/snap/index.mjs +1 -1
  29. package/dist/solid/index.mjs +1 -1
  30. package/dist/svelte/index.mjs +1 -1
  31. package/dist/text/index.mjs +1 -1
  32. package/dist/timeline/index.mjs +1 -1
  33. package/dist/video/index.mjs +1 -1
  34. package/dist/vivus/index.cjs +2 -2
  35. package/dist/vivus/index.d.mts +3 -0
  36. package/dist/vivus/index.d.ts +3 -0
  37. package/dist/vivus/index.mjs +1 -1
  38. package/dist/vivus/react/index.cjs +2 -2
  39. package/dist/vivus/react/index.mjs +1 -1
  40. package/dist/vue/index.mjs +1 -1
  41. package/dist/web-component/index.mjs +1 -1
  42. package/package.json +1 -1
  43. package/dist/chunk-4T5R3ZTL.mjs +0 -2
  44. package/dist/chunk-OMI46IXL.mjs +0 -2
  45. package/dist/chunk-WQZKXAXK.mjs +0 -2
@@ -1 +1 @@
1
- import {b as b$1}from'../chunk-GVBO5GRD.mjs';import {a as a$1}from'../chunk-LTCJVVSC.mjs';import {b}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-5PJEKEEP.mjs';import'../chunk-DM6EDKWH.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import'../chunk-LFSU6LR3.mjs';function u(s){return s.map(o=>typeof o=="string"?document.querySelector(o):o).filter(o=>o!==null)}var a={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function y(s,o={}){if(typeof window>"u")return a;let r=u(s).map(e=>b(e,o));return {destroy(){r.forEach(e=>e.destroy());},replay(){r.forEach(e=>e.replay());},pause(){r.forEach(e=>e.pause());},resume(){r.forEach(e=>e.resume());},seek(e){r.forEach(n=>n.seek(e));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(e=>e.refresh?.());}}}function E(s,o={}){if(typeof window>"u")return a;let r=u(s);if(r.length===0)return a;let e=0,n=[];function i(t){return b(r[t],{...o,once:true,onComplete(){o.onComplete?.(),e=Math.min(t+1,r.length-1),e>t&&n[e]?.resume();}})}function l(){r.forEach((t,c)=>{n[c]=i(c);});for(let t=1;t<n.length;t++)n[t].pause();}return l(),{destroy(){n.forEach(t=>t.destroy()),n.length=0;},replay(){n.forEach(t=>t.destroy()),n.length=0,e=0,l();},pause(){n[e]?.pause();},resume(){n[e]?.resume();},seek(t){n[e]?.seek(t);},getProgress(){return n[e]?.getProgress()??0},refresh(){n.forEach(t=>t.refresh?.());}}}function d(s,o){if(typeof window>"u")return a;let r=u(s).map(e=>a$1(e,o));return {destroy(){r.forEach(e=>e.destroy());},replay(){r.forEach(e=>e.replay());},pause(){r.forEach(e=>e.pause());},resume(){r.forEach(e=>e.resume());},seek(e){r.forEach(n=>n.seek(e));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(e=>e.refresh?.());}}}function w(s,o){if(typeof window>"u")return a;let r=u(s);if(r.length===0)return a;let e=0,n=[];function i(t){return a$1(r[t],{...o,once:true,onComplete(){o.onComplete?.(),e=Math.min(t+1,r.length-1),e>t&&n[e]?.resume();}})}function l(){r.forEach((t,c)=>{n[c]=i(c);});for(let t=1;t<n.length;t++)n[t].pause();}return l(),{destroy(){n.forEach(t=>t.destroy()),n.length=0;},replay(){n.forEach(t=>t.destroy()),n.length=0,e=0,l();},pause(){n[e]?.pause();},resume(){n[e]?.resume();},seek(t){n[e]?.seek(t);},getProgress(){return n[e]?.getProgress()??0},refresh(){n.forEach(t=>t.refresh?.());}}}function S(s,o={}){if(typeof window>"u")return a;let r=u(s).map(e=>b$1(e,o));return {destroy(){r.forEach(e=>e.destroy());},replay(){r.forEach(e=>e.replay());},pause(){r.forEach(e=>e.pause());},resume(){r.forEach(e=>e.resume());},seek(e){r.forEach(n=>n.seek(e));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(e=>e.refresh?.());}}}export{d as scrollAnimateGroup,w as scrollAnimateSequence,y as scrollDrawGroup,E as scrollDrawSequence,S as scrollParallaxGroup};
1
+ import {b as b$1}from'../chunk-GVBO5GRD.mjs';import {a as a$1}from'../chunk-LTCJVVSC.mjs';import {b}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';function u(s){return s.map(o=>typeof o=="string"?document.querySelector(o):o).filter(o=>o!==null)}var a={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function y(s,o={}){if(typeof window>"u")return a;let r=u(s).map(e=>b(e,o));return {destroy(){r.forEach(e=>e.destroy());},replay(){r.forEach(e=>e.replay());},pause(){r.forEach(e=>e.pause());},resume(){r.forEach(e=>e.resume());},seek(e){r.forEach(n=>n.seek(e));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(e=>e.refresh?.());}}}function E(s,o={}){if(typeof window>"u")return a;let r=u(s);if(r.length===0)return a;let e=0,n=[];function i(t){return b(r[t],{...o,once:true,onComplete(){o.onComplete?.(),e=Math.min(t+1,r.length-1),e>t&&n[e]?.resume();}})}function l(){r.forEach((t,c)=>{n[c]=i(c);});for(let t=1;t<n.length;t++)n[t].pause();}return l(),{destroy(){n.forEach(t=>t.destroy()),n.length=0;},replay(){n.forEach(t=>t.destroy()),n.length=0,e=0,l();},pause(){n[e]?.pause();},resume(){n[e]?.resume();},seek(t){n[e]?.seek(t);},getProgress(){return n[e]?.getProgress()??0},refresh(){n.forEach(t=>t.refresh?.());}}}function d(s,o){if(typeof window>"u")return a;let r=u(s).map(e=>a$1(e,o));return {destroy(){r.forEach(e=>e.destroy());},replay(){r.forEach(e=>e.replay());},pause(){r.forEach(e=>e.pause());},resume(){r.forEach(e=>e.resume());},seek(e){r.forEach(n=>n.seek(e));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(e=>e.refresh?.());}}}function w(s,o){if(typeof window>"u")return a;let r=u(s);if(r.length===0)return a;let e=0,n=[];function i(t){return a$1(r[t],{...o,once:true,onComplete(){o.onComplete?.(),e=Math.min(t+1,r.length-1),e>t&&n[e]?.resume();}})}function l(){r.forEach((t,c)=>{n[c]=i(c);});for(let t=1;t<n.length;t++)n[t].pause();}return l(),{destroy(){n.forEach(t=>t.destroy()),n.length=0;},replay(){n.forEach(t=>t.destroy()),n.length=0,e=0,l();},pause(){n[e]?.pause();},resume(){n[e]?.resume();},seek(t){n[e]?.seek(t);},getProgress(){return n[e]?.getProgress()??0},refresh(){n.forEach(t=>t.refresh?.());}}}function S(s,o={}){if(typeof window>"u")return a;let r=u(s).map(e=>b$1(e,o));return {destroy(){r.forEach(e=>e.destroy());},replay(){r.forEach(e=>e.replay());},pause(){r.forEach(e=>e.pause());},resume(){r.forEach(e=>e.resume());},seek(e){r.forEach(n=>n.seek(e));},getProgress(){return r[0]?.getProgress()??0},refresh(){r.forEach(e=>e.refresh?.());}}}export{d as scrollAnimateGroup,w as scrollAnimateSequence,y as scrollDrawGroup,E as scrollDrawSequence,S as scrollParallaxGroup};
@@ -1 +1 @@
1
- import {a}from'../chunk-LTCJVVSC.mjs';import'../chunk-OJFWQ6CU.mjs';import'../chunk-YWKPTYSG.mjs';import'../chunk-2PYLM3E7.mjs';import {d}from'../chunk-A4JCC3QQ.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-DM6EDKWH.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import {b}from'../chunk-LFSU6LR3.mjs';var x={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0,refresh:()=>{}};function $(a$1,r={}){if(typeof window>"u")return x;let h=typeof a$1=="string"?document.querySelector(a$1):a$1;if(!h)return b("scrollHorizontal: track element not found:",a$1),x;let o=h,{easing:C="linear",trigger:P={start:"top top",end:"bottom bottom"},scrollContainer:s,respectReducedMotion:R=false,onProgress:v}=r,u=typeof s=="string"?document.querySelector(s):s??null;function b$1(){for(let e=o.parentElement;e;e=e.parentElement)if(window.getComputedStyle(e).position==="sticky")return e;return null}function M(){let e=b$1();if(e){let t=window.getComputedStyle(e);return e.clientWidth-(parseFloat(t.paddingLeft)||0)-(parseFloat(t.paddingRight)||0)}return u?u.clientWidth:document.documentElement.clientWidth||window.innerWidth}function d$1(){return r.distance??o.scrollWidth-M()}function g(){if(r.triggerElement!==void 0){let t=typeof r.triggerElement=="string"?document.querySelector(r.triggerElement):r.triggerElement;if(t)return t;b("scrollHorizontal: triggerElement not found:",r.triggerElement);}let e=b$1();return e?e.parentElement??e:o}let m=d$1(),i=g(),n=a(o,T(m,i)),S=f(),l=null;function T(e,t){return {props:{transform:["translateX(0px)",`translateX(${-e}px)`]},trigger:P,easing:C,native:false,respectReducedMotion:R,...t!==o&&{triggerElement:t},...s!==void 0&&{scrollContainer:s},...v!==void 0&&{onProgress:v}}}function f(){let e=i.getBoundingClientRect(),t=u?e.top-u.getBoundingClientRect().top+u.scrollTop:e.top+window.scrollY;return `${d$1()} ${Math.round(t)} ${Math.round(e.height)}`}function z(){n.destroy();let e=g(),t=e!==i;m=d$1(),i=e,n=a(o,T(m,i)),S=f(),l!==null&&n.seek(l),t&&H();}let p;function W(){(g()!==i||f()!==S)&&z();}function c(){clearTimeout(p),p=setTimeout(W,150);}window.addEventListener("resize",c),window.addEventListener("orientationchange",c);let E=()=>{};function H(){E(),E=d([o,i],c);}return H(),{destroy(){clearTimeout(p),window.removeEventListener("resize",c),window.removeEventListener("orientationchange",c),E(),n.destroy();},replay(){l=null,n.replay();},pause(){n.pause(),l=n.getProgress();},resume(){l=null,n.resume();},seek(e){n.seek(e),l=n.getProgress();},getProgress(){return n.getProgress()},refresh(){z();}}}export{$ as scrollHorizontal};
1
+ import {a}from'../chunk-LTCJVVSC.mjs';import'../chunk-OJFWQ6CU.mjs';import'../chunk-YWKPTYSG.mjs';import'../chunk-2PYLM3E7.mjs';import {d}from'../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 x={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0,refresh:()=>{}};function $(a$1,r={}){if(typeof window>"u")return x;let h=typeof a$1=="string"?document.querySelector(a$1):a$1;if(!h)return b("scrollHorizontal: track element not found:",a$1),x;let o=h,{easing:C="linear",trigger:P={start:"top top",end:"bottom bottom"},scrollContainer:s,respectReducedMotion:R=false,onProgress:v}=r,u=typeof s=="string"?document.querySelector(s):s??null;function b$1(){for(let e=o.parentElement;e;e=e.parentElement)if(window.getComputedStyle(e).position==="sticky")return e;return null}function M(){let e=b$1();if(e){let t=window.getComputedStyle(e);return e.clientWidth-(parseFloat(t.paddingLeft)||0)-(parseFloat(t.paddingRight)||0)}return u?u.clientWidth:document.documentElement.clientWidth||window.innerWidth}function d$1(){return r.distance??o.scrollWidth-M()}function g(){if(r.triggerElement!==void 0){let t=typeof r.triggerElement=="string"?document.querySelector(r.triggerElement):r.triggerElement;if(t)return t;b("scrollHorizontal: triggerElement not found:",r.triggerElement);}let e=b$1();return e?e.parentElement??e:o}let m=d$1(),i=g(),n=a(o,T(m,i)),S=f(),l=null;function T(e,t){return {props:{transform:["translateX(0px)",`translateX(${-e}px)`]},trigger:P,easing:C,native:false,respectReducedMotion:R,...t!==o&&{triggerElement:t},...s!==void 0&&{scrollContainer:s},...v!==void 0&&{onProgress:v}}}function f(){let e=i.getBoundingClientRect(),t=u?e.top-u.getBoundingClientRect().top+u.scrollTop:e.top+window.scrollY;return `${d$1()} ${Math.round(t)} ${Math.round(e.height)}`}function z(){n.destroy();let e=g(),t=e!==i;m=d$1(),i=e,n=a(o,T(m,i)),S=f(),l!==null&&n.seek(l),t&&H();}let p;function W(){(g()!==i||f()!==S)&&z();}function c(){clearTimeout(p),p=setTimeout(W,150);}window.addEventListener("resize",c),window.addEventListener("orientationchange",c);let E=()=>{};function H(){E(),E=d([o,i],c);}return H(),{destroy(){clearTimeout(p),window.removeEventListener("resize",c),window.removeEventListener("orientationchange",c),E(),n.destroy();},replay(){l=null,n.replay();},pause(){n.pause(),l=n.getProgress();},resume(){l=null,n.resume();},seek(e){n.seek(e),l=n.getProgress();},getProgress(){return n.getProgress()},refresh(){z();}}}export{$ as scrollHorizontal};
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- export{a as scrollAnimate,b as scrollParallax}from'./chunk-GVBO5GRD.mjs';export{a as Cinematic}from'./chunk-N6PDF6O6.mjs';export{a as scrollDraw}from'./chunk-OTDD2ROH.mjs';export{a as scrollCounter}from'./chunk-WXUOF4NM.mjs';import'./chunk-LTCJVVSC.mjs';export{a as PRESETS}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-5PJEKEEP.mjs';export{b as createBounce,c as createElastic,a as createSpring}from'./chunk-DM6EDKWH.mjs';import'./chunk-4DOJSIEQ.mjs';import'./chunk-BCV4RAIX.mjs';import'./chunk-LFSU6LR3.mjs';
1
+ export{a as scrollAnimate,b as scrollParallax}from'./chunk-GVBO5GRD.mjs';export{a as Cinematic}from'./chunk-YNNA33A5.mjs';export{a as scrollDraw}from'./chunk-OTDD2ROH.mjs';export{a as scrollCounter}from'./chunk-WXUOF4NM.mjs';import'./chunk-LTCJVVSC.mjs';export{a as PRESETS}from'./chunk-HX4SP5WN.mjs';import'./chunk-OJFWQ6CU.mjs';import'./chunk-YWKPTYSG.mjs';import'./chunk-YZV4Z3EQ.mjs';import'./chunk-2PYLM3E7.mjs';import'./chunk-A4JCC3QQ.mjs';export{b as createBounce,c as createElastic,a as createSpring}from'./chunk-DM6EDKWH.mjs';import'./chunk-5PJEKEEP.mjs';import'./chunk-4DOJSIEQ.mjs';import'./chunk-BCV4RAIX.mjs';import'./chunk-LFSU6LR3.mjs';
@@ -1 +1 @@
1
- import {b,d,f,h,j}from'../chunk-PKY27MO4.mjs';export{d as ScrollAnimate,f as ScrollCounter,b as ScrollDraw,j as ScrollText,h as ScrollVideo,c as useScrollAnimate,e as useScrollCounter,a as useScrollDraw,i as useScrollText,g as useScrollVideo}from'../chunk-PKY27MO4.mjs';import'../chunk-XSVTHCLO.mjs';import'../chunk-VDTAYUAR.mjs';import'../chunk-DY5JCXVR.mjs';import'../chunk-WXUOF4NM.mjs';import'../chunk-LTCJVVSC.mjs';import'../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-5PJEKEEP.mjs';import'../chunk-DM6EDKWH.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import'../chunk-LFSU6LR3.mjs';function s(){return {install(o){o.component("ScrollDraw",b),o.component("ScrollAnimate",d),o.component("ScrollCounter",f),o.component("ScrollVideo",h),o.component("ScrollText",j);}}}export{s as createScrollDrawPlugin};
1
+ import {b,d,f,h,j}from'../chunk-VMUJMXKO.mjs';export{d as ScrollAnimate,f as ScrollCounter,b as ScrollDraw,j as ScrollText,h as ScrollVideo,c as useScrollAnimate,e as useScrollCounter,a as useScrollDraw,i as useScrollText,g as useScrollVideo}from'../chunk-VMUJMXKO.mjs';import'../chunk-XSVTHCLO.mjs';import'../chunk-KV3WCPQ5.mjs';import'../chunk-DY5JCXVR.mjs';import'../chunk-WXUOF4NM.mjs';import'../chunk-LTCJVVSC.mjs';import'../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';function s(){return {install(o){o.component("ScrollDraw",b),o.component("ScrollAnimate",d),o.component("ScrollCounter",f),o.component("ScrollVideo",h),o.component("ScrollText",j);}}}export{s as createScrollDrawPlugin};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import {a as a$2,b as b$1}from'../chunk-XSVTHCLO.mjs';import {a as a$5}from'../chunk-VDTAYUAR.mjs';import {a as a$6}from'../chunk-DY5JCXVR.mjs';import {a as a$4}from'../chunk-WXUOF4NM.mjs';import {a as a$3}from'../chunk-LTCJVVSC.mjs';import {b as b$2}from'../chunk-HX4SP5WN.mjs';import'../chunk-OJFWQ6CU.mjs';import'../chunk-YWKPTYSG.mjs';import'../chunk-YZV4Z3EQ.mjs';import'../chunk-2PYLM3E7.mjs';import {a,c,b}from'../chunk-A4JCC3QQ.mjs';import {a as a$1}from'../chunk-5PJEKEEP.mjs';import {d}from'../chunk-DM6EDKWH.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import'../chunk-LFSU6LR3.mjs';import Z,{useState,useRef,useEffect}from'react';import {jsx}from'react/jsx-runtime';function Q(n,t={}){let[o,e]=useState(0),r=useRef(t);r.current=t;let s=useRef(-1);return useEffect(()=>{if(typeof window>"u")return;if(window.matchMedia("(prefers-reduced-motion: reduce)").matches){e(1);return}let i=typeof n=="string"?document.querySelector(n):n.current;if(!i)return;let u=i,{axis:c$1="y",scrollContainer:E,trigger:A={}}=r.current,a$2=typeof E=="string"?document.querySelector(E):E??null,B=a(A.start??"top bottom"),G=a(A.end??"bottom top"),C=0,D=0,O=false,d$1=0;function N(){return a$2?c$1==="x"?a$2.scrollLeft:a$2.scrollTop:c$1==="x"?window.scrollX:window.scrollY}function J(){return a$2?c$1==="x"?a$2.clientWidth:a$2.clientHeight:c$1==="x"?window.innerWidth:window.innerHeight}function L(){let l=u.getBoundingClientRect(),m=N(),R=c$1==="x"?l.left:l.top,T=c$1==="x"?l.width:l.height,y=c({top:R,height:T},m,J(),B,G);C=y.tStart,D=y.tEnd;}function M(){if(!O)return;let{speed:l=1,easing:m="linear",once:R=false}=r.current,T=typeof m=="function"?m:d[m]??d.linear,y=b(N(),C,D,l),v=T(y);R&&(s.current=Math.max(s.current,v),v=s.current),e(v),d$1=requestAnimationFrame(M);}let b$1=new IntersectionObserver(l=>{l.forEach(m=>{O=m.isIntersecting,O?d$1=requestAnimationFrame(M):cancelAnimationFrame(d$1);});},{root:a$2??null,threshold:0});L(),b$1.observe(u);let x;function S(){clearTimeout(x),x=setTimeout(L,150);}window.addEventListener("resize",S),window.addEventListener("orientationchange",S);let H=a$1(l=>{l&&(H(),cancelAnimationFrame(d$1),b$1.disconnect(),e(1));});return ()=>{H(),cancelAnimationFrame(d$1),clearTimeout(x),b$1.disconnect(),window.removeEventListener("resize",S),window.removeEventListener("orientationchange",S);}},[]),o}function f(n,t,o){let e=useRef(t);e.current=t;let r=a$2(t);useEffect(()=>{if(!n.current)return;let s=o(n.current,b$1(e.current,()=>e.current));return ()=>s.destroy()},[r]);}var ee=/^(data-|aria-)|^(id|role|title|tabIndex|lang|dir|hidden)$/;function g(n){let t={},o={};for(let[e,r]of Object.entries(n))(ee.test(e)?o:t)[e]=r;return [t,o]}function de({children:n,className:t,style:o,...e}){let r=useRef(null),[s,i]=g(e);return f(r,s,b$2),jsx("div",{ref:r,className:t,style:o,...i,children:n})}function fe({children:n,className:t,style:o,...e}){let r=useRef(null),[s,i]=g(e);return f(r,s,a$3),jsx("div",{ref:r,className:t,style:o,...i,children:n})}function ge({className:n,style:t,...o}){let e=useRef(null),[r,s]=g(o);return f(e,r,a$4),jsx("span",{ref:e,className:n,style:t,...s})}function Se({src:n,className:t,style:o,muted:e=true,playsInline:r=true,...s}){let i=useRef(null),[u,c]=g(s);return f(i,u,a$5),jsx("video",{...c,ref:i,src:n,className:t,style:o,muted:e,playsInline:r,preload:"auto"})}function ye({children:n,as:t="p",className:o,style:e,...r}){let s=useRef(null),[i,u]=g(r);return f(s,i,a$6),Z.createElement(t,{...u,ref:s,className:o,style:e},n)}export{fe as ScrollAnimate,ge as ScrollCounter,de as ScrollDraw,ye as ScrollText,Se as ScrollVideo,Q as useScrollDrawProgress};
2
+ import {a as a$2,b as b$1}from'../chunk-XSVTHCLO.mjs';import {a as a$5}from'../chunk-KV3WCPQ5.mjs';import {a as a$6}from'../chunk-DY5JCXVR.mjs';import {a as a$4}from'../chunk-WXUOF4NM.mjs';import {a as a$3}from'../chunk-LTCJVVSC.mjs';import {b as b$2}from'../chunk-HX4SP5WN.mjs';import'../chunk-OJFWQ6CU.mjs';import'../chunk-YWKPTYSG.mjs';import'../chunk-YZV4Z3EQ.mjs';import'../chunk-2PYLM3E7.mjs';import {a,c,b}from'../chunk-A4JCC3QQ.mjs';import {d}from'../chunk-DM6EDKWH.mjs';import {a as a$1}from'../chunk-5PJEKEEP.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import'../chunk-LFSU6LR3.mjs';import Z,{useState,useRef,useEffect}from'react';import {jsx}from'react/jsx-runtime';function Q(n,t={}){let[o,e]=useState(0),r=useRef(t);r.current=t;let s=useRef(-1);return useEffect(()=>{if(typeof window>"u")return;if(window.matchMedia("(prefers-reduced-motion: reduce)").matches){e(1);return}let i=typeof n=="string"?document.querySelector(n):n.current;if(!i)return;let u=i,{axis:c$1="y",scrollContainer:E,trigger:A={}}=r.current,a$2=typeof E=="string"?document.querySelector(E):E??null,B=a(A.start??"top bottom"),G=a(A.end??"bottom top"),C=0,D=0,O=false,d$1=0;function N(){return a$2?c$1==="x"?a$2.scrollLeft:a$2.scrollTop:c$1==="x"?window.scrollX:window.scrollY}function J(){return a$2?c$1==="x"?a$2.clientWidth:a$2.clientHeight:c$1==="x"?window.innerWidth:window.innerHeight}function L(){let l=u.getBoundingClientRect(),m=N(),R=c$1==="x"?l.left:l.top,T=c$1==="x"?l.width:l.height,y=c({top:R,height:T},m,J(),B,G);C=y.tStart,D=y.tEnd;}function M(){if(!O)return;let{speed:l=1,easing:m="linear",once:R=false}=r.current,T=typeof m=="function"?m:d[m]??d.linear,y=b(N(),C,D,l),v=T(y);R&&(s.current=Math.max(s.current,v),v=s.current),e(v),d$1=requestAnimationFrame(M);}let b$1=new IntersectionObserver(l=>{l.forEach(m=>{O=m.isIntersecting,O?d$1=requestAnimationFrame(M):cancelAnimationFrame(d$1);});},{root:a$2??null,threshold:0});L(),b$1.observe(u);let x;function S(){clearTimeout(x),x=setTimeout(L,150);}window.addEventListener("resize",S),window.addEventListener("orientationchange",S);let H=a$1(l=>{l&&(H(),cancelAnimationFrame(d$1),b$1.disconnect(),e(1));});return ()=>{H(),cancelAnimationFrame(d$1),clearTimeout(x),b$1.disconnect(),window.removeEventListener("resize",S),window.removeEventListener("orientationchange",S);}},[]),o}function f(n,t,o){let e=useRef(t);e.current=t;let r=a$2(t);useEffect(()=>{if(!n.current)return;let s=o(n.current,b$1(e.current,()=>e.current));return ()=>s.destroy()},[r]);}var ee=/^(data-|aria-)|^(id|role|title|tabIndex|lang|dir|hidden)$/;function g(n){let t={},o={};for(let[e,r]of Object.entries(n))(ee.test(e)?o:t)[e]=r;return [t,o]}function de({children:n,className:t,style:o,...e}){let r=useRef(null),[s,i]=g(e);return f(r,s,b$2),jsx("div",{ref:r,className:t,style:o,...i,children:n})}function fe({children:n,className:t,style:o,...e}){let r=useRef(null),[s,i]=g(e);return f(r,s,a$3),jsx("div",{ref:r,className:t,style:o,...i,children:n})}function ge({className:n,style:t,...o}){let e=useRef(null),[r,s]=g(o);return f(e,r,a$4),jsx("span",{ref:e,className:n,style:t,...s})}function Se({src:n,className:t,style:o,muted:e=true,playsInline:r=true,...s}){let i=useRef(null),[u,c]=g(s);return f(i,u,a$5),jsx("video",{...c,ref:i,src:n,className:t,style:o,muted:e,playsInline:r,preload:"auto"})}function ye({children:n,as:t="p",className:o,style:e,...r}){let s=useRef(null),[i,u]=g(r);return f(s,i,a$6),Z.createElement(t,{...u,ref:s,className:o,style:e},n)}export{fe as ScrollAnimate,ge as ScrollCounter,de as ScrollDraw,ye as ScrollText,Se as ScrollVideo,Q as useScrollDrawProgress};
@@ -1 +1 @@
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-5PJEKEEP.mjs';import'../chunk-DM6EDKWH.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
+ 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 V(){return typeof window>"u"||typeof window.matchMedia!="function"?false:window.matchMedia("(prefers-reduced-motion: reduce)").matches}var K="4.0.9",G=()=>typeof window<"u"&&typeof document<"u",C=e=>e!==null&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]";function q(e,...n){for(let t of n)if(C(t))for(let o of Object.keys(t)){let i=t[o];C(i)?(C(e[o])||(e[o]={}),q(e[o],i)):e[o]=i;}return e}function L(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),F=false;function P(e,...n){F&&typeof console<"u"&&console.log(`%cScrollReveal: ${e}${n.map(t=>`
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-OMI46IXL.mjs';import'../chunk-AJ22VSHC.mjs';
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 U(){return typeof window>"u"||typeof window.matchMedia!="function"?false:window.matchMedia("(prefers-reduced-motion: reduce)").matches}var K="4.0.9",G=()=>typeof window<"u"&&typeof document<"u",C=e=>e!==null&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]";function q(e,...n){for(let t of n)if(C(t))for(let o of Object.keys(t)){let r=t[o];C(r)?(C(e[o])||(e[o]={}),q(e[o],r)):e[o]=r;}return e}function L(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),F=false;function P(e,...n){F&&typeof console<"u"&&console.log(`%cScrollReveal: ${e}${n.map(t=>`
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-OMI46IXL.mjs';import'../../chunk-AJ22VSHC.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};
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};
@@ -1 +1 @@
1
- import {a}from'../chunk-AJ22VSHC.mjs';import {a as a$1}from'../chunk-5PJEKEEP.mjs';import {d}from'../chunk-DM6EDKWH.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};
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};
@@ -1 +1 @@
1
- import {a,b}from'../chunk-XSVTHCLO.mjs';import {a as a$3}from'../chunk-VDTAYUAR.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-5PJEKEEP.mjs';import'../chunk-DM6EDKWH.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};
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};
@@ -1 +1 @@
1
- import {a as a$4,b as b$1}from'../chunk-XSVTHCLO.mjs';import {a as a$3}from'../chunk-VDTAYUAR.mjs';import {a as a$2}from'../chunk-DY5JCXVR.mjs';import {a as a$1}from'../chunk-WXUOF4NM.mjs';import {a}from'../chunk-LTCJVVSC.mjs';import {b}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-5PJEKEEP.mjs';import'../chunk-DM6EDKWH.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import'../chunk-LFSU6LR3.mjs';function r(n,t,o){let e=t,f=a$4(t),l=o(n,b$1(t,()=>e));return {update(c){e=c;let d=a$4(c);d!==f&&(f=d,l.destroy(),l=o(n,b$1(c,()=>e)));},destroy(){l.destroy();}}}function D(n,t={}){return r(n,t,b)}function I(n={}){let t=null;function o(e){return t=b(e,n),{destroy(){t?.destroy(),t=null;}}}return {action:o,getInstance:()=>t}}function A(n,t){return r(n,t,a)}function H(n){let t=null;function o(e){return t=a(e,n),{destroy(){t?.destroy(),t=null;}}}return {action:o,getInstance:()=>t}}function L(n,t){return r(n,t,a$1)}function M(n){let t=null;function o(e){return t=a$1(e,n),{destroy(){t?.destroy(),t=null;}}}return {action:o,getInstance:()=>t}}function V(n,t={}){return r(n,t,a$3)}function g(n={}){let t=null;function o(e){return t=a$3(e,n),{destroy(){t?.destroy(),t=null;}}}return {action:o,getInstance:()=>t}}function C(n,t={}){return r(n,t,a$2)}function v(n={}){let t=null;function o(e){return t=a$2(e,n),{destroy(){t?.destroy(),t=null;}}}return {action:o,getInstance:()=>t}}export{H as createScrollAnimate,M as createScrollCounter,I as createScrollDraw,v as createScrollText,g as createScrollVideo,A as scrollAnimate,L as scrollCounterAction,D as scrollDraw,C as scrollTextAction,V as scrollVideoAction};
1
+ import {a as a$4,b as b$1}from'../chunk-XSVTHCLO.mjs';import {a as a$3}from'../chunk-KV3WCPQ5.mjs';import {a as a$2}from'../chunk-DY5JCXVR.mjs';import {a as a$1}from'../chunk-WXUOF4NM.mjs';import {a}from'../chunk-LTCJVVSC.mjs';import {b}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';function r(n,t,o){let e=t,f=a$4(t),l=o(n,b$1(t,()=>e));return {update(c){e=c;let d=a$4(c);d!==f&&(f=d,l.destroy(),l=o(n,b$1(c,()=>e)));},destroy(){l.destroy();}}}function D(n,t={}){return r(n,t,b)}function I(n={}){let t=null;function o(e){return t=b(e,n),{destroy(){t?.destroy(),t=null;}}}return {action:o,getInstance:()=>t}}function A(n,t){return r(n,t,a)}function H(n){let t=null;function o(e){return t=a(e,n),{destroy(){t?.destroy(),t=null;}}}return {action:o,getInstance:()=>t}}function L(n,t){return r(n,t,a$1)}function M(n){let t=null;function o(e){return t=a$1(e,n),{destroy(){t?.destroy(),t=null;}}}return {action:o,getInstance:()=>t}}function V(n,t={}){return r(n,t,a$3)}function g(n={}){let t=null;function o(e){return t=a$3(e,n),{destroy(){t?.destroy(),t=null;}}}return {action:o,getInstance:()=>t}}function C(n,t={}){return r(n,t,a$2)}function v(n={}){let t=null;function o(e){return t=a$2(e,n),{destroy(){t?.destroy(),t=null;}}}return {action:o,getInstance:()=>t}}export{H as createScrollAnimate,M as createScrollCounter,I as createScrollDraw,v as createScrollText,g as createScrollVideo,A as scrollAnimate,L as scrollCounterAction,D as scrollDraw,C as scrollTextAction,V as scrollVideoAction};
@@ -1 +1 @@
1
- export{a as scrollText}from'../chunk-DY5JCXVR.mjs';import'../chunk-2PYLM3E7.mjs';import'../chunk-A4JCC3QQ.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-DM6EDKWH.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import'../chunk-LFSU6LR3.mjs';
1
+ export{a as scrollText}from'../chunk-DY5JCXVR.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';
@@ -1,4 +1,4 @@
1
- import {a as a$1}from'../chunk-AJ22VSHC.mjs';import {a as a$3}from'../chunk-YZV4Z3EQ.mjs';import {a,d as d$1,c,b as b$2}from'../chunk-A4JCC3QQ.mjs';import {a as a$2}from'../chunk-5PJEKEEP.mjs';import {d}from'../chunk-DM6EDKWH.mjs';import'../chunk-4DOJSIEQ.mjs';import {a as a$4,b as b$1}from'../chunk-BCV4RAIX.mjs';import {b}from'../chunk-LFSU6LR3.mjs';var le=["#ff90e8","#ffc900","#5865F2","#22c55e","#f59e0b","#ef4444","#aaa","#60a5fa"];function Ae(u,ce){let V={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return V;let W=typeof u=="string"?document.querySelector(u):u;if(!W)return b("timeline: Container not found:",u),V;let s=W,{trigger:_={},speed:pe=1,once:$=false,axis:w="y",tracks:B,onComplete:de,repeat:x,repeatDelay:I=0,loop:L=false,loopDuration:fe=1500,debug:ue=false,label:me,respectReducedMotion:U=true}=ce,ge=a(_.start??"top bottom"),ye=a(_.end??"bottom top"),v=x==="infinite"?1/0:x??0,r,k=L===true?1/0:typeof L=="number"?L:0,a$5=false,A=0,m=k,R=U&&a$1(),be=a$2(e=>{R=U&&e,R&&(a$5=false,clearTimeout(r),r=void 0);}),F=()=>k>0&&!R,z=new Map,C=B.map(e=>{let n=typeof e.easing=="function"?e.easing:d[e.easing??"linear"]??d.linear,i=Array.from(s.querySelectorAll(e.selector)),o=i.map(t=>a$3(t));return i.forEach((t,l)=>{z.has(t)||z.set(t,t.getAttribute("style")??""),t.style.strokeDasharray=`${o[l]}`,t.style.strokeDashoffset=`${o[l]}`,e.fade&&(t.style.opacity="0");}),{...e,elements:i,lengths:o,easeFn:n}});function he(){for(let[e,n]of z)n?e.setAttribute("style",n):e.removeAttribute("style");}let P=0,H=0,T=false,p=false,d$2=0,y=false,b$3=-1,f=0,c$1=null;ue&&(c$1=document.createElement("div"),Object.assign(c$1.style,{position:"fixed",bottom:"16px",left:"16px",zIndex:"9999",background:"rgba(0,0,0,0.88)",backdropFilter:"blur(8px)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:"10px",padding:"10px 14px",fontFamily:"monospace",fontSize:"11px",color:"#fff",minWidth:"240px",pointerEvents:"none",lineHeight:"1.4"}),document.body.appendChild(c$1));function we(e){if(!c$1)return;let n=me??(typeof u=="string"?u:"timeline"),i=B.map(({selector:o,from:t,to:l},q)=>{let g=le[q%le.length],D=l>t?Math.min(1,Math.max(0,(e-t)/(l-t))):0,S=Math.round(D*100);return `<div style="margin:4px 0">
1
+ import {a as a$1}from'../chunk-AJ22VSHC.mjs';import {a as a$3}from'../chunk-YZV4Z3EQ.mjs';import {a,d as d$1,c,b as b$2}from'../chunk-A4JCC3QQ.mjs';import {d}from'../chunk-DM6EDKWH.mjs';import {a as a$2}from'../chunk-5PJEKEEP.mjs';import'../chunk-4DOJSIEQ.mjs';import {a as a$4,b as b$1}from'../chunk-BCV4RAIX.mjs';import {b}from'../chunk-LFSU6LR3.mjs';var le=["#ff90e8","#ffc900","#5865F2","#22c55e","#f59e0b","#ef4444","#aaa","#60a5fa"];function Ae(u,ce){let V={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return V;let W=typeof u=="string"?document.querySelector(u):u;if(!W)return b("timeline: Container not found:",u),V;let s=W,{trigger:_={},speed:pe=1,once:$=false,axis:w="y",tracks:B,onComplete:de,repeat:x,repeatDelay:I=0,loop:L=false,loopDuration:fe=1500,debug:ue=false,label:me,respectReducedMotion:U=true}=ce,ge=a(_.start??"top bottom"),ye=a(_.end??"bottom top"),v=x==="infinite"?1/0:x??0,r,k=L===true?1/0:typeof L=="number"?L:0,a$5=false,A=0,m=k,R=U&&a$1(),be=a$2(e=>{R=U&&e,R&&(a$5=false,clearTimeout(r),r=void 0);}),F=()=>k>0&&!R,z=new Map,C=B.map(e=>{let n=typeof e.easing=="function"?e.easing:d[e.easing??"linear"]??d.linear,i=Array.from(s.querySelectorAll(e.selector)),o=i.map(t=>a$3(t));return i.forEach((t,l)=>{z.has(t)||z.set(t,t.getAttribute("style")??""),t.style.strokeDasharray=`${o[l]}`,t.style.strokeDashoffset=`${o[l]}`,e.fade&&(t.style.opacity="0");}),{...e,elements:i,lengths:o,easeFn:n}});function he(){for(let[e,n]of z)n?e.setAttribute("style",n):e.removeAttribute("style");}let P=0,H=0,T=false,p=false,d$2=0,y=false,b$3=-1,f=0,c$1=null;ue&&(c$1=document.createElement("div"),Object.assign(c$1.style,{position:"fixed",bottom:"16px",left:"16px",zIndex:"9999",background:"rgba(0,0,0,0.88)",backdropFilter:"blur(8px)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:"10px",padding:"10px 14px",fontFamily:"monospace",fontSize:"11px",color:"#fff",minWidth:"240px",pointerEvents:"none",lineHeight:"1.4"}),document.body.appendChild(c$1));function we(e){if(!c$1)return;let n=me??(typeof u=="string"?u:"timeline"),i=B.map(({selector:o,from:t,to:l},q)=>{let g=le[q%le.length],D=l>t?Math.min(1,Math.max(0,(e-t)/(l-t))):0,S=Math.round(D*100);return `<div style="margin:4px 0">
2
2
  <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:2px">
3
3
  <span style="color:${g};max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">${o}</span>
4
4
  <span style="color:#666;margin-left:8px">${S}%</span>
@@ -1 +1 @@
1
- export{a as scrollVideo}from'../chunk-VDTAYUAR.mjs';import'../chunk-A4JCC3QQ.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-DM6EDKWH.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import'../chunk-LFSU6LR3.mjs';
1
+ export{a as scrollVideo}from'../chunk-KV3WCPQ5.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';
@@ -1,2 +1,2 @@
1
- 'use strict';Object.defineProperty(exports,'__esModule',{value:true});function g(){return typeof window>"u"||typeof window.matchMedia!="function"?false:window.matchMedia("(prefers-reduced-motion: reduce)").matches}var w=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function p(r,...t){w&&console.warn(`[svg-scroll-draw] ${r}`,...t);}var E=["delayed","sync","async","nsync","oneByOne","scenario","scenario-sync"],V=["inViewport","manual","autostart"];function u(r,t){let e=parseInt(r,10);return e>=0?e:t}function $(r){if(typeof window>"u")return false;let t=window,e=n=>typeof t[n]=="function"&&r instanceof t[n];return e("SVGSVGElement")||e("SVGGElement")||r?.constructor===t.SVGElement}var y=["cx","cy","points","r","rx","ry","x","x1","x2","y","y1","y2"],A=["line","ellipse","circle","polygon","polyline","rect"],S="http://www.w3.org/2000/svg";function v(r){let t=r.points.trim().split(" ");if(r.points.indexOf(",")===-1){let n=[];for(let s=0;s<t.length;s+=2)n.push(`${t[s]},${t[s+1]}`);t=n;}let e=`M${t[0]}`;for(let n=1;n<t.length;n++)t[n].indexOf(",")!==-1&&(e+=`L${t[n]}`);return e}function b(r,t,e,n){let s=parseFloat(e)||0,a=parseFloat(n)||0,i=parseFloat(r)||0,o=parseFloat(t)||0,l=i-s,h=i+s;return `M${l},${o}A${s},${a} 0,1,1 ${h},${o}A${s},${a} 0,1,1 ${l},${o}`}var x={line:r=>`M${r.x1||0},${r.y1||0}L${r.x2||0},${r.y2||0}`,rect(r){let t=parseFloat(r.x)||0,e=parseFloat(r.y)||0,n=parseFloat(r.width)||0,s=parseFloat(r.height)||0;if(r.rx||r.ry){let a=parseInt(r.rx,10)||-1,i=parseInt(r.ry,10)||-1;a=Math.min(Math.max(a<0?i:a,0),n/2),i=Math.min(Math.max(i<0?a:i,0),s/2);let o=`A ${a},${i},0,0,1,`;return `M ${t+a},${e} L ${t+n-a},${e} ${o}${t+n},${e+i} L ${t+n},${e+s-i} ${o}${t+n-a},${e+s} L ${t+a},${e+s} ${o}${t},${e+s-i} L ${t},${e+i} ${o}${t+a},${e}`}return `M${t} ${e} L${t+n} ${e} L${t+n} ${e+s} L${t} ${e+s} Z`},polyline:v,polygon:r=>`${v(r)}Z`,ellipse:r=>b(r.cx,r.cy,r.rx,r.ry),circle:r=>b(r.cx,r.cy,r.r,r.r)};function L(r){for(let t of Array.from(r.querySelectorAll(A.join(",")))){let e={};for(let{name:a,value:i}of Array.from(t.attributes)){if(y.indexOf(a)!==-1&&i.indexOf("%")!==-1)throw new Error("Pathformer [parseAttr]: a SVG shape got values in percentage. This cannot be transformed into 'path' tags. Please use 'viewBox'.");e[a]=i;}let n=x[t.tagName.toLowerCase()](e),s=document.createElementNS(S,"path");for(let{name:a,value:i}of Array.from(t.attributes))y.indexOf(a)===-1&&s.setAttribute(a,i);s.setAttribute("d",n),t.parentNode?.replaceChild(s,t);}}var c=class c{constructor(t,e,n){this.isReady=false;this.type="delayed";this.start="inViewport";this.duration=120;this.delay=null;this.dashGap=1;this.forceRender=false;this.reverseStack=false;this.selfDestroy=false;this.ignoreInvisible=false;this.animTimingFunction=c.LINEAR;this.pathTimingFunction=c.LINEAR;this.callback=()=>{};this.map=[];this.frameLength=0;this.currentFrame=0;this.delayUnit=0;this.speed=1;this.handle=null;this.instanceCallback=null;this.mustRecalcScale=null;this.viewportListener=null;this.setElement(t,e),this.setOptions(e),this.setCallback(n),this.isReady&&this.init();}setElement(t,e){if(t===void 0)throw new Error('Vivus [constructor]: "element" parameter is required');let n=t;if(typeof n=="string"){let s=document.getElementById(n);if(!s)throw new Error('Vivus [constructor]: "element" parameter is not related to an existing ID');n=s;}if(this.parentEl=n,e&&e.file){let s=new XMLHttpRequest;s.addEventListener("load",()=>{let a=document.createElement("div");a.innerHTML=s.responseText;let i=a.querySelector("svg");if(!i)throw new Error(`Vivus [load]: Cannot find the SVG in the loaded file : ${e.file}`);this.el=i,i.setAttribute("width","100%"),i.setAttribute("height","100%"),this.parentEl.appendChild(i),this.isReady=true,this.init();}),s.open("GET",e.file),s.send();return}if($(n)){this.el=n,this.isReady=true;return}if(n instanceof HTMLObjectElement){let s=n,a=i=>{if(this.isReady)return;let o=s.contentDocument&&s.contentDocument.querySelector("svg");if(!o&&i)throw new Error("Vivus [constructor]: object loaded does not contain any SVG");o&&(s.getAttribute("built-by-vivus")&&(this.parentEl.insertBefore(o,s),this.parentEl.removeChild(s),o.setAttribute("width","100%"),o.setAttribute("height","100%")),this.el=o,this.isReady=true,this.init());};a(),this.isReady||s.addEventListener("load",a);return}throw new Error('Vivus [constructor]: "element" parameter is not valid (or miss the "file" attribute)')}setOptions(t){if(t!==void 0&&(t===null||t.constructor!==Object))throw new Error('Vivus [constructor]: "options" parameter must be an object');let e=t||{};if(e.type&&E.indexOf(e.type)===-1)throw new Error(`Vivus [constructor]: ${e.type} is not an existing animation \`type\``);if(e.start&&V.indexOf(e.start)===-1)throw new Error(`Vivus [constructor]: ${e.start} is not an existing \`start\` option`);this.type=e.type||"delayed",this.start=e.start||"inViewport";let n=navigator.userAgent,s=n.indexOf("MSIE")!==-1||n.indexOf("Trident/")!==-1||n.indexOf("Edge/")!==-1;if(this.duration=u(e.duration,120),this.delay=u(e.delay,null),this.dashGap=u(e.dashGap,1),this.forceRender=Object.prototype.hasOwnProperty.call(e,"forceRender")?!!e.forceRender:s,this.reverseStack=!!e.reverseStack,this.selfDestroy=!!e.selfDestroy,this.onReady=e.onReady,this.map=[],this.ignoreInvisible=Object.prototype.hasOwnProperty.call(e,"ignoreInvisible")?!!e.ignoreInvisible:false,this.animTimingFunction=e.animTimingFunction||c.LINEAR,this.pathTimingFunction=e.pathTimingFunction||c.LINEAR,this.delay!==null&&this.delay>=this.duration)throw new Error("Vivus [constructor]: delay must be shorter than duration")}setCallback(t){if(t&&typeof t!="function")throw new Error('Vivus [constructor]: "callback" parameter must be a function');this.callback=t||(()=>{});}mapping(){let t=0,e=0,n=0,s=false,a=Array.from(this.el.querySelectorAll("path"));a.forEach((i,o)=>{if(this.isInvisible(i))return;let l={el:i,length:0,startAt:0,duration:0,isResizeSensitive:false},h=1;if(i.getAttribute("vector-effect")==="non-scaling-stroke"){let d=i.getBoundingClientRect(),f=i.getBBox();h=Math.max(d.width/f.width,d.height/f.height),l.isResizeSensitive=true,s=true;}if(l.length=Math.ceil(i.getTotalLength()*h),isNaN(l.length)){p("vivus: cannot retrieve a path element length",i);return}this.map.push(l),i.style.strokeDasharray=`${l.length} ${l.length+this.dashGap*2}`,i.style.strokeDashoffset=String(l.length+this.dashGap),l.length+=this.dashGap,e+=l.length,this.renderPath(o);}),s&&p("vivus: this SVG contains non-scaling-strokes. Call instance.recalc() when the SVG is resized."),e=e===0?1:e,this.delay=this.delay===null?this.duration/3:this.delay,this.delayUnit=this.delay/(a.length>1?a.length-1:1),this.reverseStack&&this.map.reverse(),this.map.forEach((i,o)=>{let l=()=>{let h={};for(let{name:d,value:f}of Array.from(i.el.attributes))h[d]=f;return h};switch(this.type){case "delayed":i.startAt=this.delayUnit*o,i.duration=this.duration-this.delay;break;case "oneByOne":i.startAt=n/e*this.duration,i.duration=i.length/e*this.duration;break;case "sync":case "async":case "nsync":i.startAt=0,i.duration=this.duration;break;case "scenario-sync":{let h=l();i.startAt=t+(u(h["data-delay"],this.delayUnit)||0),i.duration=u(h["data-duration"],this.duration),t=h["data-async"]!==void 0?i.startAt:i.startAt+i.duration,this.frameLength=Math.max(this.frameLength,i.startAt+i.duration);break}case "scenario":{let h=l();i.startAt=u(h["data-start"],this.delayUnit)||0,i.duration=u(h["data-duration"],this.duration),this.frameLength=Math.max(this.frameLength,i.startAt+i.duration);break}}n+=i.length,this.frameLength=this.frameLength||this.duration;});}recalc(){this.mustRecalcScale||(this.mustRecalcScale=requestAnimationFrame(()=>this.performLineRecalc()));}performLineRecalc(){for(let t of this.map){if(!t.isResizeSensitive)continue;let e=t.el.getBoundingClientRect(),n=t.el.getBBox(),s=Math.max(e.width/n.width,e.height/n.height);t.length=Math.ceil(t.el.getTotalLength()*s),t.el.style.strokeDasharray=`${t.length} ${t.length+this.dashGap*2}`;}this.trace(),this.mustRecalcScale=null;}draw(){if(this.currentFrame+=this.speed,this.currentFrame<=0)this.stop(),this.reset();else if(this.currentFrame>=this.frameLength)this.stop(),this.currentFrame=this.frameLength,this.trace(),this.selfDestroy&&this.destroy();else {this.trace(),this.handle=requestAnimationFrame(()=>this.draw());return}this.finished();}finished(){if(this.callback(this),this.instanceCallback){let t=this.instanceCallback;this.instanceCallback=null,t(this);}}trace(){let t=this.animTimingFunction(this.currentFrame/this.frameLength)*this.frameLength;this.map.forEach((e,n)=>{let s=this.pathTimingFunction(Math.max(0,Math.min(1,(t-e.startAt)/e.duration)));e.progress!==s&&(e.progress=s,e.el.style.strokeDashoffset=String(Math.floor(e.length*(1-s))),this.renderPath(n));});}renderPath(t){let e=this.forceRender&&this.map&&this.map[t];if(!e)return;let n=e.el.cloneNode(true);e.el.parentNode?.replaceChild(n,e.el),e.el=n;}init(){this.frameLength=0,this.currentFrame=0,this.map=[],L(this.el),this.mapping(),this.starter(),this.onReady&&this.onReady(this);}starter(){if(this.start==="manual")return;if(this.start==="autostart"){this.play();return}let t=()=>{this.isInViewport(this.parentEl,1)&&(this.play(),window.removeEventListener("scroll",t),this.viewportListener=null);};this.viewportListener=t,window.addEventListener("scroll",t),t();}getStatus(){return this.currentFrame===0?"start":this.currentFrame===this.frameLength?"end":"progress"}reset(){return this.setFrameProgress(0)}finish(){return this.setFrameProgress(1)}setFrameProgress(t){let e=Math.min(1,Math.max(0,t));return this.currentFrame=Math.round(this.frameLength*e),this.trace(),this}play(t,e){this.instanceCallback=null;let n=t;if(n&&typeof n=="function")this.instanceCallback=n,n=void 0;else if(n&&typeof n!="number")throw new Error("Vivus [play]: invalid speed");return e&&typeof e=="function"&&!this.instanceCallback&&(this.instanceCallback=e),this.speed=n||1,g()?(this.stop(),this.currentFrame=this.speed<0?0:this.frameLength,this.trace(),this.speed>0&&this.selfDestroy&&this.destroy(),this.finished(),this):(this.handle||this.draw(),this)}stop(){return this.handle&&(cancelAnimationFrame(this.handle),this.handle=null),this}destroy(){this.stop(),this.viewportListener&&(window.removeEventListener("scroll",this.viewportListener),this.viewportListener=null),this.map.forEach((t,e)=>{t.el.style.strokeDashoffset="",t.el.style.strokeDasharray="",this.renderPath(e);});}isInvisible(t){let e=t.getAttribute("data-ignore");if(e!==null)return e!=="false";if(this.ignoreInvisible){let n=t.getBoundingClientRect();return !n.width&&!n.height}return false}isInViewport(t,e=0){let n=window.pageYOffset||document.documentElement.scrollTop,s=n+Math.max(document.documentElement.clientHeight,window.innerHeight),a=t.getBoundingClientRect(),i=n+a.top;return i+a.height*(e||0)<=s&&i+a.height>=n}};c.LINEAR=t=>t,c.EASE=t=>-Math.cos(t*Math.PI)/2+.5,c.EASE_OUT=t=>1-Math.pow(1-t,3),c.EASE_IN=t=>Math.pow(t,3),c.EASE_OUT_BOUNCE=t=>{let e=-Math.cos(t*(.5*Math.PI))+1,n=Math.pow(e,1.5),s=Math.pow(1-t,2),a=-Math.abs(Math.cos(n*(2.5*Math.PI)))+1;return 1-s+a*s};var m=c,O=m;
2
- exports.Vivus=m;exports.default=O;
1
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});function g(){return typeof window>"u"||typeof window.matchMedia!="function"?false:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function y(r){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let t=window.matchMedia("(prefers-reduced-motion: reduce)"),e=s=>r(!!s.matches);if(typeof t.addEventListener=="function")return t.addEventListener("change",e),()=>t.removeEventListener("change",e);let i=t;return i.addListener?.(e),()=>i.removeListener?.(e)}var E=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function m(r,...t){E&&console.warn(`[svg-scroll-draw] ${r}`,...t);}var L=["delayed","sync","async","nsync","oneByOne","scenario","scenario-sync"],V=["inViewport","manual","autostart"];function u(r,t){let e=parseInt(r,10);return e>=0?e:t}function M(r){if(typeof window>"u")return false;let t=window,e=i=>typeof t[i]=="function"&&r instanceof t[i];return e("SVGSVGElement")||e("SVGGElement")||r?.constructor===t.SVGElement}var v=["cx","cy","points","r","rx","ry","x","x1","x2","y","y1","y2"],$=["line","ellipse","circle","polygon","polyline","rect"],R="http://www.w3.org/2000/svg";function w(r){let t=r.points.trim().split(" ");if(r.points.indexOf(",")===-1){let i=[];for(let s=0;s<t.length;s+=2)i.push(`${t[s]},${t[s+1]}`);t=i;}let e=`M${t[0]}`;for(let i=1;i<t.length;i++)t[i].indexOf(",")!==-1&&(e+=`L${t[i]}`);return e}function b(r,t,e,i){let s=parseFloat(e)||0,a=parseFloat(i)||0,n=parseFloat(r)||0,o=parseFloat(t)||0,h=n-s,l=n+s;return `M${h},${o}A${s},${a} 0,1,1 ${l},${o}A${s},${a} 0,1,1 ${h},${o}`}var x={line:r=>`M${r.x1||0},${r.y1||0}L${r.x2||0},${r.y2||0}`,rect(r){let t=parseFloat(r.x)||0,e=parseFloat(r.y)||0,i=parseFloat(r.width)||0,s=parseFloat(r.height)||0;if(r.rx||r.ry){let a=parseInt(r.rx,10)||-1,n=parseInt(r.ry,10)||-1;a=Math.min(Math.max(a<0?n:a,0),i/2),n=Math.min(Math.max(n<0?a:n,0),s/2);let o=`A ${a},${n},0,0,1,`;return `M ${t+a},${e} L ${t+i-a},${e} ${o}${t+i},${e+n} L ${t+i},${e+s-n} ${o}${t+i-a},${e+s} L ${t+a},${e+s} ${o}${t},${e+s-n} L ${t},${e+n} ${o}${t+a},${e}`}return `M${t} ${e} L${t+i} ${e} L${t+i} ${e+s} L${t} ${e+s} Z`},polyline:w,polygon:r=>`${w(r)}Z`,ellipse:r=>b(r.cx,r.cy,r.rx,r.ry),circle:r=>b(r.cx,r.cy,r.r,r.r)};function A(r){for(let t of Array.from(r.querySelectorAll($.join(",")))){let e={};for(let{name:a,value:n}of Array.from(t.attributes)){if(v.indexOf(a)!==-1&&n.indexOf("%")!==-1)throw new Error("Pathformer [parseAttr]: a SVG shape got values in percentage. This cannot be transformed into 'path' tags. Please use 'viewBox'.");e[a]=n;}let i=x[t.tagName.toLowerCase()](e),s=document.createElementNS(R,"path");for(let{name:a,value:n}of Array.from(t.attributes))v.indexOf(a)===-1&&s.setAttribute(a,n);s.setAttribute("d",i),t.parentNode?.replaceChild(s,t);}}var c=class c{constructor(t,e,i){this.isReady=false;this.type="delayed";this.start="inViewport";this.duration=120;this.delay=null;this.dashGap=1;this.forceRender=false;this.reverseStack=false;this.selfDestroy=false;this.ignoreInvisible=false;this.animTimingFunction=c.LINEAR;this.pathTimingFunction=c.LINEAR;this.callback=()=>{};this.map=[];this.frameLength=0;this.currentFrame=0;this.delayUnit=0;this.speed=1;this.handle=null;this.instanceCallback=null;this.mustRecalcScale=null;this.viewportListener=null;this.unwatchMotion=()=>{};this.setElement(t,e),this.setOptions(e),this.setCallback(i),this.isReady&&this.init(),this.unwatchMotion=y(s=>{s&&this.handle&&this.endNow();});}endNow(){this.stop(),this.currentFrame=this.speed<0?0:this.frameLength,this.trace(),this.speed>0&&this.selfDestroy&&this.destroy(),this.finished();}setElement(t,e){if(t===void 0)throw new Error('Vivus [constructor]: "element" parameter is required');let i=t;if(typeof i=="string"){let s=document.getElementById(i);if(!s)throw new Error('Vivus [constructor]: "element" parameter is not related to an existing ID');i=s;}if(this.parentEl=i,e&&e.file){let s=new XMLHttpRequest;s.addEventListener("load",()=>{let a=document.createElement("div");a.innerHTML=s.responseText;let n=a.querySelector("svg");if(!n)throw new Error(`Vivus [load]: Cannot find the SVG in the loaded file : ${e.file}`);this.el=n,n.setAttribute("width","100%"),n.setAttribute("height","100%"),this.parentEl.appendChild(n),this.isReady=true,this.init();}),s.open("GET",e.file),s.send();return}if(M(i)){this.el=i,this.isReady=true;return}if(i instanceof HTMLObjectElement){let s=i,a=n=>{if(this.isReady)return;let o=s.contentDocument&&s.contentDocument.querySelector("svg");if(!o&&n)throw new Error("Vivus [constructor]: object loaded does not contain any SVG");o&&(s.getAttribute("built-by-vivus")&&(this.parentEl.insertBefore(o,s),this.parentEl.removeChild(s),o.setAttribute("width","100%"),o.setAttribute("height","100%")),this.el=o,this.isReady=true,this.init());};a(),this.isReady||s.addEventListener("load",a);return}throw new Error('Vivus [constructor]: "element" parameter is not valid (or miss the "file" attribute)')}setOptions(t){if(t!==void 0&&(t===null||t.constructor!==Object))throw new Error('Vivus [constructor]: "options" parameter must be an object');let e=t||{};if(e.type&&L.indexOf(e.type)===-1)throw new Error(`Vivus [constructor]: ${e.type} is not an existing animation \`type\``);if(e.start&&V.indexOf(e.start)===-1)throw new Error(`Vivus [constructor]: ${e.start} is not an existing \`start\` option`);this.type=e.type||"delayed",this.start=e.start||"inViewport";let i=navigator.userAgent,s=i.indexOf("MSIE")!==-1||i.indexOf("Trident/")!==-1||i.indexOf("Edge/")!==-1;if(this.duration=u(e.duration,120),this.delay=u(e.delay,null),this.dashGap=u(e.dashGap,1),this.forceRender=Object.prototype.hasOwnProperty.call(e,"forceRender")?!!e.forceRender:s,this.reverseStack=!!e.reverseStack,this.selfDestroy=!!e.selfDestroy,this.onReady=e.onReady,this.map=[],this.ignoreInvisible=Object.prototype.hasOwnProperty.call(e,"ignoreInvisible")?!!e.ignoreInvisible:false,this.animTimingFunction=e.animTimingFunction||c.LINEAR,this.pathTimingFunction=e.pathTimingFunction||c.LINEAR,this.delay!==null&&this.delay>=this.duration)throw new Error("Vivus [constructor]: delay must be shorter than duration")}setCallback(t){if(t&&typeof t!="function")throw new Error('Vivus [constructor]: "callback" parameter must be a function');this.callback=t||(()=>{});}mapping(){let t=0,e=0,i=0,s=false,a=Array.from(this.el.querySelectorAll("path"));a.forEach((n,o)=>{if(this.isInvisible(n))return;let h={el:n,length:0,startAt:0,duration:0,isResizeSensitive:false},l=1;if(n.getAttribute("vector-effect")==="non-scaling-stroke"){let d=n.getBoundingClientRect(),f=n.getBBox();l=Math.max(d.width/f.width,d.height/f.height),h.isResizeSensitive=true,s=true;}if(h.length=Math.ceil(n.getTotalLength()*l),isNaN(h.length)){m("vivus: cannot retrieve a path element length",n);return}this.map.push(h),n.style.strokeDasharray=`${h.length} ${h.length+this.dashGap*2}`,n.style.strokeDashoffset=String(h.length+this.dashGap),h.length+=this.dashGap,e+=h.length,this.renderPath(o);}),s&&m("vivus: this SVG contains non-scaling-strokes. Call instance.recalc() when the SVG is resized."),e=e===0?1:e,this.delay=this.delay===null?this.duration/3:this.delay,this.delayUnit=this.delay/(a.length>1?a.length-1:1),this.reverseStack&&this.map.reverse(),this.map.forEach((n,o)=>{let h=()=>{let l={};for(let{name:d,value:f}of Array.from(n.el.attributes))l[d]=f;return l};switch(this.type){case "delayed":n.startAt=this.delayUnit*o,n.duration=this.duration-this.delay;break;case "oneByOne":n.startAt=i/e*this.duration,n.duration=n.length/e*this.duration;break;case "sync":case "async":case "nsync":n.startAt=0,n.duration=this.duration;break;case "scenario-sync":{let l=h();n.startAt=t+(u(l["data-delay"],this.delayUnit)||0),n.duration=u(l["data-duration"],this.duration),t=l["data-async"]!==void 0?n.startAt:n.startAt+n.duration,this.frameLength=Math.max(this.frameLength,n.startAt+n.duration);break}case "scenario":{let l=h();n.startAt=u(l["data-start"],this.delayUnit)||0,n.duration=u(l["data-duration"],this.duration),this.frameLength=Math.max(this.frameLength,n.startAt+n.duration);break}}i+=n.length,this.frameLength=this.frameLength||this.duration;});}recalc(){this.mustRecalcScale||(this.mustRecalcScale=requestAnimationFrame(()=>this.performLineRecalc()));}performLineRecalc(){for(let t of this.map){if(!t.isResizeSensitive)continue;let e=t.el.getBoundingClientRect(),i=t.el.getBBox(),s=Math.max(e.width/i.width,e.height/i.height);t.length=Math.ceil(t.el.getTotalLength()*s),t.el.style.strokeDasharray=`${t.length} ${t.length+this.dashGap*2}`;}this.trace(),this.mustRecalcScale=null;}draw(){if(this.currentFrame+=this.speed,this.currentFrame<=0)this.stop(),this.reset();else if(this.currentFrame>=this.frameLength)this.stop(),this.currentFrame=this.frameLength,this.trace(),this.selfDestroy&&this.destroy();else {this.trace(),this.handle=requestAnimationFrame(()=>this.draw());return}this.finished();}finished(){if(this.callback(this),this.instanceCallback){let t=this.instanceCallback;this.instanceCallback=null,t(this);}}trace(){let t=this.animTimingFunction(this.currentFrame/this.frameLength)*this.frameLength;this.map.forEach((e,i)=>{let s=this.pathTimingFunction(Math.max(0,Math.min(1,(t-e.startAt)/e.duration)));e.progress!==s&&(e.progress=s,e.el.style.strokeDashoffset=String(Math.floor(e.length*(1-s))),this.renderPath(i));});}renderPath(t){let e=this.forceRender&&this.map&&this.map[t];if(!e)return;let i=e.el.cloneNode(true);e.el.parentNode?.replaceChild(i,e.el),e.el=i;}init(){this.frameLength=0,this.currentFrame=0,this.map=[],A(this.el),this.mapping(),this.starter(),this.onReady&&this.onReady(this);}starter(){if(this.start==="manual")return;if(this.start==="autostart"){this.play();return}let t=()=>{this.isInViewport(this.parentEl,1)&&(this.play(),window.removeEventListener("scroll",t),this.viewportListener=null);};this.viewportListener=t,window.addEventListener("scroll",t),t();}getStatus(){return this.currentFrame===0?"start":this.currentFrame===this.frameLength?"end":"progress"}reset(){return this.setFrameProgress(0)}finish(){return this.setFrameProgress(1)}setFrameProgress(t){let e=Math.min(1,Math.max(0,t));return this.currentFrame=Math.round(this.frameLength*e),this.trace(),this}play(t,e){this.instanceCallback=null;let i=t;if(i&&typeof i=="function")this.instanceCallback=i,i=void 0;else if(i&&typeof i!="number")throw new Error("Vivus [play]: invalid speed");return e&&typeof e=="function"&&!this.instanceCallback&&(this.instanceCallback=e),this.speed=i||1,g()?(this.endNow(),this):(this.handle||this.draw(),this)}stop(){return this.handle&&(cancelAnimationFrame(this.handle),this.handle=null),this}destroy(){this.stop(),this.unwatchMotion(),this.viewportListener&&(window.removeEventListener("scroll",this.viewportListener),this.viewportListener=null),this.map.forEach((t,e)=>{t.el.style.strokeDashoffset="",t.el.style.strokeDasharray="",this.renderPath(e);});}isInvisible(t){let e=t.getAttribute("data-ignore");if(e!==null)return e!=="false";if(this.ignoreInvisible){let i=t.getBoundingClientRect();return !i.width&&!i.height}return false}isInViewport(t,e=0){let i=window.pageYOffset||document.documentElement.scrollTop,s=i+Math.max(document.documentElement.clientHeight,window.innerHeight),a=t.getBoundingClientRect(),n=i+a.top;return n+a.height*(e||0)<=s&&n+a.height>=i}};c.LINEAR=t=>t,c.EASE=t=>-Math.cos(t*Math.PI)/2+.5,c.EASE_OUT=t=>1-Math.pow(1-t,3),c.EASE_IN=t=>Math.pow(t,3),c.EASE_OUT_BOUNCE=t=>{let e=-Math.cos(t*(.5*Math.PI))+1,i=Math.pow(e,1.5),s=Math.pow(1-t,2),a=-Math.abs(Math.cos(i*(2.5*Math.PI)))+1;return 1-s+a*s};var p=c,I=p;
2
+ exports.Vivus=p;exports.default=I;
@@ -61,7 +61,10 @@ declare class Vivus {
61
61
  private instanceCallback;
62
62
  private mustRecalcScale;
63
63
  private viewportListener;
64
+ private unwatchMotion;
64
65
  constructor(element: string | Element, options?: VivusOptions, callback?: VivusCallback);
66
+ /** The exact end (or start, playing backwards), the callbacks, as under reduced motion. */
67
+ private endNow;
65
68
  private setElement;
66
69
  private setOptions;
67
70
  private setCallback;
@@ -61,7 +61,10 @@ declare class Vivus {
61
61
  private instanceCallback;
62
62
  private mustRecalcScale;
63
63
  private viewportListener;
64
+ private unwatchMotion;
64
65
  constructor(element: string | Element, options?: VivusOptions, callback?: VivusCallback);
66
+ /** The exact end (or start, playing backwards), the callbacks, as under reduced motion. */
67
+ private endNow;
65
68
  private setElement;
66
69
  private setOptions;
67
70
  private setCallback;
@@ -1 +1 @@
1
- export{a as Vivus,b as default}from'../chunk-4T5R3ZTL.mjs';import'../chunk-AJ22VSHC.mjs';import'../chunk-LFSU6LR3.mjs';
1
+ export{a as Vivus,b as default}from'../chunk-EAWFBJUR.mjs';import'../chunk-AJ22VSHC.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-LFSU6LR3.mjs';
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- 'use strict';var react=require('react');function y(){return typeof window>"u"||typeof window.matchMedia!="function"?false:window.matchMedia("(prefers-reduced-motion: reduce)").matches}var V=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function p(r,...t){V&&console.warn(`[svg-scroll-draw] ${r}`,...t);}var S=["delayed","sync","async","nsync","oneByOne","scenario","scenario-sync"],R=["inViewport","manual","autostart"];function u(r,t){let e=parseInt(r,10);return e>=0?e:t}function $(r){if(typeof window>"u")return false;let t=window,e=n=>typeof t[n]=="function"&&r instanceof t[n];return e("SVGSVGElement")||e("SVGGElement")||r?.constructor===t.SVGElement}var v=["cx","cy","points","r","rx","ry","x","x1","x2","y","y1","y2"],x=["line","ellipse","circle","polygon","polyline","rect"],A="http://www.w3.org/2000/svg";function b(r){let t=r.points.trim().split(" ");if(r.points.indexOf(",")===-1){let n=[];for(let s=0;s<t.length;s+=2)n.push(`${t[s]},${t[s+1]}`);t=n;}let e=`M${t[0]}`;for(let n=1;n<t.length;n++)t[n].indexOf(",")!==-1&&(e+=`L${t[n]}`);return e}function w(r,t,e,n){let s=parseFloat(e)||0,a=parseFloat(n)||0,i=parseFloat(r)||0,o=parseFloat(t)||0,l=i-s,h=i+s;return `M${l},${o}A${s},${a} 0,1,1 ${h},${o}A${s},${a} 0,1,1 ${l},${o}`}var L={line:r=>`M${r.x1||0},${r.y1||0}L${r.x2||0},${r.y2||0}`,rect(r){let t=parseFloat(r.x)||0,e=parseFloat(r.y)||0,n=parseFloat(r.width)||0,s=parseFloat(r.height)||0;if(r.rx||r.ry){let a=parseInt(r.rx,10)||-1,i=parseInt(r.ry,10)||-1;a=Math.min(Math.max(a<0?i:a,0),n/2),i=Math.min(Math.max(i<0?a:i,0),s/2);let o=`A ${a},${i},0,0,1,`;return `M ${t+a},${e} L ${t+n-a},${e} ${o}${t+n},${e+i} L ${t+n},${e+s-i} ${o}${t+n-a},${e+s} L ${t+a},${e+s} ${o}${t},${e+s-i} L ${t},${e+i} ${o}${t+a},${e}`}return `M${t} ${e} L${t+n} ${e} L${t+n} ${e+s} L${t} ${e+s} Z`},polyline:b,polygon:r=>`${b(r)}Z`,ellipse:r=>w(r.cx,r.cy,r.rx,r.ry),circle:r=>w(r.cx,r.cy,r.r,r.r)};function T(r){for(let t of Array.from(r.querySelectorAll(x.join(",")))){let e={};for(let{name:a,value:i}of Array.from(t.attributes)){if(v.indexOf(a)!==-1&&i.indexOf("%")!==-1)throw new Error("Pathformer [parseAttr]: a SVG shape got values in percentage. This cannot be transformed into 'path' tags. Please use 'viewBox'.");e[a]=i;}let n=L[t.tagName.toLowerCase()](e),s=document.createElementNS(A,"path");for(let{name:a,value:i}of Array.from(t.attributes))v.indexOf(a)===-1&&s.setAttribute(a,i);s.setAttribute("d",n),t.parentNode?.replaceChild(s,t);}}var c=class c{constructor(t,e,n){this.isReady=false;this.type="delayed";this.start="inViewport";this.duration=120;this.delay=null;this.dashGap=1;this.forceRender=false;this.reverseStack=false;this.selfDestroy=false;this.ignoreInvisible=false;this.animTimingFunction=c.LINEAR;this.pathTimingFunction=c.LINEAR;this.callback=()=>{};this.map=[];this.frameLength=0;this.currentFrame=0;this.delayUnit=0;this.speed=1;this.handle=null;this.instanceCallback=null;this.mustRecalcScale=null;this.viewportListener=null;this.setElement(t,e),this.setOptions(e),this.setCallback(n),this.isReady&&this.init();}setElement(t,e){if(t===void 0)throw new Error('Vivus [constructor]: "element" parameter is required');let n=t;if(typeof n=="string"){let s=document.getElementById(n);if(!s)throw new Error('Vivus [constructor]: "element" parameter is not related to an existing ID');n=s;}if(this.parentEl=n,e&&e.file){let s=new XMLHttpRequest;s.addEventListener("load",()=>{let a=document.createElement("div");a.innerHTML=s.responseText;let i=a.querySelector("svg");if(!i)throw new Error(`Vivus [load]: Cannot find the SVG in the loaded file : ${e.file}`);this.el=i,i.setAttribute("width","100%"),i.setAttribute("height","100%"),this.parentEl.appendChild(i),this.isReady=true,this.init();}),s.open("GET",e.file),s.send();return}if($(n)){this.el=n,this.isReady=true;return}if(n instanceof HTMLObjectElement){let s=n,a=i=>{if(this.isReady)return;let o=s.contentDocument&&s.contentDocument.querySelector("svg");if(!o&&i)throw new Error("Vivus [constructor]: object loaded does not contain any SVG");o&&(s.getAttribute("built-by-vivus")&&(this.parentEl.insertBefore(o,s),this.parentEl.removeChild(s),o.setAttribute("width","100%"),o.setAttribute("height","100%")),this.el=o,this.isReady=true,this.init());};a(),this.isReady||s.addEventListener("load",a);return}throw new Error('Vivus [constructor]: "element" parameter is not valid (or miss the "file" attribute)')}setOptions(t){if(t!==void 0&&(t===null||t.constructor!==Object))throw new Error('Vivus [constructor]: "options" parameter must be an object');let e=t||{};if(e.type&&S.indexOf(e.type)===-1)throw new Error(`Vivus [constructor]: ${e.type} is not an existing animation \`type\``);if(e.start&&R.indexOf(e.start)===-1)throw new Error(`Vivus [constructor]: ${e.start} is not an existing \`start\` option`);this.type=e.type||"delayed",this.start=e.start||"inViewport";let n=navigator.userAgent,s=n.indexOf("MSIE")!==-1||n.indexOf("Trident/")!==-1||n.indexOf("Edge/")!==-1;if(this.duration=u(e.duration,120),this.delay=u(e.delay,null),this.dashGap=u(e.dashGap,1),this.forceRender=Object.prototype.hasOwnProperty.call(e,"forceRender")?!!e.forceRender:s,this.reverseStack=!!e.reverseStack,this.selfDestroy=!!e.selfDestroy,this.onReady=e.onReady,this.map=[],this.ignoreInvisible=Object.prototype.hasOwnProperty.call(e,"ignoreInvisible")?!!e.ignoreInvisible:false,this.animTimingFunction=e.animTimingFunction||c.LINEAR,this.pathTimingFunction=e.pathTimingFunction||c.LINEAR,this.delay!==null&&this.delay>=this.duration)throw new Error("Vivus [constructor]: delay must be shorter than duration")}setCallback(t){if(t&&typeof t!="function")throw new Error('Vivus [constructor]: "callback" parameter must be a function');this.callback=t||(()=>{});}mapping(){let t=0,e=0,n=0,s=false,a=Array.from(this.el.querySelectorAll("path"));a.forEach((i,o)=>{if(this.isInvisible(i))return;let l={el:i,length:0,startAt:0,duration:0,isResizeSensitive:false},h=1;if(i.getAttribute("vector-effect")==="non-scaling-stroke"){let d=i.getBoundingClientRect(),f=i.getBBox();h=Math.max(d.width/f.width,d.height/f.height),l.isResizeSensitive=true,s=true;}if(l.length=Math.ceil(i.getTotalLength()*h),isNaN(l.length)){p("vivus: cannot retrieve a path element length",i);return}this.map.push(l),i.style.strokeDasharray=`${l.length} ${l.length+this.dashGap*2}`,i.style.strokeDashoffset=String(l.length+this.dashGap),l.length+=this.dashGap,e+=l.length,this.renderPath(o);}),s&&p("vivus: this SVG contains non-scaling-strokes. Call instance.recalc() when the SVG is resized."),e=e===0?1:e,this.delay=this.delay===null?this.duration/3:this.delay,this.delayUnit=this.delay/(a.length>1?a.length-1:1),this.reverseStack&&this.map.reverse(),this.map.forEach((i,o)=>{let l=()=>{let h={};for(let{name:d,value:f}of Array.from(i.el.attributes))h[d]=f;return h};switch(this.type){case "delayed":i.startAt=this.delayUnit*o,i.duration=this.duration-this.delay;break;case "oneByOne":i.startAt=n/e*this.duration,i.duration=i.length/e*this.duration;break;case "sync":case "async":case "nsync":i.startAt=0,i.duration=this.duration;break;case "scenario-sync":{let h=l();i.startAt=t+(u(h["data-delay"],this.delayUnit)||0),i.duration=u(h["data-duration"],this.duration),t=h["data-async"]!==void 0?i.startAt:i.startAt+i.duration,this.frameLength=Math.max(this.frameLength,i.startAt+i.duration);break}case "scenario":{let h=l();i.startAt=u(h["data-start"],this.delayUnit)||0,i.duration=u(h["data-duration"],this.duration),this.frameLength=Math.max(this.frameLength,i.startAt+i.duration);break}}n+=i.length,this.frameLength=this.frameLength||this.duration;});}recalc(){this.mustRecalcScale||(this.mustRecalcScale=requestAnimationFrame(()=>this.performLineRecalc()));}performLineRecalc(){for(let t of this.map){if(!t.isResizeSensitive)continue;let e=t.el.getBoundingClientRect(),n=t.el.getBBox(),s=Math.max(e.width/n.width,e.height/n.height);t.length=Math.ceil(t.el.getTotalLength()*s),t.el.style.strokeDasharray=`${t.length} ${t.length+this.dashGap*2}`;}this.trace(),this.mustRecalcScale=null;}draw(){if(this.currentFrame+=this.speed,this.currentFrame<=0)this.stop(),this.reset();else if(this.currentFrame>=this.frameLength)this.stop(),this.currentFrame=this.frameLength,this.trace(),this.selfDestroy&&this.destroy();else {this.trace(),this.handle=requestAnimationFrame(()=>this.draw());return}this.finished();}finished(){if(this.callback(this),this.instanceCallback){let t=this.instanceCallback;this.instanceCallback=null,t(this);}}trace(){let t=this.animTimingFunction(this.currentFrame/this.frameLength)*this.frameLength;this.map.forEach((e,n)=>{let s=this.pathTimingFunction(Math.max(0,Math.min(1,(t-e.startAt)/e.duration)));e.progress!==s&&(e.progress=s,e.el.style.strokeDashoffset=String(Math.floor(e.length*(1-s))),this.renderPath(n));});}renderPath(t){let e=this.forceRender&&this.map&&this.map[t];if(!e)return;let n=e.el.cloneNode(true);e.el.parentNode?.replaceChild(n,e.el),e.el=n;}init(){this.frameLength=0,this.currentFrame=0,this.map=[],T(this.el),this.mapping(),this.starter(),this.onReady&&this.onReady(this);}starter(){if(this.start==="manual")return;if(this.start==="autostart"){this.play();return}let t=()=>{this.isInViewport(this.parentEl,1)&&(this.play(),window.removeEventListener("scroll",t),this.viewportListener=null);};this.viewportListener=t,window.addEventListener("scroll",t),t();}getStatus(){return this.currentFrame===0?"start":this.currentFrame===this.frameLength?"end":"progress"}reset(){return this.setFrameProgress(0)}finish(){return this.setFrameProgress(1)}setFrameProgress(t){let e=Math.min(1,Math.max(0,t));return this.currentFrame=Math.round(this.frameLength*e),this.trace(),this}play(t,e){this.instanceCallback=null;let n=t;if(n&&typeof n=="function")this.instanceCallback=n,n=void 0;else if(n&&typeof n!="number")throw new Error("Vivus [play]: invalid speed");return e&&typeof e=="function"&&!this.instanceCallback&&(this.instanceCallback=e),this.speed=n||1,y()?(this.stop(),this.currentFrame=this.speed<0?0:this.frameLength,this.trace(),this.speed>0&&this.selfDestroy&&this.destroy(),this.finished(),this):(this.handle||this.draw(),this)}stop(){return this.handle&&(cancelAnimationFrame(this.handle),this.handle=null),this}destroy(){this.stop(),this.viewportListener&&(window.removeEventListener("scroll",this.viewportListener),this.viewportListener=null),this.map.forEach((t,e)=>{t.el.style.strokeDashoffset="",t.el.style.strokeDasharray="",this.renderPath(e);});}isInvisible(t){let e=t.getAttribute("data-ignore");if(e!==null)return e!=="false";if(this.ignoreInvisible){let n=t.getBoundingClientRect();return !n.width&&!n.height}return false}isInViewport(t,e=0){let n=window.pageYOffset||document.documentElement.scrollTop,s=n+Math.max(document.documentElement.clientHeight,window.innerHeight),a=t.getBoundingClientRect(),i=n+a.top;return i+a.height*(e||0)<=s&&i+a.height>=n}};c.LINEAR=t=>t,c.EASE=t=>-Math.cos(t*Math.PI)/2+.5,c.EASE_OUT=t=>1-Math.pow(1-t,3),c.EASE_IN=t=>Math.pow(t,3),c.EASE_OUT_BOUNCE=t=>{let e=-Math.cos(t*(.5*Math.PI))+1,n=Math.pow(e,1.5),s=Math.pow(1-t,2),a=-Math.abs(Math.cos(n*(2.5*Math.PI)))+1;return 1-s+a*s};var m=c,E=m;function _(r={},t){let e=react.useRef(null),[n,s]=react.useState(null),a=react.useRef(r),i=react.useRef(t);return a.current=r,i.current=t,react.useEffect(()=>{if(!e.current)return;let o=new E(e.current,a.current,l=>i.current?.(l));return s(o),()=>{o.destroy(),s(null);}},[]),[e,n]}
3
- exports.useVivus=_;
2
+ 'use strict';var react=require('react');function y(){return typeof window>"u"||typeof window.matchMedia!="function"?false:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function g(r){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let t=window.matchMedia("(prefers-reduced-motion: reduce)"),e=s=>r(!!s.matches);if(typeof t.addEventListener=="function")return t.addEventListener("change",e),()=>t.removeEventListener("change",e);let n=t;return n.addListener?.(e),()=>n.removeListener?.(e)}var L=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function p(r,...t){L&&console.warn(`[svg-scroll-draw] ${r}`,...t);}var R=["delayed","sync","async","nsync","oneByOne","scenario","scenario-sync"],S=["inViewport","manual","autostart"];function u(r,t){let e=parseInt(r,10);return e>=0?e:t}function x(r){if(typeof window>"u")return false;let t=window,e=n=>typeof t[n]=="function"&&r instanceof t[n];return e("SVGSVGElement")||e("SVGGElement")||r?.constructor===t.SVGElement}var w=["cx","cy","points","r","rx","ry","x","x1","x2","y","y1","y2"],M=["line","ellipse","circle","polygon","polyline","rect"],$="http://www.w3.org/2000/svg";function b(r){let t=r.points.trim().split(" ");if(r.points.indexOf(",")===-1){let n=[];for(let s=0;s<t.length;s+=2)n.push(`${t[s]},${t[s+1]}`);t=n;}let e=`M${t[0]}`;for(let n=1;n<t.length;n++)t[n].indexOf(",")!==-1&&(e+=`L${t[n]}`);return e}function E(r,t,e,n){let s=parseFloat(e)||0,a=parseFloat(n)||0,i=parseFloat(r)||0,o=parseFloat(t)||0,l=i-s,h=i+s;return `M${l},${o}A${s},${a} 0,1,1 ${h},${o}A${s},${a} 0,1,1 ${l},${o}`}var A={line:r=>`M${r.x1||0},${r.y1||0}L${r.x2||0},${r.y2||0}`,rect(r){let t=parseFloat(r.x)||0,e=parseFloat(r.y)||0,n=parseFloat(r.width)||0,s=parseFloat(r.height)||0;if(r.rx||r.ry){let a=parseInt(r.rx,10)||-1,i=parseInt(r.ry,10)||-1;a=Math.min(Math.max(a<0?i:a,0),n/2),i=Math.min(Math.max(i<0?a:i,0),s/2);let o=`A ${a},${i},0,0,1,`;return `M ${t+a},${e} L ${t+n-a},${e} ${o}${t+n},${e+i} L ${t+n},${e+s-i} ${o}${t+n-a},${e+s} L ${t+a},${e+s} ${o}${t},${e+s-i} L ${t},${e+i} ${o}${t+a},${e}`}return `M${t} ${e} L${t+n} ${e} L${t+n} ${e+s} L${t} ${e+s} Z`},polyline:b,polygon:r=>`${b(r)}Z`,ellipse:r=>E(r.cx,r.cy,r.rx,r.ry),circle:r=>E(r.cx,r.cy,r.r,r.r)};function T(r){for(let t of Array.from(r.querySelectorAll(M.join(",")))){let e={};for(let{name:a,value:i}of Array.from(t.attributes)){if(w.indexOf(a)!==-1&&i.indexOf("%")!==-1)throw new Error("Pathformer [parseAttr]: a SVG shape got values in percentage. This cannot be transformed into 'path' tags. Please use 'viewBox'.");e[a]=i;}let n=A[t.tagName.toLowerCase()](e),s=document.createElementNS($,"path");for(let{name:a,value:i}of Array.from(t.attributes))w.indexOf(a)===-1&&s.setAttribute(a,i);s.setAttribute("d",n),t.parentNode?.replaceChild(s,t);}}var c=class c{constructor(t,e,n){this.isReady=false;this.type="delayed";this.start="inViewport";this.duration=120;this.delay=null;this.dashGap=1;this.forceRender=false;this.reverseStack=false;this.selfDestroy=false;this.ignoreInvisible=false;this.animTimingFunction=c.LINEAR;this.pathTimingFunction=c.LINEAR;this.callback=()=>{};this.map=[];this.frameLength=0;this.currentFrame=0;this.delayUnit=0;this.speed=1;this.handle=null;this.instanceCallback=null;this.mustRecalcScale=null;this.viewportListener=null;this.unwatchMotion=()=>{};this.setElement(t,e),this.setOptions(e),this.setCallback(n),this.isReady&&this.init(),this.unwatchMotion=g(s=>{s&&this.handle&&this.endNow();});}endNow(){this.stop(),this.currentFrame=this.speed<0?0:this.frameLength,this.trace(),this.speed>0&&this.selfDestroy&&this.destroy(),this.finished();}setElement(t,e){if(t===void 0)throw new Error('Vivus [constructor]: "element" parameter is required');let n=t;if(typeof n=="string"){let s=document.getElementById(n);if(!s)throw new Error('Vivus [constructor]: "element" parameter is not related to an existing ID');n=s;}if(this.parentEl=n,e&&e.file){let s=new XMLHttpRequest;s.addEventListener("load",()=>{let a=document.createElement("div");a.innerHTML=s.responseText;let i=a.querySelector("svg");if(!i)throw new Error(`Vivus [load]: Cannot find the SVG in the loaded file : ${e.file}`);this.el=i,i.setAttribute("width","100%"),i.setAttribute("height","100%"),this.parentEl.appendChild(i),this.isReady=true,this.init();}),s.open("GET",e.file),s.send();return}if(x(n)){this.el=n,this.isReady=true;return}if(n instanceof HTMLObjectElement){let s=n,a=i=>{if(this.isReady)return;let o=s.contentDocument&&s.contentDocument.querySelector("svg");if(!o&&i)throw new Error("Vivus [constructor]: object loaded does not contain any SVG");o&&(s.getAttribute("built-by-vivus")&&(this.parentEl.insertBefore(o,s),this.parentEl.removeChild(s),o.setAttribute("width","100%"),o.setAttribute("height","100%")),this.el=o,this.isReady=true,this.init());};a(),this.isReady||s.addEventListener("load",a);return}throw new Error('Vivus [constructor]: "element" parameter is not valid (or miss the "file" attribute)')}setOptions(t){if(t!==void 0&&(t===null||t.constructor!==Object))throw new Error('Vivus [constructor]: "options" parameter must be an object');let e=t||{};if(e.type&&R.indexOf(e.type)===-1)throw new Error(`Vivus [constructor]: ${e.type} is not an existing animation \`type\``);if(e.start&&S.indexOf(e.start)===-1)throw new Error(`Vivus [constructor]: ${e.start} is not an existing \`start\` option`);this.type=e.type||"delayed",this.start=e.start||"inViewport";let n=navigator.userAgent,s=n.indexOf("MSIE")!==-1||n.indexOf("Trident/")!==-1||n.indexOf("Edge/")!==-1;if(this.duration=u(e.duration,120),this.delay=u(e.delay,null),this.dashGap=u(e.dashGap,1),this.forceRender=Object.prototype.hasOwnProperty.call(e,"forceRender")?!!e.forceRender:s,this.reverseStack=!!e.reverseStack,this.selfDestroy=!!e.selfDestroy,this.onReady=e.onReady,this.map=[],this.ignoreInvisible=Object.prototype.hasOwnProperty.call(e,"ignoreInvisible")?!!e.ignoreInvisible:false,this.animTimingFunction=e.animTimingFunction||c.LINEAR,this.pathTimingFunction=e.pathTimingFunction||c.LINEAR,this.delay!==null&&this.delay>=this.duration)throw new Error("Vivus [constructor]: delay must be shorter than duration")}setCallback(t){if(t&&typeof t!="function")throw new Error('Vivus [constructor]: "callback" parameter must be a function');this.callback=t||(()=>{});}mapping(){let t=0,e=0,n=0,s=false,a=Array.from(this.el.querySelectorAll("path"));a.forEach((i,o)=>{if(this.isInvisible(i))return;let l={el:i,length:0,startAt:0,duration:0,isResizeSensitive:false},h=1;if(i.getAttribute("vector-effect")==="non-scaling-stroke"){let d=i.getBoundingClientRect(),f=i.getBBox();h=Math.max(d.width/f.width,d.height/f.height),l.isResizeSensitive=true,s=true;}if(l.length=Math.ceil(i.getTotalLength()*h),isNaN(l.length)){p("vivus: cannot retrieve a path element length",i);return}this.map.push(l),i.style.strokeDasharray=`${l.length} ${l.length+this.dashGap*2}`,i.style.strokeDashoffset=String(l.length+this.dashGap),l.length+=this.dashGap,e+=l.length,this.renderPath(o);}),s&&p("vivus: this SVG contains non-scaling-strokes. Call instance.recalc() when the SVG is resized."),e=e===0?1:e,this.delay=this.delay===null?this.duration/3:this.delay,this.delayUnit=this.delay/(a.length>1?a.length-1:1),this.reverseStack&&this.map.reverse(),this.map.forEach((i,o)=>{let l=()=>{let h={};for(let{name:d,value:f}of Array.from(i.el.attributes))h[d]=f;return h};switch(this.type){case "delayed":i.startAt=this.delayUnit*o,i.duration=this.duration-this.delay;break;case "oneByOne":i.startAt=n/e*this.duration,i.duration=i.length/e*this.duration;break;case "sync":case "async":case "nsync":i.startAt=0,i.duration=this.duration;break;case "scenario-sync":{let h=l();i.startAt=t+(u(h["data-delay"],this.delayUnit)||0),i.duration=u(h["data-duration"],this.duration),t=h["data-async"]!==void 0?i.startAt:i.startAt+i.duration,this.frameLength=Math.max(this.frameLength,i.startAt+i.duration);break}case "scenario":{let h=l();i.startAt=u(h["data-start"],this.delayUnit)||0,i.duration=u(h["data-duration"],this.duration),this.frameLength=Math.max(this.frameLength,i.startAt+i.duration);break}}n+=i.length,this.frameLength=this.frameLength||this.duration;});}recalc(){this.mustRecalcScale||(this.mustRecalcScale=requestAnimationFrame(()=>this.performLineRecalc()));}performLineRecalc(){for(let t of this.map){if(!t.isResizeSensitive)continue;let e=t.el.getBoundingClientRect(),n=t.el.getBBox(),s=Math.max(e.width/n.width,e.height/n.height);t.length=Math.ceil(t.el.getTotalLength()*s),t.el.style.strokeDasharray=`${t.length} ${t.length+this.dashGap*2}`;}this.trace(),this.mustRecalcScale=null;}draw(){if(this.currentFrame+=this.speed,this.currentFrame<=0)this.stop(),this.reset();else if(this.currentFrame>=this.frameLength)this.stop(),this.currentFrame=this.frameLength,this.trace(),this.selfDestroy&&this.destroy();else {this.trace(),this.handle=requestAnimationFrame(()=>this.draw());return}this.finished();}finished(){if(this.callback(this),this.instanceCallback){let t=this.instanceCallback;this.instanceCallback=null,t(this);}}trace(){let t=this.animTimingFunction(this.currentFrame/this.frameLength)*this.frameLength;this.map.forEach((e,n)=>{let s=this.pathTimingFunction(Math.max(0,Math.min(1,(t-e.startAt)/e.duration)));e.progress!==s&&(e.progress=s,e.el.style.strokeDashoffset=String(Math.floor(e.length*(1-s))),this.renderPath(n));});}renderPath(t){let e=this.forceRender&&this.map&&this.map[t];if(!e)return;let n=e.el.cloneNode(true);e.el.parentNode?.replaceChild(n,e.el),e.el=n;}init(){this.frameLength=0,this.currentFrame=0,this.map=[],T(this.el),this.mapping(),this.starter(),this.onReady&&this.onReady(this);}starter(){if(this.start==="manual")return;if(this.start==="autostart"){this.play();return}let t=()=>{this.isInViewport(this.parentEl,1)&&(this.play(),window.removeEventListener("scroll",t),this.viewportListener=null);};this.viewportListener=t,window.addEventListener("scroll",t),t();}getStatus(){return this.currentFrame===0?"start":this.currentFrame===this.frameLength?"end":"progress"}reset(){return this.setFrameProgress(0)}finish(){return this.setFrameProgress(1)}setFrameProgress(t){let e=Math.min(1,Math.max(0,t));return this.currentFrame=Math.round(this.frameLength*e),this.trace(),this}play(t,e){this.instanceCallback=null;let n=t;if(n&&typeof n=="function")this.instanceCallback=n,n=void 0;else if(n&&typeof n!="number")throw new Error("Vivus [play]: invalid speed");return e&&typeof e=="function"&&!this.instanceCallback&&(this.instanceCallback=e),this.speed=n||1,y()?(this.endNow(),this):(this.handle||this.draw(),this)}stop(){return this.handle&&(cancelAnimationFrame(this.handle),this.handle=null),this}destroy(){this.stop(),this.unwatchMotion(),this.viewportListener&&(window.removeEventListener("scroll",this.viewportListener),this.viewportListener=null),this.map.forEach((t,e)=>{t.el.style.strokeDashoffset="",t.el.style.strokeDasharray="",this.renderPath(e);});}isInvisible(t){let e=t.getAttribute("data-ignore");if(e!==null)return e!=="false";if(this.ignoreInvisible){let n=t.getBoundingClientRect();return !n.width&&!n.height}return false}isInViewport(t,e=0){let n=window.pageYOffset||document.documentElement.scrollTop,s=n+Math.max(document.documentElement.clientHeight,window.innerHeight),a=t.getBoundingClientRect(),i=n+a.top;return i+a.height*(e||0)<=s&&i+a.height>=n}};c.LINEAR=t=>t,c.EASE=t=>-Math.cos(t*Math.PI)/2+.5,c.EASE_OUT=t=>1-Math.pow(1-t,3),c.EASE_IN=t=>Math.pow(t,3),c.EASE_OUT_BOUNCE=t=>{let e=-Math.cos(t*(.5*Math.PI))+1,n=Math.pow(e,1.5),s=Math.pow(1-t,2),a=-Math.abs(Math.cos(n*(2.5*Math.PI)))+1;return 1-s+a*s};var m=c,V=m;function j(r={},t){let e=react.useRef(null),[n,s]=react.useState(null),a=react.useRef(r),i=react.useRef(t);return a.current=r,i.current=t,react.useEffect(()=>{if(!e.current)return;let o=new V(e.current,a.current,l=>i.current?.(l));return s(o),()=>{o.destroy(),s(null);}},[]),[e,n]}
3
+ exports.useVivus=j;
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import {b}from'../../chunk-4T5R3ZTL.mjs';import'../../chunk-AJ22VSHC.mjs';import'../../chunk-LFSU6LR3.mjs';import {useRef,useState,useEffect}from'react';function a(n={},u){let e=useRef(null),[o,r]=useState(null),s=useRef(n),c=useRef(u);return s.current=n,c.current=u,useEffect(()=>{if(!e.current)return;let i=new b(e.current,s.current,f=>c.current?.(f));return r(i),()=>{i.destroy(),r(null);}},[]),[e,o]}export{a as useVivus};
2
+ import {b}from'../../chunk-EAWFBJUR.mjs';import'../../chunk-AJ22VSHC.mjs';import'../../chunk-5PJEKEEP.mjs';import'../../chunk-LFSU6LR3.mjs';import {useRef,useState,useEffect}from'react';function a(n={},u){let e=useRef(null),[o,r]=useState(null),s=useRef(n),c=useRef(u);return s.current=n,c.current=u,useEffect(()=>{if(!e.current)return;let i=new b(e.current,s.current,f=>c.current?.(f));return r(i),()=>{i.destroy(),r(null);}},[]),[e,o]}export{a as useVivus};
@@ -1 +1 @@
1
- export{d as ScrollAnimate,f as ScrollCounter,b as ScrollDraw,j as ScrollText,h as ScrollVideo,c as useScrollAnimate,e as useScrollCounter,a as useScrollDraw,i as useScrollText,g as useScrollVideo}from'../chunk-PKY27MO4.mjs';import'../chunk-XSVTHCLO.mjs';import'../chunk-VDTAYUAR.mjs';import'../chunk-DY5JCXVR.mjs';import'../chunk-WXUOF4NM.mjs';import'../chunk-LTCJVVSC.mjs';import'../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-5PJEKEEP.mjs';import'../chunk-DM6EDKWH.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import'../chunk-LFSU6LR3.mjs';
1
+ export{d as ScrollAnimate,f as ScrollCounter,b as ScrollDraw,j as ScrollText,h as ScrollVideo,c as useScrollAnimate,e as useScrollCounter,a as useScrollDraw,i as useScrollText,g as useScrollVideo}from'../chunk-VMUJMXKO.mjs';import'../chunk-XSVTHCLO.mjs';import'../chunk-KV3WCPQ5.mjs';import'../chunk-DY5JCXVR.mjs';import'../chunk-WXUOF4NM.mjs';import'../chunk-LTCJVVSC.mjs';import'../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';
@@ -1 +1 @@
1
- import {b}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-5PJEKEEP.mjs';import'../chunk-DM6EDKWH.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import'../chunk-LFSU6LR3.mjs';if(typeof HTMLElement<"u"&&typeof customElements<"u"&&!customElements.get("scroll-draw")){let e=["speed","easing","stagger","direction","selector","fade","once"];class s extends HTMLElement{constructor(){super(...arguments);this.instance=null;this.key="";}connectedCallback(){this.build();}attributeChangedCallback(){this.instance&&this.build();}build(){let i=JSON.stringify(e.map(d=>this.getAttribute(d)));if(this.instance&&i===this.key)return;this.instance?.destroy(),this.key=i;let t={},n=this.getAttribute("speed"),r=this.getAttribute("easing"),a=this.getAttribute("stagger"),c=this.getAttribute("direction"),o=this.getAttribute("selector");n&&(t.speed=parseFloat(n)),r&&(t.easing=r),a&&(t.stagger=parseFloat(a)),c&&(t.direction=c),o&&(t.selector=o),this.hasAttribute("fade")&&(t.fade=this.getAttribute("fade")!=="false"),this.hasAttribute("once")&&(t.once=this.getAttribute("once")!=="false"),this.instance=b(this,t);}disconnectedCallback(){this.instance?.destroy(),this.instance=null;}}s.observedAttributes=e,customElements.define("scroll-draw",s);}
1
+ import {b}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';if(typeof HTMLElement<"u"&&typeof customElements<"u"&&!customElements.get("scroll-draw")){let e=["speed","easing","stagger","direction","selector","fade","once"];class s extends HTMLElement{constructor(){super(...arguments);this.instance=null;this.key="";}connectedCallback(){this.build();}attributeChangedCallback(){this.instance&&this.build();}build(){let i=JSON.stringify(e.map(d=>this.getAttribute(d)));if(this.instance&&i===this.key)return;this.instance?.destroy(),this.key=i;let t={},n=this.getAttribute("speed"),r=this.getAttribute("easing"),a=this.getAttribute("stagger"),c=this.getAttribute("direction"),o=this.getAttribute("selector");n&&(t.speed=parseFloat(n)),r&&(t.easing=r),a&&(t.stagger=parseFloat(a)),c&&(t.direction=c),o&&(t.selector=o),this.hasAttribute("fade")&&(t.fade=this.getAttribute("fade")!=="false"),this.hasAttribute("once")&&(t.once=this.getAttribute("once")!=="false"),this.instance=b(this,t);}disconnectedCallback(){this.instance?.destroy(),this.instance=null;}}s.observedAttributes=e,customElements.define("scroll-draw",s);}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svg-scroll-draw",
3
- "version": "2.22.0",
3
+ "version": "2.23.1",
4
4
  "description": "Scroll-driven animation for the web — draw SVG paths, reveal elements, pin sections, scrub video. Zero dependencies, native CSS fast path, works with React, Vue, Svelte, Solid, Angular, Astro and vanilla JS",
5
5
  "keywords": [
6
6
  "svg",
@@ -1,2 +0,0 @@
1
- import {a}from'./chunk-AJ22VSHC.mjs';import {b as b$1}from'./chunk-LFSU6LR3.mjs';var w=["delayed","sync","async","nsync","oneByOne","scenario","scenario-sync"],E=["inViewport","manual","autostart"];function u(r,t){let e=parseInt(r,10);return e>=0?e:t}function $(r){if(typeof window>"u")return false;let t=window,e=i=>typeof t[i]=="function"&&r instanceof t[i];return e("SVGSVGElement")||e("SVGGElement")||r?.constructor===t.SVGElement}var y=["cx","cy","points","r","rx","ry","x","x1","x2","y","y1","y2"],V=["line","ellipse","circle","polygon","polyline","rect"],A="http://www.w3.org/2000/svg";function v(r){let t=r.points.trim().split(" ");if(r.points.indexOf(",")===-1){let i=[];for(let s=0;s<t.length;s+=2)i.push(`${t[s]},${t[s+1]}`);t=i;}let e=`M${t[0]}`;for(let i=1;i<t.length;i++)t[i].indexOf(",")!==-1&&(e+=`L${t[i]}`);return e}function b(r,t,e,i){let s=parseFloat(e)||0,a=parseFloat(i)||0,n=parseFloat(r)||0,o=parseFloat(t)||0,l=n-s,h=n+s;return `M${l},${o}A${s},${a} 0,1,1 ${h},${o}A${s},${a} 0,1,1 ${l},${o}`}var x={line:r=>`M${r.x1||0},${r.y1||0}L${r.x2||0},${r.y2||0}`,rect(r){let t=parseFloat(r.x)||0,e=parseFloat(r.y)||0,i=parseFloat(r.width)||0,s=parseFloat(r.height)||0;if(r.rx||r.ry){let a=parseInt(r.rx,10)||-1,n=parseInt(r.ry,10)||-1;a=Math.min(Math.max(a<0?n:a,0),i/2),n=Math.min(Math.max(n<0?a:n,0),s/2);let o=`A ${a},${n},0,0,1,`;return `M ${t+a},${e} L ${t+i-a},${e} ${o}${t+i},${e+n} L ${t+i},${e+s-n} ${o}${t+i-a},${e+s} L ${t+a},${e+s} ${o}${t},${e+s-n} L ${t},${e+n} ${o}${t+a},${e}`}return `M${t} ${e} L${t+i} ${e} L${t+i} ${e+s} L${t} ${e+s} Z`},polyline:v,polygon:r=>`${v(r)}Z`,ellipse:r=>b(r.cx,r.cy,r.rx,r.ry),circle:r=>b(r.cx,r.cy,r.r,r.r)};function L(r){for(let t of Array.from(r.querySelectorAll(V.join(",")))){let e={};for(let{name:a,value:n}of Array.from(t.attributes)){if(y.indexOf(a)!==-1&&n.indexOf("%")!==-1)throw new Error("Pathformer [parseAttr]: a SVG shape got values in percentage. This cannot be transformed into 'path' tags. Please use 'viewBox'.");e[a]=n;}let i=x[t.tagName.toLowerCase()](e),s=document.createElementNS(A,"path");for(let{name:a,value:n}of Array.from(t.attributes))y.indexOf(a)===-1&&s.setAttribute(a,n);s.setAttribute("d",i),t.parentNode?.replaceChild(s,t);}}var c=class c{constructor(t,e,i){this.isReady=false;this.type="delayed";this.start="inViewport";this.duration=120;this.delay=null;this.dashGap=1;this.forceRender=false;this.reverseStack=false;this.selfDestroy=false;this.ignoreInvisible=false;this.animTimingFunction=c.LINEAR;this.pathTimingFunction=c.LINEAR;this.callback=()=>{};this.map=[];this.frameLength=0;this.currentFrame=0;this.delayUnit=0;this.speed=1;this.handle=null;this.instanceCallback=null;this.mustRecalcScale=null;this.viewportListener=null;this.setElement(t,e),this.setOptions(e),this.setCallback(i),this.isReady&&this.init();}setElement(t,e){if(t===void 0)throw new Error('Vivus [constructor]: "element" parameter is required');let i=t;if(typeof i=="string"){let s=document.getElementById(i);if(!s)throw new Error('Vivus [constructor]: "element" parameter is not related to an existing ID');i=s;}if(this.parentEl=i,e&&e.file){let s=new XMLHttpRequest;s.addEventListener("load",()=>{let a=document.createElement("div");a.innerHTML=s.responseText;let n=a.querySelector("svg");if(!n)throw new Error(`Vivus [load]: Cannot find the SVG in the loaded file : ${e.file}`);this.el=n,n.setAttribute("width","100%"),n.setAttribute("height","100%"),this.parentEl.appendChild(n),this.isReady=true,this.init();}),s.open("GET",e.file),s.send();return}if($(i)){this.el=i,this.isReady=true;return}if(i instanceof HTMLObjectElement){let s=i,a=n=>{if(this.isReady)return;let o=s.contentDocument&&s.contentDocument.querySelector("svg");if(!o&&n)throw new Error("Vivus [constructor]: object loaded does not contain any SVG");o&&(s.getAttribute("built-by-vivus")&&(this.parentEl.insertBefore(o,s),this.parentEl.removeChild(s),o.setAttribute("width","100%"),o.setAttribute("height","100%")),this.el=o,this.isReady=true,this.init());};a(),this.isReady||s.addEventListener("load",a);return}throw new Error('Vivus [constructor]: "element" parameter is not valid (or miss the "file" attribute)')}setOptions(t){if(t!==void 0&&(t===null||t.constructor!==Object))throw new Error('Vivus [constructor]: "options" parameter must be an object');let e=t||{};if(e.type&&w.indexOf(e.type)===-1)throw new Error(`Vivus [constructor]: ${e.type} is not an existing animation \`type\``);if(e.start&&E.indexOf(e.start)===-1)throw new Error(`Vivus [constructor]: ${e.start} is not an existing \`start\` option`);this.type=e.type||"delayed",this.start=e.start||"inViewport";let i=navigator.userAgent,s=i.indexOf("MSIE")!==-1||i.indexOf("Trident/")!==-1||i.indexOf("Edge/")!==-1;if(this.duration=u(e.duration,120),this.delay=u(e.delay,null),this.dashGap=u(e.dashGap,1),this.forceRender=Object.prototype.hasOwnProperty.call(e,"forceRender")?!!e.forceRender:s,this.reverseStack=!!e.reverseStack,this.selfDestroy=!!e.selfDestroy,this.onReady=e.onReady,this.map=[],this.ignoreInvisible=Object.prototype.hasOwnProperty.call(e,"ignoreInvisible")?!!e.ignoreInvisible:false,this.animTimingFunction=e.animTimingFunction||c.LINEAR,this.pathTimingFunction=e.pathTimingFunction||c.LINEAR,this.delay!==null&&this.delay>=this.duration)throw new Error("Vivus [constructor]: delay must be shorter than duration")}setCallback(t){if(t&&typeof t!="function")throw new Error('Vivus [constructor]: "callback" parameter must be a function');this.callback=t||(()=>{});}mapping(){let t=0,e=0,i=0,s=false,a=Array.from(this.el.querySelectorAll("path"));a.forEach((n,o)=>{if(this.isInvisible(n))return;let l={el:n,length:0,startAt:0,duration:0,isResizeSensitive:false},h=1;if(n.getAttribute("vector-effect")==="non-scaling-stroke"){let d=n.getBoundingClientRect(),m=n.getBBox();h=Math.max(d.width/m.width,d.height/m.height),l.isResizeSensitive=true,s=true;}if(l.length=Math.ceil(n.getTotalLength()*h),isNaN(l.length)){b$1("vivus: cannot retrieve a path element length",n);return}this.map.push(l),n.style.strokeDasharray=`${l.length} ${l.length+this.dashGap*2}`,n.style.strokeDashoffset=String(l.length+this.dashGap),l.length+=this.dashGap,e+=l.length,this.renderPath(o);}),s&&b$1("vivus: this SVG contains non-scaling-strokes. Call instance.recalc() when the SVG is resized."),e=e===0?1:e,this.delay=this.delay===null?this.duration/3:this.delay,this.delayUnit=this.delay/(a.length>1?a.length-1:1),this.reverseStack&&this.map.reverse(),this.map.forEach((n,o)=>{let l=()=>{let h={};for(let{name:d,value:m}of Array.from(n.el.attributes))h[d]=m;return h};switch(this.type){case "delayed":n.startAt=this.delayUnit*o,n.duration=this.duration-this.delay;break;case "oneByOne":n.startAt=i/e*this.duration,n.duration=n.length/e*this.duration;break;case "sync":case "async":case "nsync":n.startAt=0,n.duration=this.duration;break;case "scenario-sync":{let h=l();n.startAt=t+(u(h["data-delay"],this.delayUnit)||0),n.duration=u(h["data-duration"],this.duration),t=h["data-async"]!==void 0?n.startAt:n.startAt+n.duration,this.frameLength=Math.max(this.frameLength,n.startAt+n.duration);break}case "scenario":{let h=l();n.startAt=u(h["data-start"],this.delayUnit)||0,n.duration=u(h["data-duration"],this.duration),this.frameLength=Math.max(this.frameLength,n.startAt+n.duration);break}}i+=n.length,this.frameLength=this.frameLength||this.duration;});}recalc(){this.mustRecalcScale||(this.mustRecalcScale=requestAnimationFrame(()=>this.performLineRecalc()));}performLineRecalc(){for(let t of this.map){if(!t.isResizeSensitive)continue;let e=t.el.getBoundingClientRect(),i=t.el.getBBox(),s=Math.max(e.width/i.width,e.height/i.height);t.length=Math.ceil(t.el.getTotalLength()*s),t.el.style.strokeDasharray=`${t.length} ${t.length+this.dashGap*2}`;}this.trace(),this.mustRecalcScale=null;}draw(){if(this.currentFrame+=this.speed,this.currentFrame<=0)this.stop(),this.reset();else if(this.currentFrame>=this.frameLength)this.stop(),this.currentFrame=this.frameLength,this.trace(),this.selfDestroy&&this.destroy();else {this.trace(),this.handle=requestAnimationFrame(()=>this.draw());return}this.finished();}finished(){if(this.callback(this),this.instanceCallback){let t=this.instanceCallback;this.instanceCallback=null,t(this);}}trace(){let t=this.animTimingFunction(this.currentFrame/this.frameLength)*this.frameLength;this.map.forEach((e,i)=>{let s=this.pathTimingFunction(Math.max(0,Math.min(1,(t-e.startAt)/e.duration)));e.progress!==s&&(e.progress=s,e.el.style.strokeDashoffset=String(Math.floor(e.length*(1-s))),this.renderPath(i));});}renderPath(t){let e=this.forceRender&&this.map&&this.map[t];if(!e)return;let i=e.el.cloneNode(true);e.el.parentNode?.replaceChild(i,e.el),e.el=i;}init(){this.frameLength=0,this.currentFrame=0,this.map=[],L(this.el),this.mapping(),this.starter(),this.onReady&&this.onReady(this);}starter(){if(this.start==="manual")return;if(this.start==="autostart"){this.play();return}let t=()=>{this.isInViewport(this.parentEl,1)&&(this.play(),window.removeEventListener("scroll",t),this.viewportListener=null);};this.viewportListener=t,window.addEventListener("scroll",t),t();}getStatus(){return this.currentFrame===0?"start":this.currentFrame===this.frameLength?"end":"progress"}reset(){return this.setFrameProgress(0)}finish(){return this.setFrameProgress(1)}setFrameProgress(t){let e=Math.min(1,Math.max(0,t));return this.currentFrame=Math.round(this.frameLength*e),this.trace(),this}play(t,e){this.instanceCallback=null;let i=t;if(i&&typeof i=="function")this.instanceCallback=i,i=void 0;else if(i&&typeof i!="number")throw new Error("Vivus [play]: invalid speed");return e&&typeof e=="function"&&!this.instanceCallback&&(this.instanceCallback=e),this.speed=i||1,a()?(this.stop(),this.currentFrame=this.speed<0?0:this.frameLength,this.trace(),this.speed>0&&this.selfDestroy&&this.destroy(),this.finished(),this):(this.handle||this.draw(),this)}stop(){return this.handle&&(cancelAnimationFrame(this.handle),this.handle=null),this}destroy(){this.stop(),this.viewportListener&&(window.removeEventListener("scroll",this.viewportListener),this.viewportListener=null),this.map.forEach((t,e)=>{t.el.style.strokeDashoffset="",t.el.style.strokeDasharray="",this.renderPath(e);});}isInvisible(t){let e=t.getAttribute("data-ignore");if(e!==null)return e!=="false";if(this.ignoreInvisible){let i=t.getBoundingClientRect();return !i.width&&!i.height}return false}isInViewport(t,e=0){let i=window.pageYOffset||document.documentElement.scrollTop,s=i+Math.max(document.documentElement.clientHeight,window.innerHeight),a=t.getBoundingClientRect(),n=i+a.top;return n+a.height*(e||0)<=s&&n+a.height>=i}};c.LINEAR=t=>t,c.EASE=t=>-Math.cos(t*Math.PI)/2+.5,c.EASE_OUT=t=>1-Math.pow(1-t,3),c.EASE_IN=t=>Math.pow(t,3),c.EASE_OUT_BOUNCE=t=>{let e=-Math.cos(t*(.5*Math.PI))+1,i=Math.pow(e,1.5),s=Math.pow(1-t,2),a=-Math.abs(Math.cos(i*(2.5*Math.PI)))+1;return 1-s+a*s};var p=c,T=p;
2
- export{p as a,T as b};
@@ -1,2 +0,0 @@
1
- import {a as a$1}from'./chunk-AJ22VSHC.mjs';var K="4.0.9",G=()=>typeof window<"u"&&typeof document<"u",C=e=>e!==null&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]";function q(e,...n){for(let t of n)if(C(t))for(let o of Object.keys(t)){let i=t[o];C(i)?(C(e[o])||(e[o]={}),q(e[o],i)):e[o]=i;}return e}function L(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),F=false;function P(e,...n){F&&typeof console<"u"&&console.log(`%cScrollReveal: ${e}${n.map(t=>`
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,l,c,h]=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[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 le(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),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:l},opacity:b,position:o.position,transform:g,transition:w}}var x=(...e)=>e.filter(n=>n!=="").join(" "),ae=()=>({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,O=null,a={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,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 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=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 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)=>{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 M(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&&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&&a.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 l=i.body[0],c=a.elements[t.members[l]];if(c)return M(t,l,-1,n),M(t,l,1,n),k(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 M(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 M(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(a.containers))(e||!t.geometry)&&(t.geometry=U(t.node,true)),t.scroll=de(t);let n=Object.values(a.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(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=a$1();for(let n of Object.values(a.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(a.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 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&&$()||!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(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=le(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 P("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(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=a.elements[Number(o)];i&&(i.timer&&clearTimeout(i.timer.clock),v(i.node,i.styles.inline.generated),delete a.elements[i.id]),t.removeAttribute("data-sr-id");}n&&_();}function ge(){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 pe(){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 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??ae(),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(),O||(O={reveal:(t,o)=>te(t,o),clean:B,destroy:ge,sync:pe,get defaults(){return p},version:K,noop:false},Object.defineProperty(O,"delegate",{value:y})),O)}var X=ye;X.isSupported=ne;Object.defineProperty(X,"debug",{get:()=>F,set:e=>{typeof e=="boolean"&&(F=e);}});var we=X;export{X as a,we as b};