1import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-C21x__mS.js";import{t as n}from"./jsx-runtime-BdxMnOeJ.js";import{i as r,n as i}from"./dist-ByveD8D5.js";import{t as a}from"./dist-CXZQFPEg.js";var o=e(t(),1),s=n(),c=Object.defineProperty,l=(e,t)=>c(e,`name`,{value:t,configurable:!0});function u(e){let t=e+`CollectionProvider`,[n,c]=a(t),[u,d]=n(t,{collectionRef:{current:null},itemMap:new Map}),f=l(e=>{let{scope:t,children:n}=e,r=o.useRef(null),i=o.useRef(new Map).current;return(0,s.jsx)(u,{scope:t,itemMap:i,collectionRef:r,children:n})},`CollectionProvider`);f.displayName=t;let p=e+`CollectionSlot`,m=i(p),h=o.forwardRef((e,t)=>{let{scope:n,children:i}=e,a=d(p,n),o=r(t,a.collectionRef);return(0,s.jsx)(m,{ref:o,children:i})});h.displayName=p;let g=e+`CollectionItemSlot`,_=`data-radix-collection-item`,v=i(g),y=o.forwardRef((e,t)=>{let{scope:n,children:i,...a}=e,c=o.useRef(null),l=r(t,c),u=d(g,n);return o.useEffect(()=>(u.itemMap.set(c,{ref:c,...a}),()=>void u.itemMap.delete(c))),(0,s.jsx)(v,{[_]:``,ref:l,children:i})});y.displayName=g;function b(t){let n=d(e+`CollectionConsumer`,t);return o.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${_}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return l(b,`useCollection`),[{Provider:f,Slot:h,ItemSlot:y},b,c]}l(u,`createCollection`);var d=new WeakMap,f=class e extends Map{static{l(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],d.set(this,!0)}set(e,t){return d.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=h(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=p(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=p(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return p(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function p(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=m(e,t);return n===-1?void 0:e[n]}l(p,`at`);function m(e,t){let n=e.length,r=h(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}l(m,`toSafeIndex`);function h(e){return e!==e||e===0?0:Math.trunc(e)}l(h,`toSafeInteger`);function g(e){let t=e+`CollectionProvider`,[n,c]=a(t),[u,d]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new f,setItemMap:l(()=>void 0,`setItemMap`)}),p=l(({state:e,...t})=>e?(0,s.jsx)(h,{...t,state:e}):(0,s.jsx)(m,{...t}),`CollectionProvider`);p.displayName=t;let m=l(e=>{let t=T();return(0,s.jsx)(h,{...e,state:t})},`CollectionInit`);m.displayName=t+`Init`;let h=l(e=>{let{scope:t,children:n,state:i}=e,a=o.useRef(null),[c,l]=o.useState(null),d=r(a,l),[f,p]=i;return o.useEffect(()=>{if(!c)return;let e=b(()=>{});return e.observe(c,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[c]),(0,s.jsx)(u,{scope:t,itemMap:f,setItemMap:p,collectionRef:d,collectionRefObject:a,collectionElement:c,children:n})},`CollectionProviderImpl`);h.displayName=t+`Impl`;let g=e+`CollectionSlot`,v=i(g),x=o.forwardRef((e,t)=>
1{let{scope:n,children:i}=e,a=d(g,n),o=r(t,a.collectionRef);return(0,s.jsx)(v,{ref:o,children:i})});x.displayName=g;let S=e+`CollectionItemSlot`,C=i(S),w=o.forwardRef((e,t)=>{let{scope:n,children:i,...a}=e,c=o.useRef(null),[l,u]=o.useState(null),p=r(t,c,u),{setItemMap:m}=d(S,n),h=o.useRef(a);_(h.current,a)||(h.current=a);let g=h.current;return o.useEffect(()=>{let e=g;return m(t=>l?t.has(l)?t.set(l,{...e,element:l}).toSorted(y):(t.set(l,{...e,element:l}),t.toSorted(y)):t),()=>{m(e=>!l||!e.has(l)?e:(e.delete(l),new f(e)))}},[l,g,m]),(0,s.jsx)(C,{"data-radix-collection-item":``,ref:p,children:i})});w.displayName=S;function T(){return o.useState(new f)}l(T,`useInitCollection`);function E(t){let{itemMap:n}=d(e+`CollectionConsumer`,t);return n}return l(E,`useCollection`),[{Provider:p,Slot:x,ItemSlot:w},{createCollectionScope:c,useCollection:E,useInitCollection:T}]}l(g,`createCollection`);function _(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}l(_,`shallowEqual`);function v(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}l(v,`isElementPreceding`);function y(e,t){return!e[1].element||!t[1].element?0:v(e[1].element,t[1].element)?-1:1}l(y,`sortByDocumentPosition`);function b(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}l(b,`getChildListObserver`);export{u as t};
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.