{"ast":null,"code":"import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nconst _excluded = [\"size\", \"source\", \"style\", \"onError\", \"onLayout\", \"onLoad\", \"onLoadEnd\", \"onLoadStart\", \"onProgress\", \"theme\", \"testID\"];\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 Image from \"react-native-web/dist/exports/Image\";\nimport StyleSheet from \"react-native-web/dist/exports/StyleSheet\";\nimport View from \"react-native-web/dist/exports/View\";\nimport { useInternalTheme } from \"../../core/theming\";\nconst defaultSize = 64;\nconst AvatarImage = _ref => {\n  let {\n      size = defaultSize,\n      source,\n      style,\n      onError,\n      onLayout,\n      onLoad,\n      onLoadEnd,\n      onLoadStart,\n      onProgress,\n      theme: themeOverrides,\n      testID\n    } = _ref,\n    rest = _objectWithoutPropertiesLoose(_ref, _excluded);\n  const {\n    colors\n  } = useInternalTheme(themeOverrides);\n  const {\n    backgroundColor = colors === null || colors === void 0 ? void 0 : colors.primary\n  } = StyleSheet.flatten(style) || {};\n  return React.createElement(View, _extends({\n    style: [{\n      width: size,\n      height: size,\n      borderRadius: size / 2,\n      backgroundColor\n    }, style]\n  }, rest), typeof source === 'function' && source({\n    size\n  }), typeof source !== 'function' && React.createElement(Image, {\n    testID: testID,\n    source: source,\n    style: {\n      width: size,\n      height: size,\n      borderRadius: size / 2\n    },\n    onError: onError,\n    onLayout: onLayout,\n    onLoad: onLoad,\n    onLoadEnd: onLoadEnd,\n    onLoadStart: onLoadStart,\n    onProgress: onProgress,\n    accessibilityIgnoresInvertColors: true\n  }));\n};\nAvatarImage.displayName = 'Avatar.Image';\nexport default AvatarImage;","map":{"version":3,"names":["React","Image","StyleSheet","View","useInternalTheme","defaultSize","AvatarImage","_ref","size","source","style","onError","onLayout","onLoad","onLoadEnd","onLoadStart","onProgress","theme","themeOverrides","testID","rest","_objectWithoutPropertiesLoose","_excluded","colors","backgroundColor","primary","flatten","createElement","_extends","width","height","borderRadius","accessibilityIgnoresInvertColors","displayName"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/react-native-paper/src/components/Avatar/AvatarImage.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n  Image,\n  ImageProps,\n  ImageSourcePropType,\n  StyleProp,\n  StyleSheet,\n  View,\n  ViewStyle,\n} from 'react-native';\n\nimport { useInternalTheme } from '../../core/theming';\nimport type { ThemeProp } from '../../types';\n\nconst defaultSize = 64;\n\nexport type AvatarImageSource =\n  | ImageSourcePropType\n  | ((props: { size: number }) => React.ReactNode);\n\nexport type Props = React.ComponentPropsWithRef<typeof View> & {\n  /**\n   * Image to display for the `Avatar`.\n   * It accepts a standard React Native Image `source` prop\n   * Or a function that returns an `Image`.\n   */\n  source: AvatarImageSource;\n  /**\n   * Size of the avatar.\n   */\n  size?: number;\n  style?: StyleProp<ViewStyle>;\n  /**\n   * Invoked on load error.\n   */\n  onError?: ImageProps['onError'];\n  /**\n   * Invoked on mount and on layout changes.\n   */\n  onLayout?: ImageProps['onLayout'];\n  /**\n   * Invoked when load completes successfully.\n   */\n  onLoad?: ImageProps['onLoad'];\n  /**\n   * Invoked when load either succeeds or fails.\n   */\n  onLoadEnd?: ImageProps['onLoadEnd'];\n  /**\n   * Invoked on load start.\n   */\n  onLoadStart?: ImageProps['onLoadStart'];\n  /**\n   * Invoked on download progress.\n   */\n  onProgress?: ImageProps['onProgress'];\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.Image size={24} source={require('../assets/avatar.png')} />\n * );\n * export default MyComponent\n * ```\n */\nconst AvatarImage = ({\n  size = defaultSize,\n  source,\n  style,\n  onError,\n  onLayout,\n  onLoad,\n  onLoadEnd,\n  onLoadStart,\n  onProgress,\n  theme: themeOverrides,\n  testID,\n  ...rest\n}: Props) => {\n  const { colors } = useInternalTheme(themeOverrides);\n  const { backgroundColor = colors?.primary } = StyleSheet.flatten(style) || {};\n\n  return (\n    <View\n      style={[\n        {\n          width: size,\n          height: size,\n          borderRadius: size / 2,\n          backgroundColor,\n        },\n        style,\n      ]}\n      {...rest}\n    >\n      {typeof source === 'function' && source({ size })}\n      {typeof source !== 'function' && (\n        <Image\n          testID={testID}\n          source={source}\n          style={{ width: size, height: size, borderRadius: size / 2 }}\n          onError={onError}\n          onLayout={onLayout}\n          onLoad={onLoad}\n          onLoadEnd={onLoadEnd}\n          onLoadStart={onLoadStart}\n          onProgress={onProgress}\n          accessibilityIgnoresInvertColors\n        />\n      )}\n    </View>\n  );\n};\n\nAvatarImage.displayName = 'Avatar.Image';\n\nexport default AvatarImage;\n"],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAAA,OAAAC,KAAA;AAAA,OAAAC,UAAA;AAAA,OAAAC,IAAA;AAW9B,SAASC,gBAAgB;AAGzB,MAAMC,WAAW,GAAG,EAAE;AA8DtB,MAAMC,WAAW,GAAGC,IAAA,IAaP;EAAA,IAbQ;MACnBC,IAAI,GAAGH,WAAW;MAClBI,MAAM;MACNC,KAAK;MACLC,OAAO;MACPC,QAAQ;MACRC,MAAM;MACNC,SAAS;MACTC,WAAW;MACXC,UAAU;MACVC,KAAK,EAAEC,cAAc;MACrBC;IAEK,CAAC,GAAAZ,IAAA;IADHa,IAAA,GAAAC,6BAAA,CAAAd,IAAA,EAAAe,SAAA;EAEH,MAAM;IAAEC;EAAO,CAAC,GAAGnB,gBAAgB,CAACc,cAAc,CAAC;EACnD,MAAM;IAAEM,eAAe,GAAGD,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEE;E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