{"ast":null,"code":"\"use strict\";\n\nimport _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nimport { NavigationContext, NavigationRouteContext } from '@react-navigation/native';\nimport * as React from 'react';\nimport StyleSheet from \"react-native-web/dist/exports/StyleSheet\";\nimport View from \"react-native-web/dist/exports/View\";\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\nimport { Background } from \"./Background.js\";\nimport { getDefaultHeaderHeight } from \"./Header/getDefaultHeaderHeight.js\";\nimport { HeaderHeightContext } from \"./Header/HeaderHeightContext.js\";\nimport { HeaderShownContext } from \"./Header/HeaderShownContext.js\";\nimport { useFrameSize } from \"./useFrameSize.js\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport function Screen(props) {\n  var insets = useSafeAreaInsets();\n  var isParentHeaderShown = React.useContext(HeaderShownContext);\n  var parentHeaderHeight = React.useContext(HeaderHeightContext);\n  var focused = props.focused,\n    _props$modal = props.modal,\n    modal = _props$modal === void 0 ? false : _props$modal,\n    header = props.header,\n    _props$headerShown = props.headerShown,\n    headerShown = _props$headerShown === void 0 ? true : _props$headerShown,\n    headerTransparent = props.headerTransparent,\n    _props$headerStatusBa = props.headerStatusBarHeight,\n    headerStatusBarHeight = _props$headerStatusBa === void 0 ? isParentHeaderShown ? 0 : insets.top : _props$headerStatusBa,\n    navigation = props.navigation,\n    route = props.route,\n    children = props.children,\n    style = props.style;\n  var defaultHeaderHeight = useFrameSize(function (size) {\n    return getDefaultHeaderHeight(size, modal, headerStatusBarHeight);\n  });\n  var _React$useState = React.useState(defaultHeaderHeight),\n    _React$useState2 = _slicedToArray(_React$useState, 2),\n    headerHeight = _React$useState2[0],\n    setHeaderHeight = _React$useState2[1];\n  return _jsxs(Background, {\n    \"aria-hidden\": !focused,\n    style: [styles.container, style],\n    collapsable: false,\n    children: [headerShown ? _jsx(NavigationContext.Provider, {\n      value: navigation,\n      children: _jsx(NavigationRouteContext.Provider, {\n        value: route,\n        children: _jsx(View, {\n          pointerEvents: \"box-none\",\n          onLayout: function onLayout(e) {\n            var height = e.nativeEvent.layout.height;\n            setHeaderHeight(height);\n          },\n          style: [styles.header, headerTransparent ? styles.absolute : null],\n          children: header\n        })\n      })\n    }) : null, _jsx(View, {\n      style: styles.content,\n      children: _jsx(HeaderShownContext.Provider, {\n        value: isParentHeaderShown || headerShown !== false,\n        children: _jsx(HeaderHeightContext.Provider, {\n          value: headerShown ? headerHeight : parentHeaderHeight != null ? parentHeaderHeight : 0,\n          children: children\n        })\n      })\n    })]\n  });\n}\nvar styles = StyleSheet.create({\n  container: {\n    flex: 1\n  },\n  content: {\n    flex: 1\n  },\n  header: {\n    zIndex: 1\n  },\n  absolute: {\n    position: 'absolute',\n    top: 0,\n    start: 0,\n    end: 0\n  }\n});","map":{"version":3,"names":["NavigationContext","NavigationRouteContext","React","StyleSheet","View","useSafeAreaInsets","Background","getDefaultHeaderHeight","HeaderHeightContext","HeaderShownContext","useFrameSize","jsx","_jsx","jsxs","_jsxs","Screen","props","insets","isParentHeaderShown","useContext","parentHeaderHeight","focused","_props$modal","modal","header","_props$headerShown","headerShown","headerTransparent","_props$headerStatusBa","headerStatusBarHeight","top","navigation","route","children","style","defaultHeaderHeight","size","_React$useState","useState","_React$useState2","_slicedToArray","headerHeight","setHeaderHeight","styles","container","collapsable","Provider","value","pointerEvents","onLayout","e","height","nativeEvent","layout","absolute","content","create","flex","zIndex","position","start","end"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/@react-navigation/elements/src/Screen.tsx"],"sourcesContent":["import {\n  NavigationContext,\n  type NavigationProp,\n  NavigationRouteContext,\n  type ParamListBase,\n  type RouteProp,\n} from '@react-navigation/native';\nimport * as React from 'react';\nimport {\n  Animated,\n  type StyleProp,\n  StyleSheet,\n  View,\n  type ViewStyle,\n} from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport { Background } from './Background';\nimport { getDefaultHeaderHeight } from './Header/getDefaultHeaderHeight';\nimport { HeaderHeightContext } from './Header/HeaderHeightContext';\nimport { HeaderShownContext } from './Header/HeaderShownContext';\nimport { useFrameSize } from './useFrameSize';\n\ntype Props = {\n  focused: boolean;\n  modal?: boolean;\n  navigation: NavigationProp<ParamListBase>;\n  route: RouteProp<ParamListBase>;\n  header: React.ReactNode;\n  headerShown?: boolean;\n  headerStatusBarHeight?: number;\n  headerTransparent?: boolean;\n  style?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;\n  children: React.ReactNode;\n};\n\nexport function Screen(props: Props) {\n  const insets = useSafeAreaInsets();\n\n  const isParentHeaderShown = React.useContext(HeaderShownContext);\n  const parentHeaderHeight = React.useContext(HeaderHeightContext);\n\n  const {\n    focused,\n    modal = false,\n    header,\n    headerShown = true,\n    headerTransparent,\n    headerStatusBarHeight = isParentHeaderShown ? 0 : insets.top,\n    navigation,\n    route,\n    children,\n    style,\n  } = props;\n\n  const defaultHeaderHeight = useFrameSize((size) =>\n    getDefaultHeaderHeight(size, modal, headerStatusBarHeight)\n  );\n\n  const [headerHeight, setHeaderHeight] = React.useState(defaultHeaderHeight);\n\n  return (\n    <Background\n      aria-hidden={!focused}\n      style={[styles.container, style]}\n      // On Fabric we need to disable collapsing for the background to ensure\n      // that we won't render unnecessary views due to the view flattening.\n      collapsable={false}\n    >\n      {headerShown ? (\n        <NavigationContext.Provider value={navigation}>\n          <NavigationRouteContext.Provider value={route}>\n            <View\n              pointerEvents=\"box-none\"\n              onLayout={(e) => {\n                const { height } = e.nativeEvent.layout;\n\n                setHeaderHeight(height);\n              }}\n              style={[\n                styles.header,\n                headerTransparent ? styles.absolute : null,\n              ]}\n            >\n              {header}\n            </View>\n          </NavigationRouteContext.Provider>\n        </NavigationContext.Provider>\n      ) : null}\n      <View style={styles.content}>\n        <HeaderShownContext.Provider\n          value={isParentHeaderShown || headerShown !== false}\n        >\n          <HeaderHeightContext.Provider\n            value={headerShown ? headerHeight : (parentHeaderHeight ?? 0)}\n          >\n            {children}\n          </HeaderHeightContext.Provider>\n        </HeaderShownContext.Provider>\n      </View>\n    </Background>\n  );\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n  },\n  content: {\n    flex: 1,\n  },\n  header: {\n    zIndex: 1,\n  },\n  absolute: {\n    position: 'absolute',\n    top: 0,\n    start: 0,\n    end: 0,\n  },\n});\n"],"mappings":";;;AAAA,SACEA,iBAAiB,EAEjBC,sBAAsB,QAGjB,0BAA0B;AACjC,OAAO,KAAKC,KAAK,MAAM,OAAO;AAAA,OAAAC,UAAA;AAAA,OAAAC,IAAA;AAQ9B,SAASC,iBAAiB,QAAQ,gCAAgC;AAElE,SAASC,UAAU;AACnB,SAASC,sBAAsB;AAC/B,SAASC,mBAAmB;AAC5B,SAASC,kBAAkB;AAC3B,SAASC,YAAY;AAAyB,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAe9C,OAAO,SAASC,MAAMA,CAACC,KAAY,EAAE;EACnC,IAAMC,MAAM,GAAGZ,iBAAiB,CAAC,CAAC;EAElC,IAAMa,mBAAmB,GAAGhB,KAAK,CAACiB,UAAU,CAACV,kBAAkB,CAAC;EAChE,IAAMW,kBAAkB,GAAGlB,KAAK,CAACiB,UAAU,CAACX,mBAAmB,CAAC;EAEhE,IACEa,OAAO,GAULL,KAAK,CAVPK,OAAO;IAAAC,YAAA,GAULN,KAAK,CATPO,KAAK;IAALA,KAAK,GAAAD,YAAA,cAAG,KAAK,GAAAA,YAAA;IACbE,MAAM,GAQJR,KAAK,CARPQ,MAAM;IAAAC,kBAAA,GAQJT,KAAK,CAPPU,WAAW;IAAXA,WAAW,GAAAD,kBAAA,cAAG,IAAI,GAAAA,kBAAA;IAClBE,iBAAiB,GAMfX,KAAK,CANPW,iBAAiB;IAAAC,qBAAA,GAMfZ,KAAK,CALPa,qBAAqB;IAArBA,qBAAqB,GAAAD,qBAAA,cAAGV,mBAAmB,GAAG,CAAC,GAAGD,MAAM,CAACa,GAAG,GAAAF,qBAAA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