var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/pro/Selector/hooks/usePresetItemProps.ts
var usePresetItemProps_exports = {};
__export(usePresetItemProps_exports, {
  default: () => usePresetItemProps_default
});
module.exports = __toCommonJS(usePresetItemProps_exports);
var import_react = require("react");
var import_lodash = require("lodash");
var usePresetItemProps = (params) => {
  const {
    variant,
    itemLayout,
    preset,
    itemProps = {},
    indicator: originIndicator,
    numberSelector,
    mode,
    disabled,
    selected
  } = params;
  return (0, import_react.useMemo)(() => {
    let mediaProps = {};
    let cardProps = {};
    let indicator = originIndicator;
    const presetVariant = preset == null ? void 0 : preset.variant;
    if (variant === "media") {
      let presetProps = {};
      if (presetVariant === "1") {
        presetProps = {
          size: "small",
          showIndicator: false,
          shape: mode === "single" ? "circle" : "square",
          coverType: "text"
        };
      } else if (presetVariant === "2") {
        presetProps = {
          size: "large",
          showIndicator: true,
          shape: "circle"
        };
      }
      mediaProps = {
        ...presetProps,
        ...itemProps
      };
      return { mediaProps, cardProps };
    }
    if (variant === "default") {
      cardProps = {
        variant: "borderless",
        layout: "horizontal",
        selectedType: "none",
        actionsPosition: "left",
        actions: numberSelector ? [numberSelector] : [indicator],
        renderContent: presetVariant === "1" || presetVariant === "2" ? ({ dataSource }) => dataSource == null ? void 0 : dataSource._label : void 0,
        ...itemProps
      };
      return { mediaProps, cardProps };
    }
    if (variant === "card") {
      const layout = (itemProps == null ? void 0 : itemProps.layout) || itemLayout || "horizontal";
      const isVertical = layout === "vertical";
      let baseProps = {};
      if (isVertical) {
        const defaultStyles = {
          content: { minHeight: "264px" }
        };
        baseProps = {
          layout: "vertical",
          variant: "borderless"
        };
        if (presetVariant === "2") {
          const mergedStyles = (0, import_lodash.merge)({}, defaultStyles, itemProps == null ? void 0 : itemProps.styles);
          cardProps = {
            ...baseProps,
            corner: indicator,
            actions: numberSelector ? [numberSelector] : [],
            ...itemProps,
            styles: mergedStyles
          };
        } else {
          const mergedStyles = (0, import_lodash.merge)({}, defaultStyles, itemProps == null ? void 0 : itemProps.styles);
          cardProps = {
            ...baseProps,
            actions: numberSelector ? [numberSelector] : [indicator],
            ...itemProps,
            styles: mergedStyles
          };
        }
      } else {
        const defaultStyles = {
          container: { padding: 8 },
          content: {}
        };
        if (presetVariant === "1") {
          defaultStyles.container.padding = "12px 16px";
          defaultStyles.content.textAlign = "center";
          baseProps = {
            selectedType: "outlined-bold"
          };
          if (selected) {
            defaultStyles.content.fontWeight = "600";
          }
          indicator = null;
        } else if (presetVariant === "2") {
          defaultStyles.container.padding = "12px 16px";
          baseProps = {
            selectedType: "filled"
          };
          indicator = selected ? indicator : null;
        } else if (presetVariant === "5") {
          baseProps = {
            variant: "borderless",
            selectedType: "none"
          };
        }
        const mergedStyles = (0, import_lodash.merge)({}, defaultStyles, itemProps == null ? void 0 : itemProps.styles);
        cardProps = {
          ...baseProps,
          actions: numberSelector ? [numberSelector] : [indicator],
          ...itemProps,
          styles: mergedStyles
        };
      }
      return { mediaProps, cardProps };
    }
    return { mediaProps, cardProps };
  }, [
    variant,
    itemLayout,
    preset,
    itemProps,
    originIndicator,
    numberSelector,
    mode,
    disabled,
    selected
  ]);
};
var usePresetItemProps_default = usePresetItemProps;
