import {
  REGION_DETAIL_FIELDS,
  RegionDetailPage
} from "./chunk-GDHF6CT5.js";
import "./chunk-TUJIAA5O.js";
import "./chunk-4F5GP7J7.js";
import "./chunk-VW56KWO2.js";
import "./chunk-3XPXUIK3.js";
import "./chunk-E74OUNA3.js";
import "./chunk-FQERBIVS.js";
import "./chunk-KYPPQGGE.js";
import "./chunk-ZMC7BKLT.js";
import "./chunk-KAZ5BYTQ.js";
import "./chunk-634XVU3D.js";
import "./chunk-H6MYB7GB.js";
import "./chunk-IQPN4PZJ.js";
import "./chunk-INNFZYX2.js";
import "./chunk-BDGZ4EQO.js";
import "./chunk-LAVHRER2.js";
import "./chunk-Y7QKP6QU.js";
import "./chunk-HKDFWQ6Q.js";
import "./chunk-SESTTUVM.js";
import "./chunk-THHRRYRS.js";
import "./chunk-UZWFZMOX.js";
import "./chunk-XQNVC4Q7.js";
import {
  regionsQueryKeys,
  useRegion
} from "./chunk-ESPLVOFC.js";
import "./chunk-VDKOJ5WD.js";
import {
  queryClient
} from "./chunk-RHKRREUU.js";
import "./chunk-ZA2KFUFR.js";
import {
  sdk
} from "./chunk-ZBWL72TB.js";
import "./chunk-NBMM2TZK.js";

// src/pages/regions/region-detail/breadcrumb.tsx
import { jsx } from "react/jsx-runtime";
var RegionDetailBreadcrumb = (props) => {
  const { id } = props.params || {};
  const { region } = useRegion(
    id,
    {
      fields: REGION_DETAIL_FIELDS
    },
    {
      initialData: props.data,
      enabled: Boolean(id)
    }
  );
  if (!region) {
    return null;
  }
  return /* @__PURE__ */ jsx("span", { children: region.name });
};

// src/pages/regions/region-detail/loader.ts
var regionQuery = (id) => ({
  queryKey: regionsQueryKeys.detail(id),
  queryFn: async () => sdk.admin.regions.$id.query({ $id: id, fields: REGION_DETAIL_FIELDS })
});
var regionLoader = async ({ params }) => {
  const id = params.id;
  const query = regionQuery(id);
  return queryClient.getQueryData(query.queryKey) ?? await queryClient.fetchQuery(query);
};
export {
  RegionDetailBreadcrumb as Breadcrumb,
  RegionDetailPage as Component,
  regionLoader as loader
};
