import { jsx } from "react/jsx-runtime";
import { privateApis as routerPrivateApis } from "@wordpress/router";
import Editor from "../editor";
import SidebarNavigationScreenNavigationMenu from "../sidebar-navigation-screen-navigation-menu";
import SidebarNavigationScreenUnsupported from "../sidebar-navigation-screen-unsupported";
import { unlock } from "../../lock-unlock";
const { useLocation } = unlock(routerPrivateApis);
function MobileNavigationItemView() {
  const { query = {} } = useLocation();
  const { canvas = "view" } = query;
  return canvas === "edit" ? /* @__PURE__ */ jsx(Editor, {}) : /* @__PURE__ */ jsx(SidebarNavigationScreenNavigationMenu, { backPath: "/navigation" });
}
const navigationItemRoute = {
  name: "navigation-item",
  path: "/wp_navigation/:postId",
  areas: {
    sidebar({ siteData }) {
      const isBlockTheme = siteData.currentTheme?.is_block_theme;
      return isBlockTheme ? /* @__PURE__ */ jsx(SidebarNavigationScreenNavigationMenu, { backPath: "/navigation" }) : /* @__PURE__ */ jsx(SidebarNavigationScreenUnsupported, {});
    },
    preview({ siteData }) {
      const isBlockTheme = siteData.currentTheme?.is_block_theme;
      return isBlockTheme ? /* @__PURE__ */ jsx(Editor, {}) : /* @__PURE__ */ jsx(SidebarNavigationScreenUnsupported, {});
    },
    mobile({ siteData }) {
      const isBlockTheme = siteData.currentTheme?.is_block_theme;
      return isBlockTheme ? /* @__PURE__ */ jsx(MobileNavigationItemView, {}) : /* @__PURE__ */ jsx(SidebarNavigationScreenUnsupported, {});
    }
  }
};
export {
  navigationItemRoute
};
//# sourceMappingURL=navigation-item.js.map
