'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');
const require_useCrossFrameState = require('./useCrossFrameState.cjs');
let react = require("react");
let react_jsx_runtime = require("react/jsx-runtime");

//#region ../react-intlayer/dist/esm/@intlayer/editor-react/dist/esm/EditorEnabledContext.mjs
const EditorEnabledContext = (0, react.createContext)({ enabled: false });
const useEditorEnabledState = (options) => require_useCrossFrameState.useCrossFrameState(require_messagesKeys.MessageKey.INTLAYER_EDITOR_ENABLED, false, options);
const useGetEditorEnabledState = (onEventTriggered) => require_useCrossFrameMessageListener.useCrossFrameMessageListener(`${require_messagesKeys.MessageKey.INTLAYER_EDITOR_ENABLED}/get`, onEventTriggered);
const EditorEnabledProvider = ({ children }) => {
	const [isEnabled] = useEditorEnabledState({
		emit: false,
		receive: true
	});
	return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EditorEnabledContext.Provider, {
		value: { enabled: isEnabled },
		children
	});
};
const useEditorEnabled = () => (0, react.useContext)(EditorEnabledContext);

//#endregion
exports.EditorEnabledProvider = EditorEnabledProvider;
exports.useEditorEnabled = useEditorEnabled;
exports.useGetEditorEnabledState = useGetEditorEnabledState;
//# sourceMappingURL=EditorEnabledContext.cjs.map