import { lazy } from "react";
import { lazyRetry } from "../utils/lazyRetry";
import {
  ROUTE_SLAUGHTER_ACTIVE_REQUESTS,
  ROUTE_SLAUGHTER_ADD_CAR,
  ROUTE_SLAUGHTER_ARCHIVED_REQUESTS,
  ROUTE_SLAUGHTER_AUCTION,
  ROUTE_SLAUGHTER_CAR_MANAGEMENT,
  ROUTE_SLAUGHTER_FILE_ROUTE,
  ROUTE_SLAUGHTER_REJECTED_REQUESTS,
  ROUTE_SLAUGHTER_REQUESTS,
  ROUTE_SLAUGHTER_TICKET,
  ROUTE_SLAUGHTER_VIEW_TICKET,
  ROUTE_SLAUGHTER_COMPLAINTS,
  ROUTE_SLAUGHTER_INVENTORY,
  ROUTE_SLAUGHTER_FACTORS,
  ROUTE_SLAUGHTER_PENDING_REQUESTS,
  ROUTE_SLAUGHTER_ALLOCATE_CAR_REQUESTS,
  ROUTE_SLAUGHTER_ENTER_BAR_INFO,
  ROUTE_SLAUGHTER_PAY_FACTORS_REQUESTS,
  ROUTE_SLAUGHTER_NEW_REQUESTS,
  ROUTE_SLAUGHTER_PRICING,
  ROUTE_SLAUGHTER_FINAL_FACTORS,
  ROUTE_SLAUGHTER_INVENTORY_SELL_CARCASS_OUT_PROVINCE,
  ROUTE_SLAUGHTER_INVENTORY_SELL_CARCASS_IN_PROVINCE,
  ROUTE_SLAUGHTER_INVENTORY_STOCK,
  ROUTE_SLAUGHTER_PAYING_FEES_REQUESTS,
  ROUTE_SLAUGHTERـFREE_BUY,
  ROUTE_SLAUGHTER_TRADING_PANEL,
  ROUTE_SLAUGHTER_ROUTE_MANAGE_GUILDS,
  ROUTE_SLAUGHTER_FINANCIAL_TRANSACTIONS,
  ROUTE_SLAUGHTER_AGENT_SHARE,
  ROUTE_SLAUGHTER_AGENT_SHARE_ID,
  ROUTE_SLAUGHTER_MORGUE,
  ROUTE_SLAUGHTER_MORGUE_STOCK,
  ROUTE_SLAUGHTER_MORGUE_BROADCAST_MANAGEMENT,
  ROUTE_SLAUGHTER_ROUTE_MANAGE_BARS,
  ROUTE_SLAUGHTER_WALLET,
  ROUTE_SLAUGHTERـEXPORT,
  ROUTE_SLAUGHTER_OUT_PROVINCE_BUY,
  ROUTE_SLAUGHTER_DISPENSERS,
  ROUTE_SLAUGHTER_DISPENSERS_MANAGEMENT,
  ROUTE_SLAUGHTER_DISPENSER_DETAILS,
  ROUTE_SLAUGHTER_DISPENSER_DETAILS_VIEW,
  ROUTE_SLAUGHTER_ALLOCATION_REQUESTS,
  ROUTE_SLAUGHTER_SELL_CARCASS,
  ROUTE_SLAUGHTER_DISPENSERS_STEWARDS,
  ROUTE_SLAUGHTER_DISPENSERS_KILLHOUSES,
  ROUTE_SLAUGHTER_MORGUE_VIEW,
  ROUTE_SLAUGHTER_DAILY_LIST,
  ROUTE_SLAUGHTER_SETTLEMENTS,
  ROUTE_SLAUGHTER_SEGMENTATION,
  ROUTE_SLAUGHTER_RETURN_PURCHASES,
  ROUTE_SLAUGHTER_INVENTORY_SUMMARY,
  ROUTE_SLAUGHTER_ORDERS,
  ROUTE_SLAUGHTER_ROUTE_MANAGE_DISPENSERS,
  ROUTE_SLAUGHTER_ROUTE_MANAGE_DELEGATES,
  ROUTE_SLAUGHTER_ROUTE_DEVICES,
  ROUTE_SLAUGHTER_ROUTE_SUB_UNITS,
  ROUTE_SLAUGHTER_MANAGE_STEWARDS,
  ROUTE_SLAUGHTER_MANAGE_STEWARDS_IN_PROVINCE,
  ROUTE_SLAUGHTER_MANAGE_STEWARDS_IN_PROVINCE_STEWARDS_REQUESTS,
  ROUTE_SLAUGHTER_MANAGE_STEWARDS_IN_PROVINCE_TRUE,
  ROUTE_SLAUGHTER_MANAGE_STEWARDS_IN_PROVINCE_LEGAL,
  ROUTE_SLAUGHTER_MANAGE_STEWARDS_OUT_PROVINCE,
  ROUTE_SLAUGHTER_MANAGE_STEWARDS_OUT_PROVINCE_TRUE,
  ROUTE_SLAUGHTER_MANAGE_STEWARDS_OUT_PROVINCE_LEGAL,
} from "./routes";

