// Metro module 9113 (f9114). import { I18nManager, StyleSheet, View, Platform } from "react-native"; import { useTheme } from "./Module1481"; import { processFonts } from "./Module9114"; import { getHeaderTitle, HeaderTitle } from "./Module5579"; import useNavigationHeaderAccessibilityRefreshKey from "./useNavigationHeaderAccessibilityRefreshKey"; import * as _Module4536 from "./Module4536"; import { isSearchBarAvailableForCurrentPlatform, isNewBackTitleImplementation, ScreenStackHeaderCenterView, ScreenStackHeaderConfig, ScreenStackHeaderBackButtonImage, ScreenStackHeaderRightView, ScreenStackHeaderSearchBarView } from "./Module4536"; Platform; const styles = StyleSheet.create({ row: { flexDirection: "row", alignItems: "center" } }); export default function HeaderConfig(props) { let r156, ScreenStackHeaderLeftView; const { headerBackImageSource, headerBackButtonMenuEnabled, headerBackTitle, headerBackTitleStyle, headerBackTitleVisible = true, headerBackVisible, headerShadowVisible, headerLargeStyle, headerLargeTitle, headerLargeTitleShadowVisible, headerLargeTitleStyle, headerBackground, headerLeft, headerRight, headerShown, headerStyle, headerBlurEffect, headerTintColor, headerTitle, headerTitleAlign, headerTitleStyle } = props; let headerTransparent = props.headerTransparent; const { headerSearchBarOptions, headerTopInsetEnabled, UNSTABLE_headerInsets, route, title, canGoBack } = props; const colors = useTheme().colors; const tintColor = headerTintColor == null ? colors.text : headerTintColor; const r41 = StyleSheet.flatten(headerBackTitleStyle) || {}; const r30 = StyleSheet.flatten(headerLargeTitleStyle) || {}; const r59 = StyleSheet.flatten(headerTitleStyle) || {}; const r44 = StyleSheet.flatten(headerStyle) || {}; const r32 = StyleSheet.flatten(headerLargeStyle) || {}; const [backTitleFontFamily, largeTitleFontFamily, titleFontFamily] = processFonts([r41.fontFamily, r30.fontFamily, r59.fontFamily]); const headerTitle2 = getHeaderTitle({ title, headerTitle }, route.name); let color = r59.color; if (color == null) { color = headerTintColor; } if (color == null) { color = colors.text; } const { fontSize, fontWeight } = r59; const style = { color }; if (r59.fontFamily != null) { style.fontFamily = r59.fontFamily; } if (fontSize != null) { style.fontSize = fontSize; } if (fontWeight != null) { style.fontWeight = fontWeight; } const r84 = headerLeft == null ? void 0 : headerLeft({ tintColor, canGoBack, label: headerBackTitle }); const r87 = headerRight == null ? void 0 : headerRight({ tintColor, canGoBack }); let r89 = typeof headerTitle === "function" ? headerTitle({ tintColor, children: headerTitle2 }) : null; useNavigationHeaderAccessibilityRefreshKey(); const r98 = typeof isSearchBarAvailableForCurrentPlatform === "boolean" ? isSearchBarAvailableForCurrentPlatform : typeof isSearchBarAvailableForCurrentPlatform === "boolean"; const r101 = r98 && headerSearchBarOptions != null; if (headerSearchBarOptions != null && !r98) { throw new Error("The current version of 'react-native-screens' doesn't support SearchBar in the header. Please update to the latest version to use this option."); } const backButtonInCustomView = headerBackVisible ? r84 != null : r89 != null; const r108 = headerBackground != null || headerTransparent || (r101 || headerLargeTitle) && false; let backgroundColor = r44.backgroundColor; if (backgroundColor == null) { backgroundColor = headerBackground != null ? "transparent" : headerTransparent ? "transparent" : colors.card; } const backTitle = isNewBackTitleImplementation ? headerBackTitle : headerBackTitleVisible ? headerBackTitle : " "; const direction = I18nManager.getConstants().isRTL ? "rtl" : "ltr"; let hideShadow = headerShadowVisible === false || headerBackground != null; if (!hideShadow) { if (headerTransparent) { headerTransparent = headerShadowVisible !== true; } hideShadow = headerTransparent; } const disableBottomInsetApplication = UNSTABLE_headerInsets?.bottom !== void 0 ? !UNSTABLE_headerInsets.bottom : void 0; if (r84 == null) { r156 = null; if (typeof headerTitle === "function") { ScreenStackHeaderLeftView = _Module4536.ScreenStackHeaderLeftView; r156 = {r84} {headerTitleAlign !== "center" ? typeof headerTitle !== "function" ? {headerTitle2} : r89 : null} ; } } else { ScreenStackHeaderLeftView = _Module4536.ScreenStackHeaderLeftView; r156 = {r84} {headerTitleAlign !== "center" ? typeof headerTitle !== "function" ? {headerTitle2} : r89 : null} ; } const r175 = [r156, ,]; let r177 = null; if (headerTitleAlign === "center") { if (typeof headerTitle !== "function") { r89 = {headerTitle2}; } r177 = {r89}; } r175[1] = r177; return ; };