var __spreadArrays=this&&this.__spreadArrays||function(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var n=Array(r),o=0,e=0;e<t;e++)for(var s=arguments[e],a=0,u=s.length;a<u;a++,o++)n[o]=s[a];return n};import{k as useState,u as useMemo}from"./dom-context-hooks.module-50442785.js";import{_}from"./index.module-b23fdad8.js";function useChildElements(){var r=_();var e=r.children.length?Array.from(r.children):[];var t=useState(e),n=t[0],o=t[1];var s;useMemo((function(){s=new MutationObserver((function(){var e=Array.from(r.children);o(__spreadArrays(e))}))}),[]);useMemo((function(){if(!s)return;s.observe(r,{childList:true});return function(){s.disconnect()}}),[r]);return n}export{useChildElements as u};