import { PathId } from "../../routes.js";
import { useActiveEntities } from "../../store/active-entities.js";
import CollectionInfoForm_default from "./CollectionInfoForm.vue.js";
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeClass, openBlock, renderList, toDisplayString, unref, withCtx } from "vue";
import { RouterLink, useRouter } from "vue-router";
import { LibraryIcon } from "@scalar/icons/library";
//#region src/views/Collection/CollectionNavigation.vue?vue&type=script&setup=true&lang.ts
var _hoisted_1 = { class: "bg-b-1 sticky -top-[104px] z-10 mx-auto w-full" };
var _hoisted_2 = {
	key: 0,
	class: "flex max-w-40 items-center"
};
var _hoisted_3 = { class: "text-c-1 mr-[6.25px] hidden overflow-hidden px-2 font-medium text-ellipsis whitespace-nowrap md:block" };
var CollectionNavigation_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
	__name: "CollectionNavigation",
	props: { isSticky: { type: Boolean } },
	setup(__props) {
		const { currentRoute } = useRouter();
		const { activeCollection } = useActiveEntities();
		const routes = computed(() => [
			{
				displayName: "Overview",
				to: {
					name: "collection.overview",
					params: { [PathId.Collection]: activeCollection.value?.uid }
				}
			},
			{
				displayName: "Servers",
				to: {
					name: "collection.servers",
					params: { [PathId.Collection]: activeCollection.value?.uid }
				}
			},
			{
				displayName: "Authentication",
				to: {
					name: "collection.authentication",
					params: { [PathId.Collection]: activeCollection.value?.uid }
				}
			},
			{
				displayName: "Environment",
				to: {
					name: "collection.environment",
					params: { [PathId.Collection]: activeCollection.value?.uid }
				}
			},
			{
				displayName: "Settings",
				to: { name: "collection.settings" }
			}
		]);
		return (_ctx, _cache) => {
			return openBlock(), createElementBlock("div", _hoisted_1, [createVNode(CollectionInfoForm_default), createElementVNode("div", { class: normalizeClass(["items-center text-sm font-medium", __props.isSticky ? "h-fit border-b md:grid md:grid-cols-[1fr_720px_1fr] md:px-4" : "flex md:mx-auto md:max-w-[720px]"]) }, [__props.isSticky ? (openBlock(), createElementBlock("div", _hoisted_2, [createVNode(unref(LibraryIcon), {
				class: "text-c-2 hidden size-3.5 md:block",
				src: unref(activeCollection)?.["x-scalar-icon"] || "interface-content-folder",
				"stroke-width": "2"
			}, null, 8, ["src"]), createElementVNode("span", _hoisted_3, toDisplayString(unref(activeCollection)?.info?.title), 1)])) : createCommentVNode("", true), createElementVNode("div", { class: normalizeClass(["flex w-full max-w-[720px] gap-2 pl-1.5 md:ml-1.5 md:pl-0", !__props.isSticky && "border-b"]) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(routes.value, ({ to, displayName }, i) => {
				return openBlock(), createBlock(unref(RouterLink), {
					key: i,
					class: "-ml-2 flex h-10 cursor-pointer items-center px-2 text-center text-sm font-medium whitespace-nowrap no-underline -outline-offset-1 has-[:focus-visible]:outline",
					to
				}, {
					default: withCtx(() => [createElementVNode("span", { class: normalizeClass(["flex-center h-full w-full border-b", typeof to.name === "string" && typeof unref(currentRoute).name === "string" && unref(currentRoute).name?.startsWith(to.name) ? "text-c-1 border-c-1" : "text-c-2 hover:text-c-1 border-transparent"]) }, toDisplayString(displayName), 3)]),
					_: 2
				}, 1032, ["to"]);
			}), 128))], 2)], 2)]);
		};
	}
});
//#endregion
export { CollectionNavigation_vue_vue_type_script_setup_true_lang_default as default };

//# sourceMappingURL=CollectionNavigation.vue.script.js.map