const TradePanel = lazy(() => lazyRetry(() => import("../pages/TradePanel")));

const Cars = lazy(() => lazyRetry(() => import("../pages/CarManagement")));
const SlaughterRequestsPage = lazy(() =>
  lazyRetry(() => import("../pages/SlaughterRequestsPage"))
);
// const File = lazy(() => lazyRetry(() => import("../pages/File")));
const NewFile = lazy(() => lazyRetry(() => import("../pages/NewFile")));
const Auction = lazy(() => lazyRetry(() => import("../pages/Auction")));
const Tickets = lazy(() => lazyRetry(() => import("../pages/Tickets")));
const AgentShare = lazy(() =>
  lazyRetry(() => import("../pages/SlaughterAgentShare"))
);
const SlaughterInventoryPage = lazy(() =>
  lazyRetry(() => import("../pages/SlaughterInventoryPage"))
);

const SlaughterMorguePage = lazy(() =>
  lazyRetry(() => import("../pages/SlaughterMorgue"))
);

const SlaughterManageBars = lazy(() =>
  lazyRetry(() => import("../pages/SlaughterManageBars"))
);

const Complaints = lazy(() =>
  lazyRetry(() => import("../pages/SlaughterComplaints"))
);

const SlaughterPricing = lazy(() =>
  lazyRetry(() => import("../pages/ProvinceManagePricing"))
);
const Payment = lazy(() => lazyRetry(() => import("../pages/ProvinceFees")));
const Wallet = lazy(() => lazyRetry(() => import("../pages/Wallet")));

const Guilds = lazy(() => lazyRetry(() => import("../pages/Guilds")));

const TransactionsPage = lazy(() =>
  lazyRetry(() => import("../pages/Transactions"))
);

const FreeBuy = lazy(() =>
  lazyRetry(() => import("../pages/SlaughterFreeBuy"))
);

const Dispensers = lazy(() =>
  lazyRetry(() => import("../pages/SlaughterHouseDispenserDashboard"))
);

const SettlementPage = lazy(() =>
  lazyRetry(() => import("../pages/AdminSettlement"))
);

const ReturnPurchases = lazy(() =>
  lazyRetry(() => import("../pages/ReturnPurchases"))
);

const ManageDispensers = lazy(() =>
  lazyRetry(() =>
    import(
      "../features/slaughter-house/components/slaughter-manage-dispensers/SlaughterManageDispensers"
    )
  )
);

const ManageDelegates = lazy(() =>
  lazyRetry(() =>
    import(
      "../features/slaughter-house/components/slaughter-manage-delegates/SlaughterManageDelegates"
    )
  )
);

const PspDevices = lazy(() =>
  lazyRetry(() =>
    import("../features/guild/components/guild-psp-devices/GuildPspDevices")
  )
);

const SlaughterSubUnits = lazy(() =>
  lazyRetry(() => import("../pages/SlaughterSubUnits"))
);

const ManageStewards = lazy(() =>
  lazyRetry(() => import("../pages/ProvinceManageStewards"))
);

