import { a as __toCommonJS, i as __require, t as __commonJSMin } from "../../rolldown-runtime.mjs";
import { a as use_gesture_core_esm_exports, i as init_use_gesture_core_esm, n as init_use_gesture_core_utils_esm, o as init_use_gesture_core_actions_esm, r as use_gesture_core_utils_esm_exports, s as use_gesture_core_actions_esm_exports, t as require_use_gesture_core_types_esm } from "./core.mjs";

//#region node_modules/@use-gesture/react/dist/use-gesture-react.cjs.prod.js
var require_use_gesture_react_cjs_prod = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	var actions = (init_use_gesture_core_actions_esm(), __toCommonJS(use_gesture_core_actions_esm_exports));
	var React$1 = __require("react");
	var core = (init_use_gesture_core_esm(), __toCommonJS(use_gesture_core_esm_exports));
	var utils = (init_use_gesture_core_utils_esm(), __toCommonJS(use_gesture_core_utils_esm_exports));
	var types = require_use_gesture_core_types_esm();
	function _interopDefault(e) {
		return e && e.__esModule ? e : { "default": e };
	}
	var React__default = /* @__PURE__ */ _interopDefault(React$1);
	function useRecognizers(handlers, config = {}, gestureKey, nativeHandlers) {
		const ctrl = React__default["default"].useMemo(() => new core.Controller(handlers), []);
		ctrl.applyHandlers(handlers, nativeHandlers);
		ctrl.applyConfig(config, gestureKey);
		React__default["default"].useEffect(ctrl.effect.bind(ctrl));
		React__default["default"].useEffect(() => {
			return ctrl.clean.bind(ctrl);
		}, []);
		if (config.target === void 0) return ctrl.bind.bind(ctrl);
	}
	function useDrag(handler, config) {
		actions.registerAction(actions.dragAction);
		return useRecognizers({ drag: handler }, config || {}, "drag");
	}
	function usePinch(handler, config) {
		actions.registerAction(actions.pinchAction);
		return useRecognizers({ pinch: handler }, config || {}, "pinch");
	}
	function useWheel(handler, config) {
		actions.registerAction(actions.wheelAction);
		return useRecognizers({ wheel: handler }, config || {}, "wheel");
	}
	function useScroll(handler, config) {
		actions.registerAction(actions.scrollAction);
		return useRecognizers({ scroll: handler }, config || {}, "scroll");
	}
	function useMove(handler, config) {
		actions.registerAction(actions.moveAction);
		return useRecognizers({ move: handler }, config || {}, "move");
	}
	function useHover(handler, config) {
		actions.registerAction(actions.hoverAction);
		return useRecognizers({ hover: handler }, config || {}, "hover");
	}
	function createUseGesture(actions$1) {
		actions$1.forEach(actions.registerAction);
		return function useGesture(_handlers, _config) {
			const { handlers, nativeHandlers, config } = core.parseMergedHandlers(_handlers, _config || {});
			return useRecognizers(handlers, config, void 0, nativeHandlers);
		};
	}
	function useGesture(handlers, config) {
		return createUseGesture([
			actions.dragAction,
			actions.pinchAction,
			actions.scrollAction,
			actions.wheelAction,
			actions.moveAction,
			actions.hoverAction
		])(handlers, config || {});
	}
	exports.createUseGesture = createUseGesture;
	exports.useDrag = useDrag;
	exports.useGesture = useGesture;
	exports.useHover = useHover;
	exports.useMove = useMove;
	exports.usePinch = usePinch;
	exports.useScroll = useScroll;
	exports.useWheel = useWheel;
	Object.keys(actions).forEach(function(k) {
		if (k !== "default" && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
			enumerable: true,
			get: function() {
				return actions[k];
			}
		});
	});
	Object.keys(utils).forEach(function(k) {
		if (k !== "default" && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
			enumerable: true,
			get: function() {
				return utils[k];
			}
		});
	});
	Object.keys(types).forEach(function(k) {
		if (k !== "default" && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
			enumerable: true,
			get: function() {
				return types[k];
			}
		});
	});
}));

