const require_runtime = require("../../../../_virtual/_rolldown/runtime.js");
const require_objectSpread2 = require("../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
const require_utils = require("../utils.js");
const require_useEngineContext = require("../../../../hooks/useEngineContext.js");
const require_index = require("../../info2/service/addService/index.js");
const require_index$1 = require("../service/addService/index.js");
let react = require("react");
react = require_runtime.__toESM(react);
//#region src/components/booking/info/addServiceVariant/index.tsx
const AddServiceVariant = (props) => {
	var _context$appHelper, _context$appHelper$ge, _context$appHelper$ut, _context$appHelper$ut2, _props$globalState, _context$appHelper$ut3;
	const { globalState, setGlobalState } = props;
	const context = require_useEngineContext.default();
	const stateRef = (0, react.useRef)(globalState);
	stateRef.current = globalState;
	const dispatch = ({ type, payload }) => {
		if (type === "setService") setGlobalState({ service: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, stateRef.current.service), payload) });
		if (type === "setDate") setGlobalState({ date: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, stateRef.current.date), payload) });
	};
	let Cpt = require_index$1.default;
	if (require_utils.isBooking4Shop(((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.utils) === null || _context$appHelper === void 0 || (_context$appHelper$ge = _context$appHelper.getData) === null || _context$appHelper$ge === void 0 ? void 0 : _context$appHelper$ge.call(_context$appHelper, "shop_id")) || ((_context$appHelper$ut = context.appHelper.utils.store) === null || _context$appHelper$ut === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut.getState) === null || _context$appHelper$ut2 === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut2.call(_context$appHelper$ut)) === null || _context$appHelper$ut2 === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut2.global) === null || _context$appHelper$ut2 === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut2.globalConfig) === null || _context$appHelper$ut2 === void 0 ? void 0 : _context$appHelper$ut2.id), props === null || props === void 0 || (_props$globalState = props.globalState) === null || _props$globalState === void 0 ? void 0 : _props$globalState.renderType, (_context$appHelper$ut3 = context.appHelper.utils) === null || _context$appHelper$ut3 === void 0 ? void 0 : _context$appHelper$ut3.businessUtils)) Cpt = require_index.default;
	return /* @__PURE__ */ react.default.createElement(Cpt, {
		renderMode: "current",
		dispatch,
		state: globalState,
		drawerProps: {
			open: true,
			getContainer: false
		}
	});
};
//#endregion
exports.default = AddServiceVariant;
