import{a as e,n as t}from"./chunk-BneVvdWh.js";import{t as n}from"./react-C7IZe2D1.js";import{ht as r,t as i,w as a}from"./dist-DtfJeYQK.js";import{t as o}from"./jsx-runtime-C2wGStra.js";import{n as s,t as c}from"./dist-Cc1j9Pjk.js";var l,u,d,f=t((()=>{a(),c(),i(),l=e(n(),1),u=o(),d=({onIntersect:e,once:t,threshold:n,tag:i,dataset:a,children:o})=>{let c=(0,l.useRef)(null);return(0,l.useEffect)(()=>{let r=([n],r)=>{n.isIntersecting&&(e(),t&&c.current&&r.unobserve(c.current))},i={threshold:n},a=new IntersectionObserver(r,i);return c.current&&a.observe(c.current),()=>a.disconnect()},[e,t,n]),(0,u.jsx)(i??`div`,{ref:c,...r(a,{preplyDsComponent:s.ObserverIntersection}),children:o})};try{d.displayName=`ObserveIntersection`,d.__docgenInfo={description:`An [IntersectionObserver](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver) wrapper.

Triggers a callback when the wrapped component intersects with the viewport.

This can be useful in several use cases. Examples:

- Track an experiment, once a certain component scrolls into view.
- Trigger an animation, or a feature (e.g.: onboarding instructions).`,displayName:`ObserveIntersection`,props:{onIntersect:{defaultValue:null,description:``,name:`onIntersect`,required:!0,type:{name:`() => void`}},once:{defaultValue:null,description:``,name:`once`,required:!1,type:{name:`enum`,value:[{value:`false`},{value:`true`}]}},threshold:{defaultValue:null,description:``,name:`threshold`,required:!1,type:{name:`enum`,value:[{value:`number`}]}},tag:{defaultValue:null,description:``,name:`tag`,required:!1,type:{name:`enum`,value:[{value:`"article"`},{value:`"caption"`},{value:`"div"`},{value:`"fieldset"`},{value:`"figcaption"`},{value:`"figure"`},{value:`"footer"`},{value:`"header"`},{value:`"li"`},{value:`"main"`},{value:`"ol"`},{value:`"p"`},{value:`"section"`},{value:`"span"`},{value:`"table"`},{value:`"tbody"`},{value:`"td"`},{value:`"tfoot"`},{value:`"th"`},{value:`"thead"`},{value:`"tr"`},{value:`"ul"`}]}},dataset:{defaultValue:null,description:``,name:`dataset`,required:!1,type:{name:`enum`,value:[{value:`Dataset`}]}}}}}catch{}}));export{f as n,d as t};