import {
  PriceListPricesEditForm
} from "./chunk-JDMNEMRJ.js";
import {
  usePriceListCurrencyData
} from "./chunk-X6ZQMFCT.js";
import "./chunk-BNOKKKUU.js";
import "./chunk-6IJMSVC6.js";
import "./chunk-5FBQOAXU.js";
import "./chunk-IQPN4PZJ.js";
import "./chunk-SMQT3ZNO.js";
import "./chunk-TKGWSUEI.js";
import "./chunk-SITRHMZZ.js";
import {
  RouteFocusModal
} from "./chunk-GDWBOQI5.js";
import "./chunk-3QSRE5LS.js";
import "./chunk-WIYFXWRI.js";
import "./chunk-INNFZYX2.js";
import "./chunk-LAVHRER2.js";
import "./chunk-Y7QKP6QU.js";
import "./chunk-RLRWDHME.js";
import "./chunk-K5324KIX.js";
import "./chunk-FV76G2D7.js";
import "./chunk-GHDLST2P.js";
import "./chunk-YVYYOBAE.js";
import "./chunk-L2NJPDUD.js";
import {
  usePriceList,
  usePriceListProducts
} from "./chunk-P7UBW2EI.js";
import "./chunk-MR6REQKT.js";
import "./chunk-EPSDO2MJ.js";
import "./chunk-BHEU34FL.js";
import "./chunk-W34KDYZA.js";
import "./chunk-II3CLUXA.js";
import "./chunk-XKEYHWBS.js";
import "./chunk-J2XUEO2E.js";
import "./chunk-656G74I2.js";
import "./chunk-VWPNMEOE.js";
import "./chunk-O72AIZUN.js";
import "./chunk-VUWAOX7H.js";
import "./chunk-5DKUSZQ7.js";
import "./chunk-DIAWPVYS.js";
import "./chunk-4U2BLH45.js";
import "./chunk-YAUGB4LD.js";
import "./chunk-A5DJIOHN.js";
import "./chunk-RHKRREUU.js";
import "./chunk-ZA2KFUFR.js";
import "./chunk-DTGEFKK4.js";
import "./chunk-NBMM2TZK.js";

// src/pages/price-lists/[id]/products/[variant_id]/edit/index.tsx
import { useTranslation } from "react-i18next";
import { useParams } from "react-router-dom";
import { jsx, jsxs } from "react/jsx-runtime";
var Component = () => {
  const { t } = useTranslation();
  const { id } = useParams();
  const { price_list, isLoading, isError, error } = usePriceList(id);
  const {
    products,
    isLoading: isProductsLoading,
    isError: isProductsError,
    error: productError
  } = usePriceListProducts(id);
  const priceListCurrencyData = usePriceListCurrencyData();
  const ready = !isLoading && !!price_list && !isProductsLoading && !!products && priceListCurrencyData.isReady;
  if (isError) {
    throw error;
  }
  if (isProductsError) {
    throw productError;
  }
  return /* @__PURE__ */ jsxs(RouteFocusModal, { children: [
    /* @__PURE__ */ jsx(RouteFocusModal.Title, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: t("priceLists.products.edit.title", { title: price_list?.title }) }) }),
    /* @__PURE__ */ jsx(RouteFocusModal.Description, { className: "sr-only", children: t("priceLists.products.edit.description") }),
    ready && /* @__PURE__ */ jsx(
      PriceListPricesEditForm,
      {
        priceList: price_list,
        products,
        ...priceListCurrencyData
      }
    )
  ] });
};
export {
  Component
};
