'use client';


const require_rolldown_runtime = require('../../../../../../../_virtual/rolldown_runtime.cjs');
const require_messagesKeys = require('./editor/dist/esm/messagesKeys.cjs');
const require_useCrossFrameMessageListener = require('./useCrossFrameMessageListener.cjs');
let react = require("react");

//#region ../react-intlayer/dist/esm/@intlayer/editor-react/dist/esm/useIframeClickInterceptor.mjs
const useIframeClickInterceptor = () => {
	const postMessage = require_useCrossFrameMessageListener.useCrossFrameMessageListener(require_messagesKeys.MessageKey.INTLAYER_IFRAME_CLICKED);
	const handlePostMessageEvent = () => {
		postMessage();
	};
	(0, react.useEffect)(() => {
		window.addEventListener("mousedown", handlePostMessageEvent);
		return () => window.removeEventListener("mousedown", handlePostMessageEvent);
	}, [postMessage]);
};

//#endregion
exports.useIframeClickInterceptor = useIframeClickInterceptor;
//# sourceMappingURL=useIframeClickInterceptor.cjs.map