vendor: 7,195 bytes, line 1
1import{r as t}from"./index-CTUgqakz.js";import{f as e,E as n,K as r,N as o,p as s,O as i,G as c,D as l,h as a,Q as f,R as u,T as g,U as d,a as h,u as p,W as m,x as y}from"./proxy--AF1RYhV.js";function v(t,r){let o;const s=()=>{const{currentTime:e}=r,n=(null===e?0:e.value)/100;o!==n&&t(n),o=n};return e.preUpdate(s,!0),()=>n(s)}function x(e,n,r){t.useInsertionEffect(()=>e.on(n,r),[e,n,r])}function w(t){return"undefined"!=typeof window&&(t?r():o())}const E={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function L(t,e,n,r){const o=n[e],{length:c,position:l}=E[e],a=o.current,f=n.time;o.current=Math.abs(t[`scroll${l}`]),o.scrollLength=t[`scroll${c}`]-t[`client${c}`],o.offset.length=0,o.offset[0]=0,o.offset[1]=o.scrollLength,o.progress=s(0,o.scrollLength,o.current);const u=r-f;o.velocity=u>50?0:i(o.current-a,u)}const W={start:0,center:.5,end:1};function H(t,e,n=0){let r=0;if(t in W&&(t=W[t]),"string"==typeof t){const e=parseFloat(t);t.endsWith("px")?r=e:t.endsWith("%")?t=e/100:t.endsWith("vw")?r=e/100*document.documentElement.clientWidth:t.endsWith("vh")?r=e/100*document.documentElement.clientHeight:t=e}return"number"==typeof t&&(r=e*t),n+r}const O=[0,0];function k(t,e,n,r){let o=Array.isArray(t)?t:O,s=0,i=0;return"number"==typeof t?o=[t,t]:"string"==typeof t&&(o=(t=t.trim()).includes(" ")?t.split(" "):[t,W[t]?t:"0"]),s=H(o[0],n,r),i=H(o[1],e),s-i}const A={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},S={x:0,y:0};function T(t,e,n){const{offset:r=A.All}=n,{target:o=t,axis:s="y"}=n,i="y"===s?"height":"width",u=o!==t?function(t,e){const n={x:0,y:0};let r=t;for(;r&&r!==e;)if(c(r))n.x+=r.offsetLeft,n.y+=r.offsetTop,r=r.offsetParent;else if("svg"===r.tagName){const t=r.getBoundingClientRect();r=r.parentElement;const e=r.getBoundingClientRect();n.x+=t.left-e.left,n.y+=t.top-e.top}else{if(!(r instanceof SVGGraphicsElement))break;{const{x:t,y:e}=r.getBBox();n.x+=t,n.y+=e;let o=null,s=r.parentNode;for(;!o;)"svg"===s.tagName&&(o=s),s=r.parentNode;r=o}}return n}(o,t):S,g=o===t?{width:t.scrollWidth,height:t.scrollHeight}:function(t){return"getBBox"in t&&"svg"!==t.tagName?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}(o),d={width:t.clientWidth,height:t.clientHeight};e[s].offset.length=0;let h=!e[s].interpolate;const p=r.length;for(let c=0;c<p;c++){const t=k(r[c],d[i],g[i],u[s]);h||t===e[s].interpolatorOffsets[c]||(h=!0),e[s].offset[c]=t}h&&(e[s].interpolate=l(e[s].offset,a(r),{clamp:!1}),e[s].interpolatorOffsets=[...e[s].offset]),e[s].progress=f(0,1,e[s].interpolate(e[s].current))}function B(t,e,n,r={}){return{measure:e=>{!function(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let r=e;for(;r&&r!==t;)n.x.targetOffset+=r.offsetLeft,n.y.targetOffset+=r.offsetTop,r=r.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}(t,r.target,n),function(t,e,n){L(t,"x",e,n),L(t,"y",e,n),e.time=n}(t,n,e),(r.offset||r.target)&&T(t,n,r)},notify:()=>e(n)}}const M=new WeakMap,P=new WeakMap,b=new WeakMap,N=new WeakMap,R=new WeakMap,X=t=>t===document.scrollingElement?window:t;function Y(t,{container:r=document.scrollingElement,trackContentSize:o=!1,...s}={}){if(!r)return u;let i=b.get(r);i||(i=new Set,b.set(r,i));const c=B(r,t,{time:0,x:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0},y:{current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}},s);if(i.add(c),!M.has(r)){const t=()=>{for(const t of i)t.measure(d.timestamp);e.preUpdate(n)},n=()=>{for(const t of i)t.notify()},o=()=>e.read(t);M.set(r,o);const s=X(r);window.addEventListener("resize",o),r!==document.documentElement&&P.set(r,g(r,o)),s.addEventListener("scroll",o),o()}if(o&&!R.has(r)){const t=M.get(r),n={width:r.scrollWidth,height:r.scrollHeight};N.set(r,n);const o=()=>{const e=r.scrollWidth,o=r.scrollHeight;n.width===e&&n.height===o||(t(),n.width=e,n.height=o)},s=e.read(o,!0);R.set(r,s)}const l=M.get(r);return e.read(l,!1,!0),()=>{var t;n(l);const e=b.get(r);if(!e)return;if(e.delete(c),e.size)return;const o=M.get(r);M.delete(r),o&&(X(r).removeEventListener("scroll",o),null==(t=P.get(r))||t(),window.removeEventListener("resize",o));const s=R.get(r);s&&(n(s),R.delete(r)),N.delete(r)}}const $=[[A.Enter,"entry"],[A.Exit,"exit"],[A.Any,"cover"],[A.All,"contain"]],j={start:0,end:1};function z(t){const e=t.trim().split(/\s+/);if(2!==e.length)return;const n=j[e[0]],r=j[e[1]];return void 0!==n&&void 0!==r?[n,r]:void 0}function C(t,e){const n=function(t){if(2!==t.length)return;const e=[];for(const n of t)if(Array.isArray(n))e.push(n);else{if("string"!=typeof n)return;{const t=z(n);if(!t)return;e.push(t)}}return e}(t);if(!n)return!1;for(let r=0;r<2;r++){const t=n[r],o=e[r];if(t[0]!==o[0]||t[1]!==o[1])return!1}return!0}function G(t){if(!t)return{rangeStart:"contain 0%",rangeEnd:"contain 100%"};for(const[e,n]of $)if(C(t,e))return{rangeStart:`${n} 0%`,rangeEnd:`${n} 100%`}}const U=new Map;function D(t){const e={value:0},n=Y(n=>{e.value=100*n[t.axis].progress},t);return{currentTime:e,cancel:n}}function V({source:t,container:e,...n}){const{axis:r}=n;t&&(e=t);let o=U.get(e);o||(o=new Map,U.set(e,o));const s=n.target??"self";let i=o.get(s);i||(i={},o.set(s,i));const c=r+(n.offset??[]).join(",");if(!i[c])if(n.target&&w(n.target)){const t=G(n.offset);i[c]=t?new ViewTimeline({subject:n.target,axis:r}):D({container:e,...n})}else w()?i[c]=new ScrollTimeline({source:e,axis:r}):i[c]=D({container:e,...n});return i[c]}function F(t,{axis:e="y",container:n=document.scrollingElement,...r}={}){if(!n)return u;const o={axis:e,container:n,...r};return"function"==typeof t?function(t,e){return function(t){return 2===t.length}(t)?Y(n=>{t(n[e.axis].progress,n)},e):v(t,V(e))}(t,o):function(t,e){const n=V(e),r=e.target?G(e.offset):void 0,o=e.target?w(e.target)&&!!r:w();return t.attachTimeline({timeline:o?n:void 0,...r&&o&&{rangeStart:r.rangeStart,rangeEnd:r.rangeEnd},observe:t=>(t.pause(),v(e=>{t.time=t.iterationDuration*e},n))})}(t,o)}const I=()=>({scrollX:y(0),scrollY:y(0),scrollXProgress:y(0),scrollYProgress:y(0)}),J=t=>!!t&&!t.current;function K(t,e,n,r){return{factory:o=>F(o,{...e,axis:t,container:(null==n?void 0:n.current)||void 0,target:(null==r?void 0:r.current)||void 0}),times:[0,1],keyframes:[0,1],ease:t=>t,duration:1}}function Q({container:e,target:n,...s}={}){const i=h(I);(function(t,e){return"undefined"!=typeof window&&(t?r()&&!!G(e):o())})(n,s.offset)&&(i.scrollXProgress.accelerate=K("x",s,e,n),i.scrollYProgress.accelerate=K("y",s,e,n));const c=t.useRef(null),l=t.useRef(!1),a=t.useCallback(()=>(c.current=F((t,{x:e,y:n})=>{i.scrollX.set(e.current),i.scrollXProgress.set(e.progress),i.scrollY.set(n.current),i.scrollYProgress.set(n.progress)},{...s,container:(null==e?void 0:e.current)||void 0,target:(null==n?void 0:n.current)||void 0}),()=>{var t;null==(t=c.current)||t.call(c)}),[e,n,JSON.stringify(s.offset)]);return p(()=>(l.current=!1,J(e)||J(n)?void(l.current=!0):a()),[a]),t.useEffect(()=>l.current?(m(!J(e)),m(!J(n)),a()):void 0,[a]),i}export{x as a,Q as u};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.