//#endregion
//#region node_modules/@use-gesture/react/dist/use-gesture-react.cjs.dev.js
var require_use_gesture_react_cjs_dev = /* @__PURE__ */ __commonJSMin(((exports) => {
	Object.defineProperty(exports, "__esModule", { value: true });
	var actions = (init_use_gesture_core_actions_esm(), __toCommonJS(use_gesture_core_actions_esm_exports));
	var React = __require("react");
	var core = (init_use_gesture_core_esm(), __toCommonJS(use_gesture_core_esm_exports));
	var utils = (init_use_gesture_core_utils_esm(), __toCommonJS(use_gesture_core_utils_esm_exports));
	var types = require_use_gesture_core_types_esm();
	function _interopDefault(e) {
		return e && e.__esModule ? e : { "default": e };
	}
	var React__default = /* @__PURE__ */ _interopDefault(React);
	function useRecognizers(handlers, config = {}, gestureKey, nativeHandlers) {
		const ctrl = React__default["default"].useMemo(() => new core.Controller(handlers), []);
		ctrl.applyHandlers(handlers, nativeHandlers);
		ctrl.applyConfig(config, gestureKey);
		React__default["default"].useEffect(ctrl.effect.bind(ctrl));
		React__default["default"].useEffect(() => {
			return ctrl.clean.bind(ctrl);
		}, []);
		if (config.target === void 0) return ctrl.bind.bind(ctrl);
	}
	function useDrag(handler, config) {
		actions.registerAction(actions.dragAction);
		return useRecognizers({ drag: handler }, config || {}, "drag");
	}
	function usePinch(handler, config) {
		actions.registerAction(actions.pinchAction);
		return useRecognizers({ pinch: handler }, config || {}, "pinch");
	}
	function useWheel(handler, config) {
		actions.registerAction(actions.wheelAction);
		return useRecognizers({ wheel: handler }, config || {}, "wheel");
	}
	function useScroll(handler, config) {
		actions.registerAction(actions.scrollAction);
		return useRecognizers({ scroll: handler }, config || {}, "scroll");
	}
	function useMove(handler, config) {
		actions.registerAction(actions.moveAction);
		return useRecognizers({ move: handler }, config || {}, "move");
	}
	function useHover(handler, config) {
		actions.registerAction(actions.hoverAction);
		return useRecognizers({ hover: handler }, config || {}, "hover");
	}
	function createUseGesture(actions$1) {
		actions$1.forEach(actions.registerAction);
		return function useGesture(_handlers, _config) {
			const { handlers, nativeHandlers, config } = core.parseMergedHandlers(_handlers, _config || {});
			return useRecognizers(handlers, config, void 0, nativeHandlers);
		};
	}
	function useGesture(handlers, config) {
		return createUseGesture([
			actions.dragAction,
			actions.pinchAction,
			actions.scrollAction,
			actions.wheelAction,
			actions.moveAction,
			actions.hoverAction
		])(handlers, config || {});
	}
	exports.createUseGesture = createUseGesture;
	exports.useDrag = useDrag;
	exports.useGesture = useGesture;
	exports.useHover = useHover;
	exports.useMove = useMove;
	exports.usePinch = usePinch;
	exports.useScroll = useScroll;
	exports.useWheel = useWheel;
	Object.keys(actions).forEach(function(k) {
		if (k !== "default" && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
			enumerable: true,
			get: function() {
				return actions[k];
			}
		});
	});
	Object.keys(utils).forEach(function(k) {
		if (k !== "default" && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
			enumerable: true,
			get: function() {
				return utils[k];
			}
		});
	});
	Object.keys(types).forEach(function(k) {
		if (k !== "default" && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
			enumerable: true,
			get: function() {
				return types[k];
			}
		});
	});
}));

//#endregion
//#region node_modules/@use-gesture/react/dist/use-gesture-react.cjs.js
var require_use_gesture_react_cjs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
	if (process.env.NODE_ENV === "production") module.exports = require_use_gesture_react_cjs_prod();
	else module.exports = require_use_gesture_react_cjs_dev();
}));

//#endregion
export { require_use_gesture_react_cjs as t };