import"./DsnmJJEf.js";import{p as E,u as c,f as S,t as z,a as B,b as I,g as r,c as L,h as u,d as O,j as d,s as R,r as j}from"./qex-fw8l.js";import{s as H}from"./BwmH-_re.js";import{s as M}from"./CoLYeqRS.js";import{b as h}from"./DDqbu5pl.js";import{p as b}from"./pJHJUtud.js";var N=L('<div class="h-0 w-full shrink-0" aria-hidden="true"></div> <div><!></div>',1);function D(p,o){E(o,!0);let g=b(o,"height",15,0),x=b(o,"class",3,""),_=b(o,"noBorder",3,!1),n=u(!1),i=u(void 0),s=u(void 0),f=!0;c(()=>{if(!r(i))return;const e=new IntersectionObserver(([t])=>{f=t.isIntersecting,d(n,!t.isIntersecting)},{threshold:0,rootMargin:"-1px 0px 0px 0px"});return e.observe(r(i)),()=>e.disconnect()}),c(()=>{if(!r(s))return;const e=r(s).parentElement;if(!e)return;function t(w){if(!f)return;const l=w.target;l===document||l===document.documentElement||d(n,l.scrollTop>0)}return e.addEventListener("scroll",t,!0),()=>e.removeEventListener("scroll",t,!0)}),c(()=>{if(!r(s))return;const e=new ResizeObserver(([t])=>{g(t.borderBoxSize?.[0]?.blockSize??t.contentRect.height)});return e.observe(r(s)),()=>e.disconnect()});var m=N(),v=S(m);h(v,e=>d(i,e),()=>r(i));var a=R(v,2),k=O(a);H(k,()=>o.children,()=>({scrolled:r(n)})),j(a),h(a,e=>d(s,e),()=>r(s)),z(()=>M(a,1,`sticky top-0 z-10 bg-background transition-[border-color,box-shadow] duration-200
		${r(n)&&!_()?"border-b border-border shadow-sm":"border-b border-transparent"}
		${x()??""}`)),B(p,m),I()}export{D as S};
