import{useMemo as t,useEffect as n,createElement as e}from"react";import{PresenceContext as r}from"../../context/PresenceContext.js";import{useConstant as o}from"../../utils/use-constant.js";var i=0;function u(){var t=i;return i++,t}var c=function(i){var c=i.children,f=i.initial,a=i.isPresent,l=i.onExitComplete,m=i.custom,p=i.presenceAffectsLayout,v=o(s),d=o(u),x=t((function(){return{id:d,initial:f,isPresent:a,custom:m,onExitComplete:function(t){v.set(t,!0);var n=!0;v.forEach((function(t){t||(n=!1)})),n&&(null==l||l())},register:function(t){return v.set(t,!1),function(){return v.delete(t)}}}}),p?void 0:[a]);return t((function(){v.forEach((function(t,n){return v.set(n,!1)}))}),[a]),n((function(){!a&&!v.size&&(null==l||l())}),[a]),e(r.Provider,{value:x},c)};function s(){return new Map}export{c as PresenceChild};
//# sourceMappingURL=PresenceChild.js.map
