-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchunk-BDDGwbDI.js
More file actions
1 lines (1 loc) · 6.15 KB
/
Copy pathchunk-BDDGwbDI.js
File metadata and controls
1 lines (1 loc) · 6.15 KB
1
import{cv as g,cu as P,d3 as C,d4 as M,d5 as R,cw as N,d6 as F,d7 as D,cK as V,d8 as X,d9 as Y,H as $,I as m,ct as G,r as _,da as J}from"../entries/pages.BZkyDMuN.js";function k(e,t){let s;const n=()=>{const{currentTime:r}=t,o=(r===null?0:r.value)/100;s!==o&&e(o),s=o};return g.update(n,!0),()=>P(n)}const v=new WeakMap;let a;function K(e,t){if(t){const{inlineSize:s,blockSize:n}=t[0];return{width:s,height:n}}else return e instanceof SVGElement&&"getBBox"in e?e.getBBox():{width:e.offsetWidth,height:e.offsetHeight}}function j({target:e,contentRect:t,borderBoxSize:s}){var n;(n=v.get(e))===null||n===void 0||n.forEach(r=>{r({target:e,contentSize:t,get size(){return K(e,s)}})})}function q(e){e.forEach(j)}function Q(){typeof ResizeObserver>"u"||(a=new ResizeObserver(q))}function U(e,t){a||Q();const s=C(e);return s.forEach(n=>{let r=v.get(n);r||(r=new Set,v.set(n,r)),r.add(t),a?.observe(n)}),()=>{s.forEach(n=>{const r=v.get(n);r?.delete(t),r?.size||a?.unobserve(n)})}}const w=new Set;let p;function Z(){p=()=>{const e={width:window.innerWidth,height:window.innerHeight},t={target:window,size:e,contentSize:e};w.forEach(s=>s(t))},window.addEventListener("resize",p)}function ee(e){return w.add(e),p||Z(),()=>{w.delete(e),!w.size&&p&&(p=void 0)}}function te(e,t){return typeof e=="function"?ee(e):U(e,t)}const ne=50,H=()=>({current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}),se=()=>({time:0,x:H(),y:H()}),re={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function S(e,t,s,n){const r=s[t],{length:l,position:o}=re[t],i=r.current,c=s.time;r.current=e[`scroll${o}`],r.scrollLength=e[`scroll${l}`]-e[`client${l}`],r.offset.length=0,r.offset[0]=0,r.offset[1]=r.scrollLength,r.progress=M(0,r.scrollLength,r.current);const u=n-c;r.velocity=u>ne?0:R(r.current-i,u)}function le(e,t,s){S(e,"x",t,s),S(e,"y",t,s),t.time=s}function oe(e,t){const s={x:0,y:0};let n=e;for(;n&&n!==t;)if(n instanceof HTMLElement)s.x+=n.offsetLeft,s.y+=n.offsetTop,n=n.offsetParent;else if(n.tagName==="svg"){const r=n.getBoundingClientRect();n=n.parentElement;const l=n.getBoundingClientRect();s.x+=r.left-l.left,s.y+=r.top-l.top}else if(n instanceof SVGGraphicsElement){const{x:r,y:l}=n.getBBox();s.x+=r,s.y+=l;let o=null,i=n.parentNode;for(;!o;)i.tagName==="svg"&&(o=i),i=n.parentNode;n=o}else break;return s}const z={start:0,center:.5,end:1};function O(e,t,s=0){let n=0;if(e in z&&(e=z[e]),typeof e=="string"){const r=parseFloat(e);e.endsWith("px")?n=r:e.endsWith("%")?e=r/100:e.endsWith("vw")?n=r/100*document.documentElement.clientWidth:e.endsWith("vh")?n=r/100*document.documentElement.clientHeight:e=r}return typeof e=="number"&&(n=t*e),s+n}const ie=[0,0];function ce(e,t,s,n){let r=Array.isArray(e)?e:ie,l=0,o=0;return typeof e=="number"?r=[e,e]:typeof e=="string"&&(e=e.trim(),e.includes(" ")?r=e.split(" "):r=[e,z[e]?e:"0"]),l=O(r[0],s,n),o=O(r[1],t),l-o}const fe={All:[[0,0],[1,1]]},ue={x:0,y:0};function de(e){return"getBBox"in e&&e.tagName!=="svg"?e.getBBox():{width:e.clientWidth,height:e.clientHeight}}function ae(e,t,s){const{offset:n=fe.All}=s,{target:r=e,axis:l="y"}=s,o=l==="y"?"height":"width",i=r!==e?oe(r,e):ue,c=r===e?{width:e.scrollWidth,height:e.scrollHeight}:de(r),u={width:e.clientWidth,height:e.clientHeight};t[l].offset.length=0;let d=!t[l].interpolate;const y=n.length;for(let f=0;f<y;f++){const x=ce(n[f],u[o],c[o],i[l]);!d&&x!==t[l].interpolatorOffsets[f]&&(d=!0),t[l].offset[f]=x}d&&(t[l].interpolate=N(t[l].offset,F(n),{clamp:!1}),t[l].interpolatorOffsets=[...t[l].offset]),t[l].progress=D(0,1,t[l].interpolate(t[l].current))}function he(e,t=e,s){if(s.x.targetOffset=0,s.y.targetOffset=0,t!==e){let n=t;for(;n&&n!==e;)s.x.targetOffset+=n.offsetLeft,s.y.targetOffset+=n.offsetTop,n=n.offsetParent}s.x.targetLength=t===e?t.scrollWidth:t.clientWidth,s.y.targetLength=t===e?t.scrollHeight:t.clientHeight,s.x.containerLength=e.clientWidth,s.y.containerLength=e.clientHeight}function ge(e,t,s,n={}){return{measure:()=>he(e,n.target,s),update:r=>{le(e,s,r),(n.offset||n.target)&&ae(e,s,n)},notify:()=>t(s)}}const h=new WeakMap,T=new WeakMap,E=new WeakMap,B=e=>e===document.documentElement?window:e;function W(e,{container:t=document.documentElement,...s}={}){let n=E.get(t);n||(n=new Set,E.set(t,n));const r=se(),l=ge(t,e,r,s);if(n.add(l),!h.has(t)){const i=()=>{for(const f of n)f.measure()},c=()=>{for(const f of n)f.update(V.timestamp)},u=()=>{for(const f of n)f.notify()},d=()=>{g.read(i,!1,!0),g.read(c,!1,!0),g.update(u,!1,!0)};h.set(t,d);const y=B(t);window.addEventListener("resize",d,{passive:!0}),t!==document.documentElement&&T.set(t,te(t,d)),y.addEventListener("scroll",d,{passive:!0})}const o=h.get(t);return g.read(o,!1,!0),()=>{var i;P(o);const c=E.get(t);if(!c||(c.delete(l),c.size))return;const u=h.get(t);h.delete(t),u&&(B(t).removeEventListener("scroll",u),(i=T.get(t))===null||i===void 0||i(),window.removeEventListener("resize",u))}}function pe({source:e,container:t,axis:s="y"}){e&&(t=e);const n={value:0},r=W(l=>{n.value=l[s].progress*100},{container:t,axis:s});return{currentTime:n,cancel:r}}const L=new Map;function A({source:e,container:t=document.documentElement,axis:s="y"}={}){e&&(t=e),L.has(t)||L.set(t,{});const n=L.get(t);return n[s]||(n[s]=Y()?new ScrollTimeline({source:t,axis:s}):pe({source:t,axis:s})),n[s]}function me(e){return e.length===2}function I(e){return e&&(e.target||e.offset)}function ve(e,t){return me(e)||I(t)?W(s=>{e(s[t.axis].progress,s)},t):k(e,A(t))}function we(e,t){if(e.flatten(),I(t))return e.pause(),W(s=>{e.time=e.duration*s[t.axis].progress},t);{const s=A(t);return e.attachTimeline?e.attachTimeline(s,n=>(n.pause(),k(r=>{n.time=n.duration*r},s))):X}}function ye(e,{axis:t="y",...s}={}){const n={axis:t,...s};return typeof e=="function"?ve(e,n):we(e,n)}function b(e,t){J(!!(!t||t.current))}const Ee=()=>({scrollX:m(0),scrollY:m(0),scrollXProgress:m(0),scrollYProgress:m(0)});function ze({container:e,target:t,layoutEffect:s=!0,...n}={}){const r=$(Ee);return(s?G:_.useEffect)(()=>(b("target",t),b("container",e),ye((o,{x:i,y:c})=>{r.scrollX.set(i.current),r.scrollXProgress.set(i.progress),r.scrollY.set(c.current),r.scrollYProgress.set(c.progress)},{...n,container:e?.current||void 0,target:t?.current||void 0})),[e,t,JSON.stringify(n.offset)]),r}export{ze as u};