const require_runtime = require("../../../../../../_virtual/_rolldown/runtime.js");
const require_mock = require("../../../../mock.js");
const require_index = require("../../../OpenCard/index.js");
const require_index$1 = require("../CalendarDate/Status/index.js");
const require_index$2 = require("../CalendarDate/CalenDateWeek/index.js");
const require_index$3 = require("../CalendarDate/index.js");
let dayjs = require("dayjs");
dayjs = require_runtime.__toESM(dayjs);
let react = require("react");
react = require_runtime.__toESM(react);
let _pisell_materials = require("@pisell/materials");
let classnames = require("classnames");
classnames = require_runtime.__toESM(classnames);
require("./index.less");
//#region src/components/eventBooking/components/bookingAvailabilityCalendar/components/SelectDate/index.tsx
const SelectDate = ({ currentDate, detail, currentDateChange, setSurplusDisabledChange, cutTime, setCutTime, showCalendarPopup }, ref) => {
	const [dateLimitData, setDateLimitData] = (0, react.useState)(require_mock.mock.availability_calendar.limitData);
	const calendarDateRef = (0, react.useRef)(null);
	(0, react.useImperativeHandle)(ref, () => {
		return {};
	});
	/**
	* @title: 头部额外内容
	* @description:
	* @return {*}
	* @Author: WangHan
	* @Date: 2025-01-14 14:52
	*/
	const extraHeader = () => {
		return /* @__PURE__ */ react.default.createElement("div", { onClick: (e) => {
			var _calendarDateRef$curr;
			e.stopPropagation();
			calendarDateRef === null || calendarDateRef === void 0 || (_calendarDateRef$curr = calendarDateRef.current) === null || _calendarDateRef$curr === void 0 || _calendarDateRef$curr.open(currentDate, detail === null || detail === void 0 ? void 0 : detail.id);
		} }, /* @__PURE__ */ react.default.createElement(_pisell_materials.Iconfont, {
			type: "pisell2-calendar",
			className: (0, classnames.default)("calendar-icon")
		}));
	};
	return /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, /* @__PURE__ */ react.default.createElement(require_index.default, {
		title: "Select a date",
		initOpen: true,
		showArrow: false,
		isClick: false,
		extra: showCalendarPopup ? extraHeader() : null
	}, /* @__PURE__ */ react.default.createElement(require_index$2.default, {
		currentDate,
		productId: detail === null || detail === void 0 ? void 0 : detail.id,
		cutTime,
		dateLimitData
	}), /* @__PURE__ */ react.default.createElement(require_index$1.default, null)), /* @__PURE__ */ react.default.createElement(require_index$3.default, {
		ref: calendarDateRef,
		cutTime,
		dateLimitData
	}));
};
var SelectDate_default = (0, react.forwardRef)(SelectDate);
//#endregion
exports.default = SelectDate_default;
