import*as React from'react';import NavigationBuilderContext from'./NavigationBuilderContext';export default function useFocusedListenersChildrenAdapter(_ref){var navigation=_ref.navigation,focusedListeners=_ref.focusedListeners;var _React$useContext=React.useContext(NavigationBuilderContext),addFocusedListener=_React$useContext.addFocusedListener;var listener=React.useCallback(function(callback){if(navigation.isFocused()){for(var _iterator=focusedListeners,_isArray=Array.isArray(_iterator),_i=0,_iterator=_isArray?_iterator:_iterator[typeof Symbol==="function"?Symbol.iterator:"@@iterator"]();;){var _ref2;if(_isArray){if(_i>=_iterator.length)break;_ref2=_iterator[_i++];}else{_i=_iterator.next();if(_i.done)break;_ref2=_i.value;}var _listener2=_ref2;var _listener3=_listener2(callback),_handled=_listener3.handled,_result=_listener3.result;if(_handled){return{handled:_handled,result:_result};}}return{handled:true,result:callback(navigation)};}else{return{handled:false,result:null};}},[focusedListeners,navigation]);React.useEffect(function(){return addFocusedListener==null?void 0:addFocusedListener(listener);},[addFocusedListener,listener]);}
//# sourceMappingURL=useFocusedListenersChildrenAdapter.js.map