require("../../../_virtual/_rolldown/runtime.js");
const require_useEngineContext = require("../../../hooks/useEngineContext.js");
let react = require("react");
//#region src/pro/comprehensiveSearch/hooks/useNativeScanner.ts
const useNativeScanner = (onChange) => {
	var _context$appHelper, _interaction$utils2, _interaction$utils2$i;
	const { interaction, isTerminal } = ((_context$appHelper = require_useEngineContext.default().appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {};
	return {
		activeNativeScanner: (0, react.useCallback)(() => {
			var _interaction$utils, _interaction$utils$po;
			interaction === null || interaction === void 0 || (_interaction$utils = interaction.utils) === null || _interaction$utils === void 0 || (_interaction$utils$po = _interaction$utils.postMessageToApp) === null || _interaction$utils$po === void 0 || _interaction$utils$po.call(_interaction$utils, {
				module: "global",
				key: "active_native_scanner",
				data: { source: "comprehensiveSearch" }
			});
		}, []),
		isTerminal: isTerminal && isTerminal() || (interaction === null || interaction === void 0 || (_interaction$utils2 = interaction.utils) === null || _interaction$utils2 === void 0 || (_interaction$utils2$i = _interaction$utils2.isAppEnv) === null || _interaction$utils2$i === void 0 ? void 0 : _interaction$utils2$i.call(_interaction$utils2))
	};
};
//#endregion
exports.default = useNativeScanner;
