1import{a as C}from"./FN6EICGO-DXg5uv0u.js";import{m as g,d as D,u as I}from"./index-DvQraQr3.js";import{v as l,f as a,H as h,b as p,G as O}from"./web-Daoi1TEa.js";import{b as P}from"./R5675YMU-DknHYXiZ.js";var f=O();function v(){return h(f)}function E(){const e=v();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function m(e,o){return!!(o.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function b(e,o){const t=o.ref();if(!t)return-1;let n=e.length;if(!n)return-1;for(;n--;){const s=e[n]?.ref();if(s&&m(s,t))return n+1}return 0}function x(e){const o=e.map((n,s)=>[s,n]);let t=!1;return o.sort(([n,s],[r,i])=>{const c=s.ref(),u=i.ref();return c===u||!c||!u?0:m(c,u)?(n>r&&(t=!0),-1):(n<r&&(t=!0),1)}),t?o.map(([n,s])=>s):e}function d(e,o){const t=x(e);e!==t&&o(t)}function w(e){const o=e[0],t=e[e.length-1]?.ref();let n=o?.ref()?.parentElement;for(;n;){if(t&&n.contains(t))return n;n=n.parentElement}return D(n).body}function T(e,o){l(()=>{const t=setTimeout(()=>{d(e(),o)});a(()=>clearTimeout(t))})}function M(e,o){if(typeof IntersectionObserver!="function"){T(e,o);return}let t=[];l(()=>{const n=()=>{const i=!!t.length;t=e(),i&&d(e(),o)},s=w(e()),r=new IntersectionObserver(n,{root:s});for(const i of e()){const c=i.ref();c&&r.observe(c)}a(()=>r.disconnect())})}function S(e={}){const[o,t]=C({value:()=>P(e.items),onChange:r=>e.onItemsChange?.(r)});M(o,t);const n=r=>(t(i=>{const c=b(i,r);return I(i,r,c)}),()=>{t(i=>{const c=i.filter(u=>u.ref()!==r.ref());return i.length===c.length?i:c})});return{DomCollectionProvider:r=>p(f.Provider,{value:{registerItem:n},get children(){return r.children}})}}function _(e){const o=E(),t=g({shouldRegisterItem:!0},e);l(()=>{if(!t.shouldRegisterItem)return;const n=o.registerItem(t.getItem());a(n)})}export{_ as a,S as c,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.