const require_runtime = require("../../../../../../_virtual/_rolldown/runtime.js");
const require_objectSpread2 = require("../../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
const require_useToast = require("../../../../../../hooks/useToast.js");
const require_DiscountTextMode = require("./DiscountTextMode.js");
let react = require("react");
react = require_runtime.__toESM(react);
let _pisell_utils = require("@pisell/utils");
let _pisell_materials = require("@pisell/materials");
require("./index.less");
//#region src/components/checkout/components/WalletPassModule/components/DiscountWallet/index.tsx
const DiscountWallet = (props) => {
	const { isCardMode, cardData, selectedWalletIds, onSelectWallet, onDetail, discountDisabled } = props;
	const Toast = require_useToast.default();
	const formatData = (0, react.useMemo)(() => {
		if (!discountDisabled) return cardData;
		return cardData.map((item) => require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, item), {}, { disabled: true }));
	}, [discountDisabled, cardData]);
	const handleClick = () => {
		if (discountDisabled) Toast.info(_pisell_utils.locales.getText("wallet-pass-module-discount-partially-paid"));
	};
	return /* @__PURE__ */ react.default.createElement("div", { className: "discount-wallet-list-container" }, isCardMode ? /* @__PURE__ */ react.default.createElement(_pisell_materials.PisellCardList, {
		className: "",
		showName: true,
		showActiveBackground: true,
		showStoreName: (data) => {
			var _data$originData;
			if ((data === null || data === void 0 || (_data$originData = data.originData) === null || _data$originData === void 0 ? void 0 : _data$originData.tag) === "good_pass") return data.active;
			return true;
		},
		onItemClick: handleClick,
		disabled: discountDisabled,
		showRedeem: false,
		showBalance: false,
		showCode: false,
		showValidDate: false,
		showDetail: false,
		showQrCode: false,
		showCover: false,
		showActions: false,
		platform: "pc",
		mode: "multiple",
		direction: "horizontal",
		type: "mini",
		data: formatData,
		hasMore: false,
		showEmpty: false,
		fullWidth: false,
		value: selectedWalletIds,
		useExternalDetail: true,
		onDetail,
		showStatus: false,
		nameTitleStyle: {
			fontSize: 20,
			fontWeight: 600,
			color: "#FF8A1E"
		},
		onChange: onSelectWallet,
		actions: {
			layout: "expanded",
			detail: {
				visible: false,
				iconColor: "#1570EF"
			},
			edit: {
				visible: false,
				iconColor: "#1570EF"
			}
		},
		enableEditAmount: false
	}) : /* @__PURE__ */ react.default.createElement(require_DiscountTextMode.default, {
		cardData,
		selectedWalletIds
	}));
};
//#endregion
exports.default = DiscountWallet;
