"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _legacy = require("@hyperledger/aries-oca/build/legacy");
var _theme = require("../contexts/theme");
var _reactNative = require("react-native");
var _helpers = require("../utils/helpers");
var _credential = require("../utils/credential");
const useCredentialCardStyles = (overlay, brandingOverlayType, proof) => {
  var _overlay$brandingOver, _overlay$brandingOver2, _overlay$brandingOver3;
  const {
    ColorPallet,
    TextTheme,
    ListItems,
    CredentialCardShadowTheme
  } = (0, _theme.useTheme)();
  const {
    width
  } = (0, _reactNative.useWindowDimensions)();
  const padding = width * 0.05;
  const logoHeight = width * 0.12;
  const borderRadius = 10;
  const styles = _reactNative.StyleSheet.create({
    container: {
      backgroundColor: (_overlay$brandingOver = overlay.brandingOverlay) === null || _overlay$brandingOver === void 0 ? void 0 : _overlay$brandingOver.primaryBackgroundColor,
      borderRadius: borderRadius,
      ...CredentialCardShadowTheme
    },
    cardContainer: {
      flexDirection: 'row',
      minHeight: 0.33 * width
    },
    secondaryBodyContainer: {
      width: logoHeight,
      borderTopLeftRadius: borderRadius,
      borderBottomLeftRadius: borderRadius,
      backgroundColor: (0, _helpers.getSecondaryBackgroundColor)(overlay, proof) ?? ((_overlay$brandingOver2 = overlay.brandingOverlay) === null || _overlay$brandingOver2 === void 0 ? void 0 : _overlay$brandingOver2.primaryBackgroundColor)
    },
    primaryBodyContainer: {
      flex: 1,
      padding,
      ...(brandingOverlayType === _legacy.BrandingOverlayType.Branding11 && {
        justifyContent: 'space-between'
      }),
      ...(brandingOverlayType === _legacy.BrandingOverlayType.Branding10 && {
        marginLeft: -1 * logoHeight + padding
      })
    },
    primaryBodyNameContainer: {
      flexDirection: 'row'
    },
    imageAttr: {
      height: 150,
      aspectRatio: 1,
      resizeMode: 'contain',
      borderRadius: borderRadius
    },
    statusContainer: {
      backgroundColor: 'rgba(0, 0, 0, 0)',
      borderTopRightRadius: borderRadius,
      borderBottomLeftRadius: borderRadius,
      height: logoHeight,
      width: logoHeight,
      justifyContent: 'center',
      alignItems: 'center'
    },
    logoContainer: {
      width: logoHeight,
      height: logoHeight,
      backgroundColor: '#ffffff',
      borderRadius: 8,
      justifyContent: 'center',
      alignItems: 'center',
      ...(brandingOverlayType === _legacy.BrandingOverlayType.Branding10 && {
        top: padding,
        left: -1 * logoHeight + padding,
        ...CredentialCardShadowTheme
      })
    },
    headerText: {
      ...TextTheme.labelSubtitle,
      ...ListItems.recordAttributeText,
      fontSize: 15,
      flexShrink: 1
    },
    valueText: {
      ...TextTheme.normal,
      minHeight: ListItems.recordAttributeText.fontSize,
      paddingVertical: 4
    },
    textContainer: {
      color: proof && brandingOverlayType === _legacy.BrandingOverlayType.Branding10 ? TextTheme.normal.color : (0, _credential.credentialTextColor)(ColorPallet, (_overlay$brandingOver3 = overlay.brandingOverlay) === null || _overlay$brandingOver3 === void 0 ? void 0 : _overlay$brandingOver3.primaryBackgroundColor),
      flexShrink: 1,
      ...(brandingOverlayType === _legacy.BrandingOverlayType.Branding11 && {
        fontSize: 16
      }),
      lineHeight: 24
    },
    credentialName: {
      flex: 1,
      flexWrap: 'wrap',
      ...(brandingOverlayType === _legacy.BrandingOverlayType.Branding11 && {
        lineHeight: 16,
        maxWidth: '85%',
        fontSize: 14,
        fontWeight: '600'
      })
    },
    credentialIssuerContainer: {
      flex: 1,
      alignSelf: 'flex-end',
      justifyContent: 'flex-end',
      maxWidth: '80%'
    },
    errorText: {
      ...TextTheme.normal,
      color: ListItems.proofError.color
    },
    errorIcon: {
      color: ListItems.proofError.color
    },
    selectedCred: {
      borderWidth: 5,
      borderRadius: 15,
      borderColor: ColorPallet.semantic.focus
    },
    credActionText: {
      fontSize: 20,
      fontWeight: TextTheme.bold.fontWeight,
      color: ColorPallet.brand.link
    },
    cardAttributeContainer: {
      marginVertical: 16,
      gap: 4
    }
  });
  return {
    styles,
    borderRadius,
    logoHeight
  };
};
var _default = exports.default = useCredentialCardStyles;
//# sourceMappingURL=credential-card-styles.js.map