// Metro module 5586 (f5587). import _objectWithoutProperties from "./_objectWithoutProperties"; import { useContext } from "react"; import { Animated, StyleSheet, View, Platform } from "react-native"; import { useSafeAreaInsets, useSafeAreaFrame } from "./Module1584"; import Module5587 from "./Module5587"; import getDefaultHeaderHeight from "./getDefaultHeaderHeight_5584"; import HeaderTitle from "./HeaderTitle_5589"; import HeaderBackground from "./HeaderBackground_5590"; const _excluded = ["height", "minHeight", "maxHeight", "backgroundColor", "borderBottomColor", "borderBottomEndRadius", "borderBottomLeftRadius", "borderBottomRightRadius", "borderBottomStartRadius", "borderBottomWidth", "borderColor", "borderEndColor", "borderEndWidth", "borderLeftColor", "borderLeftWidth", "borderRadius", "borderRightColor", "borderRightWidth", "borderStartColor", "borderStartWidth", "borderStyle", "borderTopColor", "borderTopEndRadius", "borderTopLeftRadius", "borderTopRightRadius", "borderTopStartRadius", "borderTopWidth", "borderWidth", "boxShadow", "elevation", "shadowColor", "shadowOffset", "shadowOpacity", "shadowRadius", "opacity", "transform"]; Platform; const styles = StyleSheet.create({ content: { flex: 1, flexDirection: "row", alignItems: "stretch" }, title: { marginHorizontal: 16, justifyContent: "center" }, left: { justifyContent: "center", alignItems: "flex-start" }, right: { justifyContent: "center", alignItems: "flex-end" }, expand: { flexGrow: 1, flexBasis: 0 } }); export default function Header(props) { let maxWidth; const safeAreaInsets = useSafeAreaInsets(); const safeAreaFrame = useSafeAreaFrame(); const context = useContext(Module5587); const top = safeAreaInsets.top; const { layout = safeAreaFrame, modal = false, title } = props; let headerTitle = props.headerTitle; const { headerTitleAlign = "left", headerLeft, headerLeftLabelVisible, headerTransparent, headerTintColor, headerBackground, headerRight, headerTitleAllowFontScaling, headerTitleStyle, headerLeftContainerStyle, headerRightContainerStyle, headerTitleContainerStyle, headerBackgroundContainerStyle } = props; let headerStyle = props.headerStyle; const { headerShadowVisible, headerPressColor, headerPressOpacity, headerStatusBarHeight = context ? 0 : top } = props; const defaultHeaderHeight = getDefaultHeaderHeight(layout, modal, headerStatusBarHeight); const height2 = headerStatusBarHeight; if (!headerStyle) { headerStyle = {}; } const r67 = StyleSheet.flatten(headerStyle); const { height = defaultHeaderHeight, minHeight, maxHeight, backgroundColor, borderBottomColor, borderBottomEndRadius, borderBottomLeftRadius, borderBottomRightRadius, borderBottomStartRadius, borderBottomWidth, borderColor, borderEndColor, borderEndWidth, borderLeftColor, borderLeftWidth, borderRadius, borderRightColor, borderRightWidth, borderStartColor, borderStartWidth, borderStyle, borderTopColor, borderTopEndRadius, borderTopLeftRadius, borderTopRightRadius, borderTopStartRadius, borderTopWidth, borderWidth, boxShadow, elevation, shadowColor, shadowOffset, shadowOpacity, shadowRadius, opacity, transform } = r67; _objectWithoutProperties(r67, _excluded); const r97 = { backgroundColor, borderBottomColor, borderBottomEndRadius, borderBottomLeftRadius, borderBottomRightRadius, borderBottomStartRadius, borderBottomWidth, borderColor, borderEndColor, borderEndWidth, borderLeftColor, borderLeftWidth, borderRadius, borderRightColor, borderRightWidth, borderStartColor, borderStartWidth, borderStyle, borderTopColor, borderTopEndRadius, borderTopLeftRadius, borderTopRightRadius, borderTopStartRadius, borderTopWidth, borderWidth, boxShadow, elevation, shadowColor, shadowOffset, shadowOpacity, shadowRadius, opacity, transform }; for (const key in r97) { if (r97[key] === void 0) { delete r97[key]; } } const style = [r97, headerShadowVisible === false && { elevation: 0, shadowOpacity: 0, borderBottomWidth: 0 }]; const children = headerLeft ? headerLeft({ tintColor: headerTintColor, pressColor: headerPressColor, pressOpacity: headerPressOpacity, labelVisible: headerLeftLabelVisible }) : null; const r108 = headerRight ? headerRight({ tintColor: headerTintColor, pressColor: headerPressColor, pressOpacity: headerPressOpacity }) : null; if (typeof headerTitle !== "function") { headerTitle = (a0) => ; } const r129 = [ {headerBackground ? headerBackground({ style }) : headerTransparent ? null : } , ,]; const View2 = Animated.View; const children2 = [, ,]; const View3 = Animated.View; const style2 = [styles.left, , , ,]; const r6 = headerTitleAlign === "center"; style2[1] = r6 && styles.expand; style2[2] = { marginStart: safeAreaInsets.left }; style2[3] = headerLeftContainerStyle; const r151 = [{children}, , ,]; const View4 = Animated.View; const style3 = [styles.title, , ,]; const width = layout.width; let r156 = 16; if (r6) { if (children) { r156 = headerLeftLabelVisible !== false ? 80 : 32; } maxWidth = width - 2 * (r156 + Math.max(safeAreaInsets.left, safeAreaInsets.right)); } else { maxWidth = width - ((children ? 72 : 16) + (r108 ? 72 : 16) + safeAreaInsets.left - safeAreaInsets.right); } style3[1] = { maxWidth }; style3[2] = headerTitleContainerStyle; r151[1] = {headerTitle({ children: title, allowFontScaling: headerTitleAllowFontScaling, tintColor: headerTintColor, style: headerTitleStyle })} ; r151[2] = {r108}; children2[1] = {r151}; r129[1] = {children2}; return <>{r129}; };