import e from"@babel/runtime/helpers/slicedToArray";import{useState as r,useEffect as n}from"react";import{v4 as o}from"uuid";import{useDcFullscreenElemsCoordinator as t}from"../components/DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/DcFullscreenElemsCoordinatorProvider.js";import"../components/DevCenter/DevCenterAppContainer/components/DcFullscreenElemsCoordinatorProvider/IsInsideDcFullscreenElemProvider.js";function s(s){var i=s.isOpen,u=arguments.length>1&&void 0!==arguments[1]&&arguments[1],d=r(!1),l=e(d,2),c=l[0],p=l[1],m=t();if(!m)throw new Error("useDelayedDcFullscreenElemOpen must be used within DcFullscreenElemsCoordinatorProvider");var a=m.requestOpen,f=m.requestClose,v=r((function(){return o()})),C=e(v,1),D=C[0];return n((function(){i?a({setIsOpened:p,id:D},u):f({setIsOpened:p,id:D})}),[i]),n((function(){return function(){f({setIsOpened:p,id:D},!0)}}),[]),{delayedIsOpen:c,requestOpen:function(){return a({setIsOpened:p,id:D},u)},requestClose:function(e){return f({setIsOpened:p,id:D},e)}}}export{s as useDelayedDcFullscreenElemOpen};
//# sourceMappingURL=useDelayedDcFullscreenElemOpen.js.map
