require("../../../../_virtual/_rolldown/runtime.js");
const require_bookingTicket = require("./bookingTicket.js");
const require_useActiveExecute = require("./useActiveExecute.js");
let ahooks = require("ahooks");
//#region src/components/ticketBooking/hooks/pisellos/useCartChangeEffect.ts
const useCartChangeEffect = () => {
	const bookingTicket = require_bookingTicket.useBookingTicket();
	const { executeIfActive } = require_useActiveExecute.useActiveExecute();
	const onCartChange = (0, ahooks.useMemoizedFn)((type, list) => {
		var _bookingTicket$effect;
		bookingTicket === null || bookingTicket === void 0 || (_bookingTicket$effect = bookingTicket.effectsEmit) === null || _bookingTicket$effect === void 0 || _bookingTicket$effect.call(bookingTicket, "onCartChange", {
			type,
			list
		});
	});
	const effectOn = (fn) => {
		var _bookingTicket$effect2;
		return bookingTicket === null || bookingTicket === void 0 || (_bookingTicket$effect2 = bookingTicket.effectsOn) === null || _bookingTicket$effect2 === void 0 ? void 0 : _bookingTicket$effect2.call(bookingTicket, "onCartChange", executeIfActive(fn));
	};
	return {
		onCartChange,
		effectOn
	};
};
//#endregion
exports.default = useCartChangeEffect;
