var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/components/pisellCardList/index.tsx
var pisellCardList_exports = {};
__export(pisellCardList_exports, {
  default: () => pisellCardList_default
});
module.exports = __toCommonJS(pisellCardList_exports);
var import_react = __toESM(require("react"));
var import_react_infinite_scroll_component = __toESM(require("react-infinite-scroll-component"));
var import_antd = require("antd");
var import_pisellCheckboxGroup = __toESM(require("../pisellCheckboxGroup"));
var import_pisellWalletPassCard = __toESM(require("../pisellWalletPassCard"));
var import_pisellEmpty = __toESM(require("../pisellEmpty"));
var PisellCardList = (props) => {
  const {
    data,
    loadMoreData = () => {
    },
    endMessage,
    loader,
    hasMore,
    onChange,
    value,
    mode,
    showName,
    showCode,
    showCover,
    showDetail,
    showBalance,
    showRedeem,
    showQrCode,
    showStoreName,
    showValidDate,
    empty,
    showEmpty,
    showBalanceSymbol
  } = props;
  return /* @__PURE__ */ import_react.default.createElement(
    import_react_infinite_scroll_component.default,
    {
      dataLength: data.length,
      next: loadMoreData,
      hasMore,
      loader: loader || /* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton, { paragraph: { rows: 3 }, active: true }),
      endMessage,
      scrollableTarget: "scrollableDiv"
    },
    data.length ? /* @__PURE__ */ import_react.default.createElement(
      import_pisellCheckboxGroup.default,
      {
        options: data,
        value,
        mode,
        rowKey: "id",
        gap: 12,
        onChange,
        iconPosition: "hide",
        renderOption: (item, active) => {
          return /* @__PURE__ */ import_react.default.createElement(
            import_pisellWalletPassCard.default,
            {
              ...item,
              active,
              showName: showName || (item == null ? void 0 : item.showName),
              showBalance: showBalance || (item == null ? void 0 : item.showBalance),
              showCode: showCode || (item == null ? void 0 : item.showCode),
              showCover: showCover || (item == null ? void 0 : item.showCover),
              showDetail: showDetail || (item == null ? void 0 : item.showDetail),
              showQrCode: showQrCode || (item == null ? void 0 : item.showQrCode),
              showRedeem: showRedeem || (item == null ? void 0 : item.showRedeem),
              showStoreName: showStoreName || (item == null ? void 0 : item.showStoreName),
              showValidDate: showValidDate || (item == null ? void 0 : item.showValidDate),
              showBalanceSymbol: showBalanceSymbol || (item == null ? void 0 : item.showBalanceSymbol)
            }
          );
        }
      }
    ) : showEmpty && (empty || /* @__PURE__ */ import_react.default.createElement(import_pisellEmpty.default, null))
  );
};
var pisellCardList_default = (0, import_react.memo)(PisellCardList);
