PageSourceSearch

https://modrinth.com/_nuxt/B5CG4_Oc.js

js modrinth.com collected 2026-10-01 10:39:27 UTC 2,578 bytes, 1 lines download raw bytes

1import{c as g,w as x,cn as y,Q as h}from"./DUququmF.js";function R(e){if(!e)return window;let o=e.parentElement;for(;o;){const{overflowY:t}=getComputedStyle(o);if(t==="auto"||t==="scroll")return o;o=o.parentElement}return window}function T(e){return e instanceof Window?window.scrollY:e.scrollTop}function L(e){return e instanceof Window?window.innerHeight:e.clientHeight}function W(e={}){const o=h(null),t=h(null),i=h(0),f=h(0),a=h(0),w=g(()=>Math.max(0,i.value-a.value));function d(){const r=o.value,n=t.value;if(!(!r||!n))if(n instanceof Window)a.value=r.getBoundingClientRect().top+window.scrollY;else{const l=r.getBoundingClientRect(),u=n.getBoundingClientRect();a.value=l.top-u.top+n.scrollTop}}function s(){const r=o.value;if(!r)return;const n=R(r);t.value=n,i.value=T(n),f.value=L(n),d()}function c(){i.value=0,f.value=0,a.value=0}function p(){t.value&&(i.value=T(t.value),d()),e.onScroll?.()}function S(){s(),e.onResize?.()}return y(r=>{if(typeof window>"u")return;const n=o.value;if(!n)return;const l=R(n);t.value=l,s(),l.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",S,{passive:!0});let u;l instanceof Window||(u=new ResizeObserver(()=>{s()}),u.observe(l)),r(()=>{l.removeEventListener("scroll",p),window.removeEventListener("resize",S),u?.disconnect()})}),{resetScrollState:c,containerOffset:a,listContainer:o,relativeScrollTop:w,scrollContainer:t,scrollTop:i,syncScrollState:s,updateContainerOffset:d,viewportHeight:f}}function V(e,o){const{itemHeight:t,bufferSize:i=5,initialItemCount:f=20,enabled:a,onNearEnd:w,nearEndThreshold:d=.2}=o,{containerOffset:s,listContainer:c,relativeScrollTop:p,resetScrollState:S,scrollContainer:r,syncScrollState:n,viewportHeight:l}=W({onScroll:B}),u=g(()=>e.value.length*t),m=g(()=>{if(a&&!a.value)return{start:0,end:e.value.length};if(!c.value||!r.value)return{start:0,end:Math.min(e.value.length,f)};const v=Math.floor(p.value/t),b=Math.ceil(l.value/t)+i*2,C=Math.min(Math.max(0,v-i),Math.max(0,e.value.length-b)),O=Math.min(e.value.length,C+b);return{start:C,end:O}}),M=g(()=>a&&!a.value?0:m.value.start*t),z=g(()=>e.value.slice(m.value.start,m.value.end));function H(v){if(v<0||v>=e.value.length||(n(),!c.value||!r.value))return;const E=s.value+v*t-(l.value-t)/2;r.value.scrollTo({top:Math.max(0,E),behavior:"instant"}),n()}function B(){if(!w||!c.value||!l.value)return;c.value.getBoundingClientRect().bottom-l.value<l.value*d&&w()}return x(e,()=>{n()}),{listContainer:c,totalHeight:u,visibleRange:m,visibleTop:M,visibleItems:z,scrollToIndex:H,resetScrollState:S,syncScrollState:n}}export{V 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.