{"ast":null,"code":"\"use strict\";\n\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nconst _excluded = [\"children\", \"layout\", \"screenOptions\", \"screenLayout\", \"screenListeners\", \"UNSTABLE_router\"];\nimport { CommonActions } from '@react-navigation/routers';\nimport * as React from 'react';\nimport { isValidElementType } from 'react-is';\nimport useLatestCallback from 'use-latest-callback';\nimport { deepFreeze } from \"./deepFreeze.js\";\nimport { Group } from \"./Group.js\";\nimport { isArrayEqual } from \"./isArrayEqual.js\";\nimport { isRecordEqual } from \"./isRecordEqual.js\";\nimport { NavigationHelpersContext } from \"./NavigationHelpersContext.js\";\nimport { NavigationRouteContext } from \"./NavigationRouteContext.js\";\nimport { NavigationStateContext } from \"./NavigationStateContext.js\";\nimport { PreventRemoveProvider } from \"./PreventRemoveProvider.js\";\nimport { Screen } from \"./Screen.js\";\nimport { PrivateValueStore } from \"./types.js\";\nimport { useChildListeners } from \"./useChildListeners.js\";\nimport { useClientLayoutEffect } from \"./useClientLayoutEffect.js\";\nimport { useComponent } from \"./useComponent.js\";\nimport { useCurrentRender } from \"./useCurrentRender.js\";\nimport { useDescriptors } from \"./useDescriptors.js\";\nimport { useEventEmitter } from \"./useEventEmitter.js\";\nimport { useFocusedListenersChildrenAdapter } from \"./useFocusedListenersChildrenAdapter.js\";\nimport { useFocusEvents } from \"./useFocusEvents.js\";\nimport { useKeyedChildListeners } from \"./useKeyedChildListeners.js\";\nimport { useLazyValue } from \"./useLazyValue.js\";\nimport { useNavigationHelpers } from \"./useNavigationHelpers.js\";\nimport { NavigationStateListenerProvider } from \"./useNavigationState.js\";\nimport { useOnAction } from \"./useOnAction.js\";\nimport { useOnGetState } from \"./useOnGetState.js\";\nimport { useOnRouteFocus } from \"./useOnRouteFocus.js\";\nimport { useRegisterNavigator } from \"./useRegisterNavigator.js\";\nimport { useScheduleUpdate } from \"./useScheduleUpdate.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nPrivateValueStore;\nconst isScreen = child => {\n  return child.type === Screen;\n};\nconst isGroup = child => {\n  return child.type === React.Fragment || child.type === Group;\n};\nconst isValidKey = key => key === undefined || typeof key === 'string' && key !== '';\nconst getRouteConfigsFromChildren = (children, groupKey, groupOptions, groupLayout) => {\n  const configs = React.Children.toArray(children).reduce((acc, child) => {\n    if (React.isValidElement(child)) {\n      if (isScreen(child)) {\n        if (typeof child.props !== 'object' || child.props === null) {\n          throw new Error(`Got an invalid element for screen.`);\n        }\n        if (typeof child.props.name !== 'string' || child.props.name === '') {\n          throw new Error(`Got an invalid name (${JSON.stringify(child.props.name)}) for the screen. It must be a non-empty string.`);\n        }\n        if (child.props.navigationKey !== undefined && (typeof child.props.navigationKey !== 'string' || child.props.navigationKey === '')) {\n          throw new Error(`Got an invalid 'navigationKey' prop (${JSON.stringify(child.props.navigationKey)}) for the screen '${child.props.name}'. It must be a non-empty string or 'undefined'.`);\n        }\n        acc.push({\n          keys: [groupKey, child.props.navigationKey],\n          options: groupOptions,\n          layout: groupLayout,\n          props: child.props\n        });\n        return acc;\n      }\n      if (isGroup(child)) {\n        if (!isValidKey(child.props.navigationKey)) {\n          throw new Error(`Got an invalid 'navigationKey' prop (${JSON.stringify(child.props.navigationKey)}) for the group. It must be a non-empty string or 'undefined'.`);\n        }\n        acc.push(...getRouteConfigsFromChildren(child.props.children, child.props.navigationKey, child.type !== Group ? groupOptions : groupOptions != null ? [...groupOptions, child.props.screenOptions] : [child.props.screenOptions], typeof child.props.screenLayout === 'function' ? child.props.screenLayout : groupLayout));\n        return acc;\n      }\n    }\n    throw new Error(`A navigator can only contain 'Screen', 'Group' or 'React.Fragment' as its direct children (found ${React.isValidElement(child) ? `'${typeof child.type === 'string' ? child.type : child.type?.name}'${child.props != null && typeof child.props === 'object' && 'name' in child.props && child.props?.name ? ` for the screen '${child.props.name}'` : ''}` : typeof child === 'object' ? JSON.stringify(child) : `'${String(child)}'`}). To render this component in the navigator, pass it in the 'component' prop to 'Screen'.`);\n  }, []);\n  if (process.env.NODE_ENV !== 'production') {\n    configs.forEach(config => {\n      const {\n        name,\n        children,\n        component,\n        getComponent\n      } = config.props;\n      if (children != null || component !== undefined || getComponent !== undefined) {\n        if (children != null && component !== undefined) {\n          throw new Error(`Got both 'component' and 'children' props for the screen '${name}'. You must pass only one of them.`);\n        }\n        if (children != null && getComponent !== undefined) {\n          throw new Error(`Got both 'getComponent' and 'children' props for the screen '${name}'. You must pass only one of them.`);\n        }\n        if (component !== undefined && getComponent !== undefined) {\n          throw new Error(`Got both 'component' and 'getComponent' props for the screen '${name}'. You must pass only one of them.`);\n        }\n        if (children != null && typeof children !== 'function') {\n          throw new Error(`Got an invalid value for 'children' prop for the screen '${name}'. It must be a function returning a React Element.`);\n        }\n        if (component !== undefined && !isValidElementType(component)) {\n          throw new Error(`Got an invalid value for 'component' prop for the screen '${name}'. It must be a valid React Component.`);\n        }\n        if (getComponent !== undefined && typeof getComponent !== 'function') {\n          throw new Error(`Got an invalid value for 'getComponent' prop for the screen '${name}'. It must be a function returning a React Component.`);\n        }\n        if (typeof component === 'function') {\n          if (component.name === 'component') {\n            console.warn(`Looks like you're passing an inline function for 'component' prop for the screen '${name}' (e.g. component={() => <SomeComponent />}). Passing an inline function will cause the component state to be lost on re-render and cause perf issues since it's re-created every render. You can pass the function as children to 'Screen' instead to achieve the desired behaviour.`);\n          } else if (/^[a-z]/.test(component.name)) {\n            console.warn(`Got a component with the name '${component.name}' for the screen '${name}'. React Components must start with an uppercase letter. If you're passing a regular function and not a component, pass it as children to 'Screen' instead. Otherwise capitalize your component's name.`);\n          }\n        }\n      } else {\n        throw new Error(`Couldn't find a 'component', 'getComponent' or 'children' prop for the screen '${name}'. This can happen if you passed 'undefined'. You likely forgot to export your component from the file it's defined in, or mixed up default import and named import when importing.`);\n      }\n    });\n  }\n  return configs;\n};\nexport function useNavigationBuilder(createRouter, options) {\n  const navigatorKey = useRegisterNavigator();\n  const route = React.useContext(NavigationRouteContext);\n  const {\n      children,\n      layout,\n      screenOptions,\n      screenLayout,\n      screenListeners,\n      UNSTABLE_router\n    } = options,\n    rest = _objectWithoutPropertiesLoose(options, _excluded);\n  const routeConfigs = getRouteConfigsFromChildren(children);\n  const router = useLazyValue(() => {\n    if (rest.initialRouteName != null && routeConfigs.every(config => config.props.name !== rest.initialRouteName)) {\n      throw new Error(`Couldn't find a screen named '${rest.initialRouteName}' to use as 'initialRouteName'.`);\n    }\n    const original = createRouter(rest);\n    if (UNSTABLE_router != null) {\n      const overrides = UNSTABLE_router(original);\n      return Object.assign({}, original, overrides);\n    }\n    return original;\n  });\n  const screens = routeConfigs.reduce((acc, config) => {\n    if (config.props.name in acc) {\n      throw new Error(`A navigator cannot contain multiple 'Screen' components with the same name (found duplicate screen named '${config.props.name}')`);\n    }\n    acc[config.props.name] = config;\n    return acc;\n  }, {});\n  const routeNames = routeConfigs.map(config => config.props.name);\n  const routeKeyList = routeNames.reduce((acc, curr) => {\n    acc[curr] = screens[curr].keys.map(key => key ?? '').join(':');\n    return acc;\n  }, {});\n  const routeParamList = routeNames.reduce((acc, curr) => {\n    const {\n      initialParams\n    } = screens[curr].props;\n    acc[curr] = initialParams;\n    return acc;\n  }, {});\n  const routeGetIdList = routeNames.reduce((acc, curr) => Object.assign(acc, {\n    [curr]: screens[curr].props.getId\n  }), {});\n  if (!routeNames.length) {\n    throw new Error(\"Couldn't find any screens for the navigator. Have you defined any screens as its children?\");\n  }\n  const isStateValid = React.useCallback(state => state.type === undefined || state.type === router.type, [router.type]);\n  const isStateInitialized = React.useCallback(state => state !== undefined && state.stale === false && isStateValid(state), [isStateValid]);\n  const {\n    state: currentState,\n    getState: getCurrentState,\n    setState: setCurrentState,\n    setKey,\n    getKey,\n    getIsInitial\n  } = React.useContext(NavigationStateContext);\n  const stateCleanedUp = React.useRef(false);\n  const setState = useLatestCallback(state => {\n    if (stateCleanedUp.current) {\n      return;\n    }\n    setCurrentState(state);\n  });\n  const [initializedState, isFirstStateInitialization] = React.useMemo(() => {\n    const initialRouteParamList = routeNames.reduce((acc, curr) => {\n      const {\n        initialParams\n      } = screens[curr].props;\n      const initialParamsFromParams = route?.params?.state == null && route?.params?.initial !== false && route?.params?.screen === curr ? route.params.params : undefined;\n      acc[curr] = initialParams !== undefined || initialParamsFromParams !== undefined ? Object.assign({}, initialParams, initialParamsFromParams) : undefined;\n      return acc;\n    }, {});\n    if ((currentState === undefined || !isStateValid(currentState)) && route?.params?.state == null && !(typeof route?.params?.screen === 'string' && route?.params?.initial !== false)) {\n      return [router.getInitialState({\n        routeNames,\n        routeParamList: initialRouteParamList,\n        routeGetIdList\n      }), true];\n    } else {\n      let stateFromParams;\n      if (route?.params?.state != null) {\n        stateFromParams = route.params.state;\n      } else if (typeof route?.params?.screen === 'string' && route?.params?.initial !== false) {\n        stateFromParams = {\n          index: 0,\n          routes: [{\n            name: route.params.screen,\n            params: route.params.params,\n            path: route.params.path\n          }]\n        };\n      }\n      return [router.getRehydratedState(stateFromParams ?? currentState, {\n        routeNames,\n        routeParamList: initialRouteParamList,\n        routeGetIdList\n      }), false];\n    }\n  }, [currentState, router, isStateValid]);\n  const previousRouteKeyListRef = React.useRef(routeKeyList);\n  React.useEffect(() => {\n    previousRouteKeyListRef.current = routeKeyList;\n  });\n  const previousRouteKeyList = previousRouteKeyListRef.current;\n  let state = isStateInitialized(currentState) ? currentState : initializedState;\n  let nextState = state;\n  if (!isArrayEqual(state.routeNames, routeNames) || !isRecordEqual(routeKeyList, previousRouteKeyList)) {\n    nextState = router.getStateForRouteNamesChange(state, {\n      routeNames,\n      routeParamList,\n      routeGetIdList,\n      routeKeyChanges: Object.keys(routeKeyList).filter(name => name in previousRouteKeyList && routeKeyList[name] !== previousRouteKeyList[name])\n    });\n  }\n  const previousNestedParamsRef = React.useRef(route?.params);\n  React.useEffect(() => {\n    previousNestedParamsRef.current = route?.params;\n  }, [route?.params]);\n  if (route?.params) {\n    const previousParams = previousNestedParamsRef.current;\n    let action;\n    if (typeof route.params.state === 'object' && route.params.state != null && route.params !== previousParams) {\n      action = CommonActions.reset(route.params.state);\n    } else if (typeof route.params.screen === 'string' && (route.params.initial === false && isFirstStateInitialization || route.params !== previousParams)) {\n      action = CommonActions.navigate({\n        name: route.params.screen,\n        params: route.params.params,\n        path: route.params.path,\n        merge: route.params.merge,\n        pop: route.params.pop\n      });\n    }\n    const updatedState = action ? router.getStateForAction(nextState, action, {\n      routeNames,\n      routeParamList,\n      routeGetIdList\n    }) : null;\n    nextState = updatedState !== null ? router.getRehydratedState(updatedState, {\n      routeNames,\n      routeParamList,\n      routeGetIdList\n    }) : nextState;\n  }\n  const shouldUpdate = state !== nextState;\n  useScheduleUpdate(() => {\n    if (shouldUpdate) {\n      setState(nextState);\n    }\n  });\n  state = nextState;\n  React.useEffect(() => {\n    stateCleanedUp.current = false;\n    setKey(navigatorKey);\n    if (!getIsInitial()) {\n      setState(nextState);\n    }\n    return () => {\n      if (getCurrentState() !== undefined && getKey() === navigatorKey) {\n        setCurrentState(undefined);\n        stateCleanedUp.current = true;\n      }\n    };\n  }, []);\n  const stateRef = React.useRef(state);\n  stateRef.current = state;\n  useClientLayoutEffect(() => {\n    stateRef.current = null;\n  });\n  const getState = useLatestCallback(() => {\n    const currentState = getCurrentState();\n    return deepFreeze(isStateInitialized(currentState) ? currentState : initializedState);\n  });\n  const emitter = useEventEmitter(e => {\n    const routeNames = [];\n    let route;\n    if (e.target) {\n      route = state.routes.find(route => route.key === e.target);\n      if (route?.name) {\n        routeNames.push(route.name);\n      }\n    } else {\n      route = state.routes[state.index];\n      routeNames.push(...Object.keys(screens).filter(name => route?.name === name));\n    }\n    if (route == null) {\n      return;\n    }\n    const navigation = descriptors[route.key].navigation;\n    const listeners = [].concat(...[screenListeners, ...routeNames.map(name => {\n      const {\n        listeners\n      } = screens[name].props;\n      return listeners;\n    })].map(listeners => {\n      const map = typeof listeners === 'function' ? listeners({\n        route: route,\n        navigation\n      }) : listeners;\n      return map ? Object.keys(map).filter(type => type === e.type).map(type => map?.[type]) : undefined;\n    })).filter((cb, i, self) => cb && self.lastIndexOf(cb) === i);\n    listeners.forEach(listener => listener?.(e));\n  });\n  useFocusEvents({\n    state,\n    emitter\n  });\n  React.useEffect(() => {\n    emitter.emit({\n      type: 'state',\n      data: {\n        state\n      }\n    });\n  }, [emitter, state]);\n  const {\n    listeners: childListeners,\n    addListener\n  } = useChildListeners();\n  const {\n    keyedListeners,\n    addKeyedListener\n  } = useKeyedChildListeners();\n  const onAction = useOnAction({\n    router,\n    getState,\n    setState,\n    key: route?.key,\n    actionListeners: childListeners.action,\n    beforeRemoveListeners: keyedListeners.beforeRemove,\n    routerConfigOptions: {\n      routeNames,\n      routeParamList,\n      routeGetIdList\n    },\n    emitter\n  });\n  const onRouteFocus = useOnRouteFocus({\n    router,\n    key: route?.key,\n    getState,\n    setState\n  });\n  const navigation = useNavigationHelpers({\n    id: options.id,\n    onAction,\n    getState,\n    emitter,\n    router,\n    stateRef\n  });\n  useFocusedListenersChildrenAdapter({\n    navigation,\n    focusedListeners: childListeners.focus\n  });\n  useOnGetState({\n    getState,\n    getStateListeners: keyedListeners.getState\n  });\n  const {\n    describe,\n    descriptors\n  } = useDescriptors({\n    state,\n    screens,\n    navigation,\n    screenOptions,\n    screenLayout,\n    onAction,\n    getState,\n    setState,\n    onRouteFocus,\n    addListener,\n    addKeyedListener,\n    router,\n    emitter\n  });\n  useCurrentRender({\n    state,\n    navigation,\n    descriptors\n  });\n  const NavigationContent = useComponent(children => {\n    const element = layout != null ? layout({\n      state,\n      descriptors,\n      navigation,\n      children\n    }) : children;\n    return _jsx(NavigationHelpersContext.Provider, {\n      value: navigation,\n      children: _jsx(NavigationStateListenerProvider, {\n        state: state,\n        children: _jsx(PreventRemoveProvider, {\n          children: element\n        })\n      })\n    });\n  });\n  return {\n    state,\n    navigation,\n    describe,\n    descriptors,\n    NavigationContent\n  };\n}","map":{"version":3,"names":["CommonActions","React","isValidElementType","useLatestCallback","deepFreeze","Group","isArrayEqual","isRecordEqual","NavigationHelpersContext","NavigationRouteContext","NavigationStateContext","PreventRemoveProvider","Screen","PrivateValueStore","useChildListeners","useClientLayoutEffect","useComponent","useCurrentRender","useDescriptors","useEventEmitter","useFocusedListenersChildrenAdapter","useFocusEvents","useKeyedChildListeners","useLazyValue","useNavigationHelpers","NavigationStateListenerProvider","useOnAction","useOnGetState","useOnRouteFocus","useRegisterNavigator","useScheduleUpdate","jsx","_jsx","isScreen","child","type","isGroup","Fragment","isValidKey","key","undefined","getRouteConfigsFromChildren","children","groupKey","groupOptions","groupLayout","configs","Children","toArray","reduce","acc","isValidElement","props","Error","name","JSON","stringify","navigationKey","push","keys","options","layout","screenOptions","screenLayout","String","process","env","NODE_ENV","forEach","config","component","getComponent","console","warn","test","useNavigationBuilder","createRouter","navigatorKey","route","useContext","screenListeners","UNSTABLE_router","rest","_objectWithoutPropertiesLoose","_excluded","routeConfigs","router","initialRouteName","every","original","overrides","Object","assign","screens","routeNames","map","routeKeyList","curr","join","routeParamList","initialParams","routeGetIdList","getId","length","isStateValid","useCallback","state","isStateInitialized","stale","currentState","getState","getCurrentState","setState","setCurrentState","setKey","getKey","getIsInitial","stateCleanedUp","useRef","current","initializedState","isFirstStateInitialization","useMemo","initialRouteParamList","initialParamsFromParams","params","initial","screen","getInitialState","stateFromParams","index","routes","path","getRehydratedState","previousRouteKeyListRef","useEffect","previousRouteKeyList","nextState","getStateForRouteNamesChange","routeKeyChanges","filter","previousNestedParamsRef","previousParams","action","reset","navigate","merge","pop","updatedState","getStateForAction","shouldUpdate","stateRef","emitter","e","target","find","navigation","descriptors","listeners","concat","cb","i","self","lastIndexOf","listener","emit","data","childListeners","addListener","keyedListeners","addKeyedListener","onAction","actionListeners","beforeRemoveListeners","beforeRemove","routerConfigOptions","onRouteFocus","id","focusedListeners","focus","getStateListeners","describe","NavigationContent","element","Provider","value"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/@react-navigation/core/src/useNavigationBuilder.tsx"],"sourcesContent":["import {\n  CommonActions,\n  type DefaultRouterOptions,\n  type NavigationAction,\n  type NavigationState,\n  type ParamListBase,\n  type PartialState,\n  type Route,\n  type Router,\n  type RouterConfigOptions,\n  type RouterFactory,\n} from '@react-navigation/routers';\nimport * as React from 'react';\nimport { isValidElementType } from 'react-is';\nimport useLatestCallback from 'use-latest-callback';\n\nimport { deepFreeze } from './deepFreeze';\nimport { Group } from './Group';\nimport { isArrayEqual } from './isArrayEqual';\nimport { isRecordEqual } from './isRecordEqual';\nimport { NavigationHelpersContext } from './NavigationHelpersContext';\nimport { NavigationRouteContext } from './NavigationRouteContext';\nimport { NavigationStateContext } from './NavigationStateContext';\nimport { PreventRemoveProvider } from './PreventRemoveProvider';\nimport { Screen } from './Screen';\nimport {\n  type DefaultNavigatorOptions,\n  type EventMapBase,\n  type EventMapCore,\n  type NavigatorScreenParams,\n  PrivateValueStore,\n  type RouteConfig,\n} from './types';\nimport { useChildListeners } from './useChildListeners';\nimport { useClientLayoutEffect } from './useClientLayoutEffect';\nimport { useComponent } from './useComponent';\nimport { useCurrentRender } from './useCurrentRender';\nimport { type ScreenConfigWithParent, useDescriptors } from './useDescriptors';\nimport { useEventEmitter } from './useEventEmitter';\nimport { useFocusedListenersChildrenAdapter } from './useFocusedListenersChildrenAdapter';\nimport { useFocusEvents } from './useFocusEvents';\nimport { useKeyedChildListeners } from './useKeyedChildListeners';\nimport { useLazyValue } from './useLazyValue';\nimport { useNavigationHelpers } from './useNavigationHelpers';\nimport { NavigationStateListenerProvider } from './useNavigationState';\nimport { useOnAction } from './useOnAction';\nimport { useOnGetState } from './useOnGetState';\nimport { useOnRouteFocus } from './useOnRouteFocus';\nimport { useRegisterNavigator } from './useRegisterNavigator';\nimport { useScheduleUpdate } from './useScheduleUpdate';\n\n// This is to make TypeScript compiler happy\n// eslint-disable-next-line @typescript-eslint/no-unused-expressions\nPrivateValueStore;\n\ntype NavigatorRoute = {\n  key: string;\n  params?: NavigatorScreenParams<ParamListBase>;\n};\n\nconst isScreen = (\n  child: React.ReactElement<unknown>\n): child is React.ReactElement<{\n  name?: unknown;\n  navigationKey?: unknown;\n}> => {\n  return child.type === Screen;\n};\n\nconst isGroup = (\n  child: React.ReactElement<unknown>\n): child is React.ReactElement<{\n  navigationKey?: unknown;\n  screenOptions?: unknown;\n  screenLayout?: unknown;\n  children?: unknown;\n}> => {\n  return child.type === React.Fragment || child.type === Group;\n};\n\nconst isValidKey = (key: unknown): key is string | undefined =>\n  key === undefined || (typeof key === 'string' && key !== '');\n\n/**\n * Extract route config object from React children elements.\n *\n * @param children React Elements to extract the config from.\n */\nconst getRouteConfigsFromChildren = <\n  State extends NavigationState,\n  ScreenOptions extends {},\n  EventMap extends EventMapBase,\n>(\n  children: React.ReactNode,\n  groupKey?: string,\n  groupOptions?: ScreenConfigWithParent<\n    State,\n    ScreenOptions,\n    EventMap\n  >['options'],\n  groupLayout?: ScreenConfigWithParent<State, ScreenOptions, EventMap>['layout']\n) => {\n  const configs = React.Children.toArray(children).reduce<\n    ScreenConfigWithParent<State, ScreenOptions, EventMap>[]\n  >((acc, child) => {\n    if (React.isValidElement(child)) {\n      if (isScreen(child)) {\n        // We can only extract the config from `Screen` elements\n        // If something else was rendered, it's probably a bug\n\n        if (typeof child.props !== 'object' || child.props === null) {\n          throw new Error(`Got an invalid element for screen.`);\n        }\n\n        if (typeof child.props.name !== 'string' || child.props.name === '') {\n          throw new Error(\n            `Got an invalid name (${JSON.stringify(\n              child.props.name\n            )}) for the screen. It must be a non-empty string.`\n          );\n        }\n\n        if (\n          child.props.navigationKey !== undefined &&\n          (typeof child.props.navigationKey !== 'string' ||\n            child.props.navigationKey === '')\n        ) {\n          throw new Error(\n            `Got an invalid 'navigationKey' prop (${JSON.stringify(\n              child.props.navigationKey\n            )}) for the screen '${\n              child.props.name\n            }'. It must be a non-empty string or 'undefined'.`\n          );\n        }\n\n        acc.push({\n          keys: [groupKey, child.props.navigationKey],\n          options: groupOptions,\n          layout: groupLayout,\n          props: child.props as RouteConfig<\n            ParamListBase,\n            string,\n            State,\n            ScreenOptions,\n            EventMap,\n            unknown\n          >,\n        });\n\n        return acc;\n      }\n\n      if (isGroup(child)) {\n        if (!isValidKey(child.props.navigationKey)) {\n          throw new Error(\n            `Got an invalid 'navigationKey' prop (${JSON.stringify(\n              child.props.navigationKey\n            )}) for the group. It must be a non-empty string or 'undefined'.`\n          );\n        }\n\n        // When we encounter a fragment or group, we need to dive into its children to extract the configs\n        // This is handy to conditionally define a group of screens\n        acc.push(\n          ...getRouteConfigsFromChildren<State, ScreenOptions, EventMap>(\n            child.props.children as React.ReactNode,\n            child.props.navigationKey,\n            // FIXME\n            // @ts-expect-error: add validation\n            child.type !== Group\n              ? groupOptions\n              : groupOptions != null\n                ? [...groupOptions, child.props.screenOptions]\n                : [child.props.screenOptions],\n            typeof child.props.screenLayout === 'function'\n              ? child.props.screenLayout\n              : groupLayout\n          )\n        );\n\n        return acc;\n      }\n    }\n\n    throw new Error(\n      `A navigator can only contain 'Screen', 'Group' or 'React.Fragment' as its direct children (found ${\n        React.isValidElement(child)\n          ? `'${\n              typeof child.type === 'string' ? child.type : child.type?.name\n            }'${\n              child.props != null &&\n              typeof child.props === 'object' &&\n              'name' in child.props &&\n              child.props?.name\n                ? ` for the screen '${child.props.name}'`\n                : ''\n            }`\n          : typeof child === 'object'\n            ? JSON.stringify(child)\n            : `'${String(child)}'`\n      }). To render this component in the navigator, pass it in the 'component' prop to 'Screen'.`\n    );\n  }, []);\n\n  if (process.env.NODE_ENV !== 'production') {\n    configs.forEach((config) => {\n      const { name, children, component, getComponent } = config.props;\n\n      if (\n        children != null ||\n        component !== undefined ||\n        getComponent !== undefined\n      ) {\n        if (children != null && component !== undefined) {\n          throw new Error(\n            `Got both 'component' and 'children' props for the screen '${name}'. You must pass only one of them.`\n          );\n        }\n\n        if (children != null && getComponent !== undefined) {\n          throw new Error(\n            `Got both 'getComponent' and 'children' props for the screen '${name}'. You must pass only one of them.`\n          );\n        }\n\n        if (component !== undefined && getComponent !== undefined) {\n          throw new Error(\n            `Got both 'component' and 'getComponent' props for the screen '${name}'. You must pass only one of them.`\n          );\n        }\n\n        if (children != null && typeof children !== 'function') {\n          throw new Error(\n            `Got an invalid value for 'children' prop for the screen '${name}'. It must be a function returning a React Element.`\n          );\n        }\n\n        if (component !== undefined && !isValidElementType(component)) {\n          throw new Error(\n            `Got an invalid value for 'component' prop for the screen '${name}'. It must be a valid React Component.`\n          );\n        }\n\n        if (getComponent !== undefined && typeof getComponent !== 'function') {\n          throw new Error(\n            `Got an invalid value for 'getComponent' prop for the screen '${name}'. It must be a function returning a React Component.`\n          );\n        }\n\n        if (typeof component === 'function') {\n          if (component.name === 'component') {\n            // Inline anonymous functions passed in the `component` prop will have the name of the prop\n            // It's relatively safe to assume that it's not a component since it should also have PascalCase name\n            // We won't catch all scenarios here, but this should catch a good chunk of incorrect use.\n            console.warn(\n              `Looks like you're passing an inline function for 'component' prop for the screen '${name}' (e.g. component={() => <SomeComponent />}). Passing an inline function will cause the component state to be lost on re-render and cause perf issues since it's re-created every render. You can pass the function as children to 'Screen' instead to achieve the desired behaviour.`\n            );\n          } else if (/^[a-z]/.test(component.name)) {\n            console.warn(\n              `Got a component with the name '${component.name}' for the screen '${name}'. React Components must start with an uppercase letter. If you're passing a regular function and not a component, pass it as children to 'Screen' instead. Otherwise capitalize your component's name.`\n            );\n          }\n        }\n      } else {\n        throw new Error(\n          `Couldn't find a 'component', 'getComponent' or 'children' prop for the screen '${name}'. This can happen if you passed 'undefined'. You likely forgot to export your component from the file it's defined in, or mixed up default import and named import when importing.`\n        );\n      }\n    });\n  }\n\n  return configs;\n};\n\n/**\n * Hook for building navigators.\n *\n * @param createRouter Factory method which returns router object.\n * @param options Options object containing `children` and additional options for the router.\n * @returns An object containing `state`, `navigation`, `descriptors` objects.\n */\nexport function useNavigationBuilder<\n  State extends NavigationState,\n  RouterOptions extends DefaultRouterOptions,\n  ActionHelpers extends Record<string, (...args: any) => void>,\n  ScreenOptions extends {},\n  EventMap extends Record<string, any>,\n>(\n  createRouter: RouterFactory<State, NavigationAction, RouterOptions>,\n  options: DefaultNavigatorOptions<\n    ParamListBase,\n    string | undefined,\n    State,\n    ScreenOptions,\n    EventMap,\n    any\n  > &\n    RouterOptions\n) {\n  const navigatorKey = useRegisterNavigator();\n\n  const route = React.useContext(NavigationRouteContext) as\n    | NavigatorRoute\n    | undefined;\n\n  const {\n    children,\n    layout,\n    screenOptions,\n    screenLayout,\n    screenListeners,\n    UNSTABLE_router,\n    ...rest\n  } = options;\n\n  const routeConfigs = getRouteConfigsFromChildren<\n    State,\n    ScreenOptions,\n    EventMap\n  >(children);\n\n  const router = useLazyValue<Router<State, any>>(() => {\n    if (\n      rest.initialRouteName != null &&\n      routeConfigs.every(\n        (config) => config.props.name !== rest.initialRouteName\n      )\n    ) {\n      throw new Error(\n        `Couldn't find a screen named '${rest.initialRouteName}' to use as 'initialRouteName'.`\n      );\n    }\n\n    const original = createRouter(rest as unknown as RouterOptions);\n\n    if (UNSTABLE_router != null) {\n      const overrides = UNSTABLE_router(original);\n\n      return {\n        ...original,\n        ...overrides,\n      };\n    }\n\n    return original;\n  });\n\n  const screens = routeConfigs.reduce<\n    Record<string, ScreenConfigWithParent<State, ScreenOptions, EventMap>>\n  >((acc, config) => {\n    if (config.props.name in acc) {\n      throw new Error(\n        `A navigator cannot contain multiple 'Screen' components with the same name (found duplicate screen named '${config.props.name}')`\n      );\n    }\n\n    acc[config.props.name] = config;\n    return acc;\n  }, {});\n\n  const routeNames = routeConfigs.map((config) => config.props.name);\n  const routeKeyList = routeNames.reduce<Record<string, React.Key | undefined>>(\n    (acc, curr) => {\n      acc[curr] = screens[curr].keys.map((key) => key ?? '').join(':');\n      return acc;\n    },\n    {}\n  );\n  const routeParamList = routeNames.reduce<Record<string, object | undefined>>(\n    (acc, curr) => {\n      const { initialParams } = screens[curr].props;\n      acc[curr] = initialParams;\n      return acc;\n    },\n    {}\n  );\n  const routeGetIdList = routeNames.reduce<\n    RouterConfigOptions['routeGetIdList']\n  >(\n    (acc, curr) =>\n      Object.assign(acc, {\n        [curr]: screens[curr].props.getId,\n      }),\n    {}\n  );\n\n  if (!routeNames.length) {\n    throw new Error(\n      \"Couldn't find any screens for the navigator. Have you defined any screens as its children?\"\n    );\n  }\n\n  const isStateValid = React.useCallback(\n    (state: NavigationState | PartialState<NavigationState>) =>\n      state.type === undefined || state.type === router.type,\n    [router.type]\n  );\n\n  const isStateInitialized = React.useCallback(\n    (state: NavigationState | PartialState<NavigationState> | undefined) =>\n      state !== undefined && state.stale === false && isStateValid(state),\n    [isStateValid]\n  );\n\n  const {\n    state: currentState,\n    getState: getCurrentState,\n    setState: setCurrentState,\n    setKey,\n    getKey,\n    getIsInitial,\n  } = React.useContext(NavigationStateContext);\n\n  const stateCleanedUp = React.useRef(false);\n\n  const setState = useLatestCallback(\n    (state: NavigationState | PartialState<NavigationState> | undefined) => {\n      if (stateCleanedUp.current) {\n        // State might have been already cleaned up due to unmount\n        // We do not want to expose API allowing to override this\n        // This would lead to old data preservation on main navigator unmount\n        return;\n      }\n\n      setCurrentState(state);\n    }\n  );\n\n  const [initializedState, isFirstStateInitialization] = React.useMemo(() => {\n    const initialRouteParamList = routeNames.reduce<\n      Record<string, object | undefined>\n    >((acc, curr) => {\n      const { initialParams } = screens[curr].props;\n      const initialParamsFromParams =\n        route?.params?.state == null &&\n        route?.params?.initial !== false &&\n        route?.params?.screen === curr\n          ? route.params.params\n          : undefined;\n\n      acc[curr] =\n        initialParams !== undefined || initialParamsFromParams !== undefined\n          ? {\n              ...initialParams,\n              ...initialParamsFromParams,\n            }\n          : undefined;\n\n      return acc;\n    }, {});\n\n    // If the current state isn't initialized on first render, we initialize it\n    // We also need to re-initialize it if the state passed from parent was changed (maybe due to reset)\n    // Otherwise assume that the state was provided as initial state\n    // So we need to rehydrate it to make it usable\n    if (\n      (currentState === undefined || !isStateValid(currentState)) &&\n      route?.params?.state == null &&\n      !(\n        typeof route?.params?.screen === 'string' &&\n        route?.params?.initial !== false\n      )\n    ) {\n      return [\n        router.getInitialState({\n          routeNames,\n          routeParamList: initialRouteParamList,\n          routeGetIdList,\n        }),\n        true,\n      ];\n    } else {\n      let stateFromParams;\n\n      if (route?.params?.state != null) {\n        stateFromParams = route.params.state;\n      } else if (\n        typeof route?.params?.screen === 'string' &&\n        route?.params?.initial !== false\n      ) {\n        stateFromParams = {\n          index: 0,\n          routes: [\n            {\n              name: route.params.screen,\n              params: route.params.params,\n              path: route.params.path,\n            },\n          ],\n        };\n      }\n\n      return [\n        router.getRehydratedState(\n          (stateFromParams ?? currentState) as PartialState<State>,\n          {\n            routeNames,\n            routeParamList: initialRouteParamList,\n            routeGetIdList,\n          }\n        ),\n        false,\n      ];\n    }\n    // We explicitly don't include routeNames, route.params etc. in the dep list\n    // below. We want to avoid forcing a new state to be calculated in those cases\n    // Instead, we handle changes to these in the nextState code below. Note\n    // that some changes to routeConfigs are explicitly ignored, such as changes\n    // to initialParams\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [currentState, router, isStateValid]);\n\n  const previousRouteKeyListRef = React.useRef(routeKeyList);\n\n  React.useEffect(() => {\n    previousRouteKeyListRef.current = routeKeyList;\n  });\n\n  const previousRouteKeyList = previousRouteKeyListRef.current;\n\n  let state =\n    // If the state isn't initialized, or stale, use the state we initialized instead\n    // The state won't update until there's a change needed in the state we have initialized locally\n    // So it'll be `undefined` or stale until the first navigation event happens\n    isStateInitialized(currentState)\n      ? (currentState as State)\n      : (initializedState as State);\n\n  let nextState: State = state;\n\n  if (\n    !isArrayEqual(state.routeNames, routeNames) ||\n    !isRecordEqual(routeKeyList, previousRouteKeyList)\n  ) {\n    // When the list of route names change, the router should handle it to remove invalid routes\n    nextState = router.getStateForRouteNamesChange(state, {\n      routeNames,\n      routeParamList,\n      routeGetIdList,\n      routeKeyChanges: Object.keys(routeKeyList).filter(\n        (name) =>\n          name in previousRouteKeyList &&\n          routeKeyList[name] !== previousRouteKeyList[name]\n      ),\n    });\n  }\n\n  const previousNestedParamsRef = React.useRef(route?.params);\n\n  React.useEffect(() => {\n    previousNestedParamsRef.current = route?.params;\n  }, [route?.params]);\n\n  if (route?.params) {\n    const previousParams = previousNestedParamsRef.current;\n\n    let action: CommonActions.Action | undefined;\n\n    if (\n      typeof route.params.state === 'object' &&\n      route.params.state != null &&\n      route.params !== previousParams\n    ) {\n      // If the route was updated with new state, we should reset to it\n      action = CommonActions.reset(route.params.state);\n    } else if (\n      typeof route.params.screen === 'string' &&\n      ((route.params.initial === false && isFirstStateInitialization) ||\n        route.params !== previousParams)\n    ) {\n      // If the route was updated with new screen name and/or params, we should navigate there\n      action = CommonActions.navigate({\n        name: route.params.screen,\n        params: route.params.params,\n        path: route.params.path,\n        merge: route.params.merge,\n        pop: route.params.pop,\n      });\n    }\n\n    // The update should be limited to current navigator only, so we call the router manually\n    const updatedState = action\n      ? router.getStateForAction(nextState, action, {\n          routeNames,\n          routeParamList,\n          routeGetIdList,\n        })\n      : null;\n\n    nextState =\n      updatedState !== null\n        ? router.getRehydratedState(updatedState, {\n            routeNames,\n            routeParamList,\n            routeGetIdList,\n          })\n        : nextState;\n  }\n\n  const shouldUpdate = state !== nextState;\n\n  useScheduleUpdate(() => {\n    if (shouldUpdate) {\n      // If the state needs to be updated, we'll schedule an update\n      setState(nextState);\n    }\n  });\n\n  // The up-to-date state will come in next render, but we don't need to wait for it\n  // We can't use the outdated state since the screens have changed, which will cause error due to mismatched config\n  // So we override the state object we return to use the latest state as soon as possible\n  state = nextState;\n\n  React.useEffect(() => {\n    // In strict mode, React will double-invoke effects.\n    // So we need to reset the flag if component was not unmounted\n    stateCleanedUp.current = false;\n\n    setKey(navigatorKey);\n\n    if (!getIsInitial()) {\n      // If it's not initial render, we need to update the state\n      // This will make sure that our container gets notifier of state changes due to new mounts\n      // This is necessary for proper screen tracking, URL updates etc.\n      setState(nextState);\n    }\n\n    return () => {\n      // We need to clean up state for this navigator on unmount\n      if (getCurrentState() !== undefined && getKey() === navigatorKey) {\n        setCurrentState(undefined);\n        stateCleanedUp.current = true;\n      }\n    };\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, []);\n\n  // In some cases (e.g. route names change), internal state might have changed\n  // But it hasn't been committed yet, so hasn't propagated to the sync external store\n  // During this time, we need to return the internal state in `getState`\n  // Otherwise it can result in inconsistent state during render in children\n  // To avoid this, we use a ref for render phase, and immediately clear it on commit\n  const stateRef = React.useRef<State | null>(state);\n\n  stateRef.current = state;\n\n  useClientLayoutEffect(() => {\n    stateRef.current = null;\n  });\n\n  const getState = useLatestCallback((): State => {\n    const currentState = getCurrentState();\n\n    return deepFreeze(\n      (isStateInitialized(currentState)\n        ? currentState\n        : initializedState) as State\n    );\n  });\n\n  const emitter = useEventEmitter<EventMapCore<State>>((e) => {\n    const routeNames = [];\n\n    let route: Route<string> | undefined;\n\n    if (e.target) {\n      route = state.routes.find((route) => route.key === e.target);\n\n      if (route?.name) {\n        routeNames.push(route.name);\n      }\n    } else {\n      route = state.routes[state.index];\n      routeNames.push(\n        ...Object.keys(screens).filter((name) => route?.name === name)\n      );\n    }\n\n    if (route == null) {\n      return;\n    }\n\n    const navigation = descriptors[route.key].navigation;\n\n    const listeners = ([] as (((e: any) => void) | undefined)[])\n      .concat(\n        // Get an array of listeners for all screens + common listeners on navigator\n        ...[\n          screenListeners,\n          ...routeNames.map((name) => {\n            const { listeners } = screens[name].props;\n            return listeners;\n          }),\n        ].map((listeners) => {\n          const map =\n            typeof listeners === 'function'\n              ? listeners({ route: route as any, navigation })\n              : listeners;\n\n          return map\n            ? Object.keys(map)\n                .filter((type) => type === e.type)\n                .map((type) => map?.[type])\n            : undefined;\n        })\n      )\n      // We don't want same listener to be called multiple times for same event\n      // So we remove any duplicate functions from the array\n      .filter((cb, i, self) => cb && self.lastIndexOf(cb) === i);\n\n    listeners.forEach((listener) => listener?.(e));\n  });\n\n  useFocusEvents({ state, emitter });\n\n  React.useEffect(() => {\n    emitter.emit({ type: 'state', data: { state } });\n  }, [emitter, state]);\n\n  const { listeners: childListeners, addListener } = useChildListeners();\n\n  const { keyedListeners, addKeyedListener } = useKeyedChildListeners();\n\n  const onAction = useOnAction({\n    router,\n    getState,\n    setState,\n    key: route?.key,\n    actionListeners: childListeners.action,\n    beforeRemoveListeners: keyedListeners.beforeRemove,\n    routerConfigOptions: {\n      routeNames,\n      routeParamList,\n      routeGetIdList,\n    },\n    emitter,\n  });\n\n  const onRouteFocus = useOnRouteFocus({\n    router,\n    key: route?.key,\n    getState,\n    setState,\n  });\n\n  const navigation = useNavigationHelpers<\n    State,\n    ActionHelpers,\n    NavigationAction,\n    EventMap\n  >({\n    id: options.id,\n    onAction,\n    getState,\n    emitter,\n    router,\n    stateRef,\n  });\n\n  useFocusedListenersChildrenAdapter({\n    navigation,\n    focusedListeners: childListeners.focus,\n  });\n\n  useOnGetState({\n    getState,\n    getStateListeners: keyedListeners.getState,\n  });\n\n  const { describe, descriptors } = useDescriptors<\n    State,\n    ActionHelpers,\n    ScreenOptions,\n    EventMap\n  >({\n    state,\n    screens,\n    navigation,\n    screenOptions,\n    screenLayout,\n    onAction,\n    getState,\n    setState,\n    onRouteFocus,\n    addListener,\n    addKeyedListener,\n    router,\n    // @ts-expect-error: this should have both core and custom events, but too much work right now\n    emitter,\n  });\n\n  useCurrentRender({\n    state,\n    navigation,\n    descriptors,\n  });\n\n  const NavigationContent = useComponent((children: React.ReactNode) => {\n    const element =\n      layout != null\n        ? layout({\n            state,\n            descriptors,\n            navigation,\n            children,\n          })\n        : children;\n\n    return (\n      <NavigationHelpersContext.Provider value={navigation}>\n        <NavigationStateListenerProvider state={state}>\n          <PreventRemoveProvider>{element}</PreventRemoveProvider>\n        </NavigationStateListenerProvider>\n      </NavigationHelpersContext.Provider>\n    );\n  });\n\n  return {\n    state,\n    navigation,\n    describe,\n    descriptors,\n    NavigationContent,\n  };\n}\n"],"mappings":";;;;AAAA,SACEA,aAAa,QAUR,2BAA2B;AAClC,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,kBAAkB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AAO;IACL7E,KAAK;IACLkD,UAAU;IACVyB,QAAQ;IACRxB,WAAW;IACXyB;EACF,CAAC;AACH","ignoreList":[]},"metadata":{"hasCjsExports":false},"sourceType":"module","externalDependencies":[]}