const require_runtime = require("../../../../_virtual/_rolldown/runtime.js");
const require_model = require("../../info/model.js");
const require_index = require("./addService/index.js");
const require_openNormalService = require("./openNormalService.js");
const require_index$1 = require("./editService/index.js");
const require_Lists = require("../../info/service/Lists.js");
const require_index$2 = require("./addTimeModal/index.js");
const require_useInfoHolder = require("../../info/hooks/useInfoHolder.js");
const require_useQuotation = require("../../hooks/useQuotation.js");
const require_useClearCart = require("../../hooks/useClearCart.js");
const require_index$3 = require("./editNormalService/index.js");
let react = require("react");
react = require_runtime.__toESM(react);
require("../../info/service/index.less");
//#region src/components/booking/info2/service/index.tsx
const Service = () => {
	const { state, dispatch } = (0, react.useContext)(require_model.Context);
	const { detailRef, handleEdit, handleAction, dispatchService, showAddTimeModal, editNormalServiceRef } = require_useInfoHolder.default(state, dispatch);
	(0, react.useEffect)(() => {
		document.body.id = "body";
	}, []);
	(0, react.useEffect)(() => {
		require_openNormalService.setOpenNormalServiceHandler((payload) => {
			var _editNormalServiceRef;
			(_editNormalServiceRef = editNormalServiceRef.current) === null || _editNormalServiceRef === void 0 || _editNormalServiceRef.init(payload);
		});
		return () => {
			require_openNormalService.setOpenNormalServiceHandler(void 0);
		};
	}, [editNormalServiceRef]);
	const clearCart = require_useClearCart.default(state, dispatch);
	const { dom } = require_useQuotation.default(state, dispatch);
	const renderMemo = (0, react.useMemo)(() => {
		console.log("render info22222");
		return /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, /* @__PURE__ */ react.default.createElement("div", { className: "pisell-lowcode__booking-service-wrap" }, (state === null || state === void 0 ? void 0 : state.isBookingTicket2) ? null : clearCart, /* @__PURE__ */ react.default.createElement(require_Lists.default, {
			isParallelResource: true,
			onEdit: handleEdit,
			onAction: handleAction,
			onChange: (e, type) => dispatchService(type || "setService", e)
		}), !state.isBookingCreatePage ? /* @__PURE__ */ react.default.createElement(require_index.default, { onEdit: handleEdit }) : null), /* @__PURE__ */ react.default.createElement(require_index$1.default, { ref: detailRef }), showAddTimeModal && /* @__PURE__ */ react.default.createElement(require_index$2.default, null), /* @__PURE__ */ react.default.createElement(require_index$3.default, { ref: editNormalServiceRef }), dom);
	}, [
		dom,
		showAddTimeModal,
		clearCart,
		state === null || state === void 0 ? void 0 : state.isBookingTicket2
	]);
	return /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, renderMemo);
};
var service_default = react.default.memo(Service);
//#endregion
exports.default = service_default;
