{"version":3,"sources":["NavigationContainer.tsx"],"names":["React","BaseNavigationContainer","ThemeProvider","DefaultTheme","LinkingContext","useThenable","useLinking","useDocumentTitle","useBackButton","NavigationContainer","forwardRef","theme","linking","fallback","documentTitle","onReady","rest","ref","isLinkingEnabled","enabled","refContainer","useRef","getInitialState","prefixes","isResolved","initialState","useImperativeHandle","current","linkingContext","useMemo","options","isReady","onReadyRef","useEffect"],"mappings":";;AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SACEC,uBADF,QAIO,wBAJP;AAKA,OAAOC,aAAP,MAA0B,yBAA1B;AACA,OAAOC,YAAP,MAAyB,wBAAzB;AACA,OAAOC,cAAP,MAA2B,kBAA3B;AACA,OAAOC,WAAP,MAAwB,eAAxB;AACA,OAAOC,UAAP,MAAuB,cAAvB;AACA,OAAOC,gBAAP,MAA6B,oBAA7B;AACA,OAAOC,aAAP,MAA0B,iBAA1B;;AAWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,mBAAmB,gBAAGT,KAAK,CAACU,UAAN,CAAiB,SAASD,mBAAT,CAC3C;AACEE,EAAAA,KAAK,GAAGR,YADV;AAEES,EAAAA,OAFF;AAGEC,EAAAA,QAAQ,GAAG,IAHb;AAIEC,EAAAA,aAJF;AAKEC,EAAAA,OALF;AAME,KAAGC;AANL,CAD2C,EAS3CC,GAT2C,EAU3C;AACA,QAAMC,gBAAgB,GAAGN,OAAO,GAAGA,OAAO,CAACO,OAAR,KAAoB,KAAvB,GAA+B,KAA/D;AAEA,QAAMC,YAAY,GAAGpB,KAAK,CAACqB,MAAN,CAAqC,IAArC,CAArB;AAEAb,EAAAA,aAAa,CAACY,YAAD,CAAb;AACAb,EAAAA,gBAAgB,CAACa,YAAD,EAAeN,aAAf,CAAhB;AAEA,QAAM;AAAEQ,IAAAA;AAAF,MAAsBhB,UAAU,CAACc,YAAD,EAAe;AACnDD,IAAAA,OAAO,EAAED,gBAD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* as React from 'react';\nimport {\n BaseNavigationContainer,\n NavigationContainerProps,\n NavigationContainerRef,\n} from '@react-navigation/core';\nimport ThemeProvider from './theming/ThemeProvider';\nimport DefaultTheme from './theming/DefaultTheme';\nimport LinkingContext from './LinkingContext';\nimport useThenable from './useThenable';\nimport useLinking from './useLinking';\nimport useDocumentTitle from './useDocumentTitle';\nimport useBackButton from './useBackButton';\nimport type { Theme, LinkingOptions, DocumentTitleOptions } from './types';\n\ntype Props = NavigationContainerProps & {\n theme?: Theme;\n linking?: LinkingOptions;\n fallback?: React.ReactNode;\n documentTitle?: DocumentTitleOptions;\n onReady?: () => void;\n};\n\n/**\n * Container component which holds the navigation state designed for React Native apps.\n * This should be rendered at the root wrapping the whole app.\n *\n * @param props.initialState Initial state object for the navigation tree. When deep link handling is enabled, this will override deep links when specified. Make sure that you don't specify an `initialState` when there's a deep link (`Linking.getInitialURL()`).\n * @param props.onReady Callback which is called after the navigation tree mounts.\n * @param props.onStateChange Callback which is called with the latest navigation state when it changes.\n * @param props.theme Theme object for the navigators.\n * @param props.linking Options for deep linking. Deep link handling is enabled when this prop is provided, unless `linking.enabled` is `false`.\n * @param props.fallback Fallback component to render until we have finished getting initial state when linking is enabled. Defaults to `null`.\n * @param props.documentTitle Options to configure the document title on Web. Updating document title is handled by default unless `documentTitle.enabled` is `false`.\n * @param props.children Child elements to render the content.\n * @param props.ref Ref object which refers to the navigation object containing helper methods.\n */\nconst NavigationContainer = React.forwardRef(function NavigationContainer(\n {\n theme = DefaultTheme,\n linking,\n fallback = null,\n documentTitle,\n onReady,\n ...rest\n }: Props,\n ref?: React.Ref\n) {\n const isLinkingEnabled = linking ? linking.enabled !== false : false;\n\n const refContainer = React.useRef(null);\n\n useBackButton(refContainer);\n useDocumentTitle(refContainer, documentTitle);\n\n const { getInitialState } = useLinking(refContainer, {\n enabled: isLinkingEnabled,\n prefixes: [],\n ...linking,\n });\n\n const [isResolved, initialState] = useThenable(getInitialState);\n\n React.useImperativeHandle(ref, () => refContainer.current);\n\n const linkingContext = React.useMemo(() => ({ options: linking }), [linking]);\n\n const isReady = rest.initialState != null || !isLinkingEnabled || isResolved;\n\n const onReadyRef = React.useRef(onReady);\n\n React.useEffect(() => {\n onReadyRef.current = onReady;\n });\n\n React.useEffect(() => {\n if (isReady) {\n onReadyRef.current?.();\n }\n }, [isReady]);\n\n if (!isReady) {\n // This is temporary until we have Suspense for data-fetching\n // Then the fallback will be handled by a parent `Suspense` component\n return fallback as React.ReactElement;\n }\n\n return (\n \n \n \n \n \n );\n});\n\nexport default NavigationContainer;\n"]}