{"ast":null,"code":"import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nconst _excluded = [\"label\", \"size\", \"style\", \"labelStyle\", \"color\", \"theme\", \"maxFontSizeMultiplier\"],\n  _excluded2 = [\"backgroundColor\"];\nfunction _extends() {\n  return _extends = Object.assign ? Object.assign.bind() : function (n) {\n    for (var e = 1; e < arguments.length; e++) {\n      var t = arguments[e];\n      for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n    }\n    return n;\n  }, _extends.apply(null, arguments);\n}\nimport * as React from 'react';\nimport StyleSheet from \"react-native-web/dist/exports/StyleSheet\";\nimport useWindowDimensions from \"react-native-web/dist/exports/useWindowDimensions\";\nimport View from \"react-native-web/dist/exports/View\";\nimport { useInternalTheme } from \"../../core/theming\";\nimport { white } from \"../../styles/themes/v2/colors\";\nimport getContrastingColor from \"../../utils/getContrastingColor\";\nimport Text from \"../Typography/Text\";\nconst defaultSize = 64;\nconst AvatarText = _ref => {\n  let {\n      label,\n      size = defaultSize,\n      style,\n      labelStyle,\n      color: customColor,\n      theme: themeOverrides,\n      maxFontSizeMultiplier\n    } = _ref,\n    rest = _objectWithoutPropertiesLoose(_ref, _excluded);\n  var _theme$colors;\n  const theme = useInternalTheme(themeOverrides);\n  const _ref2 = StyleSheet.flatten(style) || {},\n    {\n      backgroundColor = (_theme$colors = theme.colors) === null || _theme$colors === void 0 ? void 0 : _theme$colors.primary\n    } = _ref2,\n    restStyle = _objectWithoutPropertiesLoose(_ref2, _excluded2);\n  const textColor = customColor ?? getContrastingColor(backgroundColor, white, 'rgba(0, 0, 0, .54)');\n  const {\n    fontScale\n  } = useWindowDimensions();\n  return React.createElement(View, _extends({\n    style: [{\n      width: size,\n      height: size,\n      borderRadius: size / 2,\n      backgroundColor\n    }, styles.container, restStyle]\n  }, rest), React.createElement(Text, {\n    style: [styles.text, {\n      color: textColor,\n      fontSize: size / 2,\n      lineHeight: size / fontScale\n    }, labelStyle],\n    numberOfLines: 1,\n    maxFontSizeMultiplier: maxFontSizeMultiplier\n  }, label));\n};\nAvatarText.displayName = 'Avatar.Text';\nconst styles = StyleSheet.create({\n  container: {\n    justifyContent: 'center',\n    alignItems: 'center'\n  },\n  text: {\n    textAlign: 'center',\n    textAlignVertical: 'center'\n  }\n});\nexport default AvatarText;","map":{"version":3,"names":["React","StyleSheet","useWindowDimensions","View","useInternalTheme","white","getContrastingColor","Text","defaultSize","AvatarText","_ref","label","size","style","labelStyle","color","customColor","theme","themeOverrides","maxFontSizeMultiplier","rest","_objectWithoutPropertiesLoose","_excluded","_theme$colors","_ref2","flatten","backgroundColor","colors","primary","restStyle","_excluded2","textColor","fontScale","createElement","_extends","width","height","borderRadius","styles","container","text","fontSize","lineHeight","numberOfLines","displayName","create","justifyContent","alignItems","textAlign","textAlignVertical"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/react-native-paper/src/components/Avatar/AvatarText.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n  StyleProp,\n  StyleSheet,\n  TextStyle,\n  useWindowDimensions,\n  View,\n  ViewStyle,\n} from 'react-native';\n\nimport { useInternalTheme } from '../../core/theming';\nimport { white } from '../../styles/themes/v2/colors';\nimport type { ThemeProp } from '../../types';\nimport getContrastingColor from '../../utils/getContrastingColor';\nimport Text from '../Typography/Text';\n\nconst defaultSize = 64;\n\nexport type Props = React.ComponentPropsWithRef<typeof View> & {\n  /**\n   * Initials to show as the text in the `Avatar`.\n   */\n  label: string;\n  /**\n   * Size of the avatar.\n   */\n  size?: number;\n  /**\n   * Custom color for the text.\n   */\n  color?: string;\n  /**\n   * Style for text container\n   */\n  style?: StyleProp<ViewStyle>;\n  /**\n   * Style for the title.\n   */\n  labelStyle?: StyleProp<TextStyle>;\n  /**\n   * Specifies the largest possible scale a text font can reach.\n   */\n  maxFontSizeMultiplier?: number;\n  /**\n   * @optional\n   */\n  theme?: ThemeProp;\n};\n\n/**\n * Avatars can be used to represent people in a graphical way.\n *\n * ## Usage\n * ```js\n * import * as React from 'react';\n * import { Avatar } from 'react-native-paper';\n *\n * const MyComponent = () => (\n *   <Avatar.Text size={24} label=\"XD\" />\n * );\n * ```\n */\nconst AvatarText = ({\n  label,\n  size = defaultSize,\n  style,\n  labelStyle,\n  color: customColor,\n  theme: themeOverrides,\n  maxFontSizeMultiplier,\n  ...rest\n}: Props) => {\n  const theme = useInternalTheme(themeOverrides);\n  const { backgroundColor = theme.colors?.primary, ...restStyle } =\n    StyleSheet.flatten(style) || {};\n  const textColor =\n    customColor ??\n    getContrastingColor(backgroundColor, white, 'rgba(0, 0, 0, .54)');\n  const { fontScale } = useWindowDimensions();\n\n  return (\n    <View\n      style={[\n        {\n          width: size,\n          height: size,\n          borderRadius: size / 2,\n          backgroundColor,\n        },\n        styles.container,\n        restStyle,\n      ]}\n      {...rest}\n    >\n      <Text\n        style={[\n          styles.text,\n          {\n            color: textColor,\n            fontSize: size / 2,\n            lineHeight: size / fontScale,\n          },\n          labelStyle,\n        ]}\n        numberOfLines={1}\n        maxFontSizeMultiplier={maxFontSizeMultiplier}\n      >\n        {label}\n      </Text>\n    </View>\n  );\n};\n\nAvatarText.displayName = 'Avatar.Text';\n\nconst styles = StyleSheet.create({\n  container: {\n    justifyContent: 'center',\n    alignItems: 'center',\n  },\n  text: {\n    textAlign: 'center',\n    textAlignVertical: 'center',\n  },\n});\n\nexport default AvatarText;\n"],"mappings":";;;;;;;;;;;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAAA,OAAAC,UAAA;AAAA,OAAAC,mBAAA;AAAA,OAAAC,IAAA;AAU9B,SAASC,gBAAgB;AACzB,SAASC,KAAK;AAEd,OAAOC,mBAAmB;AAC1B,OAAOC,IAAI;AAEX,MAAMC,WAAW,GAAG,EAAE;AA8CtB,MAAMC,UAAU,GAAGC,IAAA,IASN;EAAA,IATO;MAClBC,KAAK;MACLC,IAAI,GAAGJ,WAAW;MAClBK,KAAK;MACLC,UAAU;MACVC,KAAK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