export const slaughterRouting = [
  //cars section slaughter
  {
    path: [ROUTE_SLAUGHTER_ADD_CAR, ROUTE_SLAUGHTER_CAR_MANAGEMENT],
    Page: Cars,
    exact: false,
    props: {},
  },
  //requests
  {
    path: [
      ROUTE_SLAUGHTER_REQUESTS,
      ROUTE_SLAUGHTERـFREE_BUY,
      ROUTE_SLAUGHTER_ACTIVE_REQUESTS,
      ROUTE_SLAUGHTER_REJECTED_REQUESTS,
      ROUTE_SLAUGHTER_ARCHIVED_REQUESTS,
      ROUTE_SLAUGHTER_PENDING_REQUESTS,
      ROUTE_SLAUGHTER_ALLOCATE_CAR_REQUESTS,
      ROUTE_SLAUGHTER_ENTER_BAR_INFO,
      ROUTE_SLAUGHTER_SELL_CARCASS,
      ROUTE_SLAUGHTER_PAY_FACTORS_REQUESTS,
      ROUTE_SLAUGHTER_NEW_REQUESTS,
      ROUTE_SLAUGHTER_FACTORS,
      ROUTE_SLAUGHTER_FINAL_FACTORS,
      ROUTE_SLAUGHTERـEXPORT,
      ROUTE_SLAUGHTER_ALLOCATION_REQUESTS,
    ],
    Page: SlaughterRequestsPage,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_SLAUGHTER_TRADING_PANEL],
    Page: TradePanel,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_SLAUGHTER_SETTLEMENTS],
    Page: SettlementPage,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_SLAUGHTER_AUCTION],
    Page: Auction,
    exact: false,
    props: {},
  },
  {
    path: [
      ROUTE_SLAUGHTER_DISPENSERS,
      ROUTE_SLAUGHTER_DISPENSERS_MANAGEMENT,
      ROUTE_SLAUGHTER_DISPENSER_DETAILS,
      ROUTE_SLAUGHTER_DISPENSER_DETAILS_VIEW,
      ROUTE_SLAUGHTER_DISPENSERS_STEWARDS,
      ROUTE_SLAUGHTER_DISPENSERS_KILLHOUSES,
    ],
    Page: Dispensers,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_SLAUGHTER_FILE_ROUTE],
    Page: NewFile,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_SLAUGHTER_VIEW_TICKET, ROUTE_SLAUGHTER_TICKET],
    Page: Tickets,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_SLAUGHTER_COMPLAINTS],
    Page: Complaints,
    exact: false,
    props: {},
  },
  {
    path: [
      ROUTE_SLAUGHTER_INVENTORY,
      ROUTE_SLAUGHTER_INVENTORY_SELL_CARCASS_OUT_PROVINCE,
      ROUTE_SLAUGHTER_INVENTORY_STOCK,
      ROUTE_SLAUGHTER_INVENTORY_SELL_CARCASS_IN_PROVINCE,
      ROUTE_SLAUGHTER_DAILY_LIST,
      ROUTE_SLAUGHTER_SEGMENTATION,
    ],
    Page: SlaughterInventoryPage,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_SLAUGHTER_PRICING],
    Page: SlaughterPricing,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_SLAUGHTER_PAYING_FEES_REQUESTS],
    Page: Payment,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_SLAUGHTER_WALLET],
    Page: Wallet,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_SLAUGHTER_ROUTE_MANAGE_GUILDS],
    Page: Guilds,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_SLAUGHTER_FINANCIAL_TRANSACTIONS],
    Page: TransactionsPage,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_SLAUGHTER_AGENT_SHARE, ROUTE_SLAUGHTER_AGENT_SHARE_ID],
    Page: AgentShare,
    exact: false,
    props: {},
  },
  {
    path: [
      ROUTE_SLAUGHTER_MORGUE,
      ROUTE_SLAUGHTER_MORGUE_STOCK,
      ROUTE_SLAUGHTER_MORGUE_BROADCAST_MANAGEMENT,
      ROUTE_SLAUGHTER_MORGUE_VIEW,
    ],
    Page: SlaughterMorguePage,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_SLAUGHTER_ROUTE_MANAGE_BARS],
    Page: SlaughterManageBars,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_SLAUGHTER_OUT_PROVINCE_BUY],
    Page: FreeBuy,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_SLAUGHTER_RETURN_PURCHASES],
    Page: ReturnPurchases,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_SLAUGHTER_INVENTORY_SUMMARY],
    Page: SlaughterInventoryPage,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_SLAUGHTER_ORDERS],
    Page: SlaughterInventoryPage,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_SLAUGHTER_ROUTE_SUB_UNITS],
    Page: SlaughterSubUnits,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_SLAUGHTER_ROUTE_MANAGE_DISPENSERS],
    Page: ManageDispensers,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_SLAUGHTER_ROUTE_MANAGE_DELEGATES],
    Page: ManageDelegates,
    exact: false,
    props: {},
  },
  {
    path: [ROUTE_SLAUGHTER_ROUTE_DEVICES],
    Page: PspDevices,
    exact: false,
    props: {},
  },
  {
    path: [
      ROUTE_SLAUGHTER_MANAGE_STEWARDS,
      ROUTE_SLAUGHTER_MANAGE_STEWARDS_IN_PROVINCE,
      ROUTE_SLAUGHTER_MANAGE_STEWARDS_IN_PROVINCE_STEWARDS_REQUESTS,
      ROUTE_SLAUGHTER_MANAGE_STEWARDS_IN_PROVINCE_TRUE,
      ROUTE_SLAUGHTER_MANAGE_STEWARDS_IN_PROVINCE_LEGAL,
      ROUTE_SLAUGHTER_MANAGE_STEWARDS_OUT_PROVINCE,
      ROUTE_SLAUGHTER_MANAGE_STEWARDS_OUT_PROVINCE_TRUE,
      ROUTE_SLAUGHTER_MANAGE_STEWARDS_OUT_PROVINCE_LEGAL,
    ],
    Page: ManageStewards,
    exact: false,
    props: {},
  },
];
