require("../../../../_virtual/_rolldown/runtime.js");
const require_objectSpread2 = require("../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
const require_asyncToGenerator = require("../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js");
const require_hooks = require("../../hooks.js");
let react = require("react");
//#region src/components/ecocup/customerList/hooks/useCustomerApi.ts
const useCustomerListsApi = () => {
	const [loading, setLoading] = (0, react.useState)(false);
	const [data, setData] = (0, react.useState)({});
	const { get } = require_hooks.useRequest();
	const { goalShopId } = require_hooks.useGetGoalShopInfo();
	return {
		loading,
		data,
		run: (0, react.useCallback)(function() {
			var _ref = require_asyncToGenerator._asyncToGenerator(function* (params) {
				try {
					setLoading(true);
					const res = yield get("/shop/wallet/eco/customer", require_objectSpread2._objectSpread2({
						with_cup_count_flag: 1,
						goal_shop_id: goalShopId
					}, params));
					setData((res === null || res === void 0 ? void 0 : res.data) || {});
					setLoading(false);
				} catch (error) {
					setLoading(false);
				}
			});
			return function(_x) {
				return _ref.apply(this, arguments);
			};
		}(), [])
	};
};
//#endregion
exports.useCustomerListsApi = useCustomerListsApi;
