import {
  queryKeysFactory
} from "./chunk-ZA2KFUFR.js";
import {
  sdk
} from "./chunk-ZBWL72TB.js";

// src/hooks/api/order-groups.tsx
import { useQuery } from "@tanstack/react-query";
var ORDER_GROUPS_QUERY_KEY = "order_groups";
var orderGroupsQueryKeys = queryKeysFactory(ORDER_GROUPS_QUERY_KEY);
var useOrderGroupByOrderId = (orderId, query, options) => {
  const { data, ...rest } = useQuery({
    queryFn: () => sdk.admin.orders.$id.orderGroup.query({ $id: orderId, ...query }),
    queryKey: orderGroupsQueryKeys.detail(`order-${orderId}`),
    ...options
  });
  return { ...data, ...rest };
};
var useOrderGroups = (query, options) => {
  const { data, ...rest } = useQuery({
    queryFn: () => sdk.admin.orderGroups.query({ ...query }),
    queryKey: orderGroupsQueryKeys.list(query),
    ...options
  });
  return { ...data, ...rest };
};

export {
  useOrderGroupByOrderId,
  useOrderGroups
};
