import { useLayout } from "../../hooks/useLayout.js";
import { useSidebar } from "../../hooks/useSidebar.js";
import { useWorkspace } from "../../store/store.js";
import AddressBar_default from "../../components/AddressBar/AddressBar.vue.js";
import OpenApiClientButton_default from "../../components/OpenApiClientButton.vue.js";
import { createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeClass, openBlock, unref } from "vue";
import { ScalarIcon } from "@scalar/components";
import { useRouter } from "vue-router";
//#region src/views/Request/RequestSubpageHeader.vue?vue&type=script&setup=true&lang.ts
var _hoisted_1 = { class: "lg:min-h-header t-app__top-container flex w-full flex-wrap items-center justify-center border-b p-2 pt-2 lg:p-1 lg:pt-1" };
var _hoisted_2 = { class: "mb-2 flex w-1/2 flex-row items-center gap-1 lg:mb-0 lg:flex-1 lg:px-1" };
var _hoisted_3 = { class: "mb-2 flex w-1/2 flex-row items-center justify-end gap-1 lg:mb-0 lg:flex-1 lg:px-2.5" };
var RequestSubpageHeader_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
	__name: "RequestSubpageHeader",
	props: {
		collection: {},
		operation: {},
		server: {},
		environment: {},
		envVariables: {},
		workspace: {}
	},
	emits: ["hideModal", "importCurl"],
	setup(__props) {
		const { hideClientButton, showSidebar, integration } = useWorkspace();
		const { isSidebarOpen } = useSidebar();
		const { layout } = useLayout();
		const { currentRoute } = useRouter();
		return (_ctx, _cache) => {
			return openBlock(), createElementBlock("div", _hoisted_1, [
				createElementVNode("div", _hoisted_2, [unref(showSidebar) ? (openBlock(), createElementBlock("div", {
					key: 0,
					class: normalizeClass(["size-8", { hidden: unref(layout) === "modal" && !unref(isSidebarOpen) }])
				}, null, 2)) : createCommentVNode("", true)]),
				createVNode(AddressBar_default, {
					collection: __props.collection,
					envVariables: __props.envVariables,
					environment: __props.environment,
					operation: __props.operation,
					server: __props.server,
					workspace: __props.workspace,
					onImportCurl: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("importCurl", $event))
				}, null, 8, [
					"collection",
					"envVariables",
					"environment",
					"operation",
					"server",
					"workspace"
				]),
				createElementVNode("div", _hoisted_3, [
					unref(layout) === "modal" && __props.collection.documentUrl && !unref(hideClientButton) ? (openBlock(), createBlock(unref(OpenApiClientButton_default), {
						key: 0,
						buttonSource: "modal",
						class: "!w-fit lg:-mr-1",
						integration: unref(integration) ?? __props.collection.integration ?? null,
						source: unref(currentRoute).query.source === "gitbook" ? "gitbook" : "api-reference",
						url: __props.collection.documentUrl
					}, null, 8, [
						"integration",
						"source",
						"url"
					])) : createCommentVNode("", true),
					unref(layout) === "modal" ? (openBlock(), createElementBlock("button", {
						key: 1,
						class: "app-exit-button gitbook-hidden zoomed:static zoomed:p-1 fixed top-2 right-2 rounded-full p-2",
						type: "button",
						onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("hideModal"))
					}, [createVNode(unref(ScalarIcon), {
						icon: "Close",
						size: "lg",
						thickness: "2"
					}), _cache[3] || (_cache[3] = createElementVNode("span", { class: "sr-only" }, "Close Client", -1))])) : createCommentVNode("", true),
					unref(layout) === "modal" ? (openBlock(), createElementBlock("button", {
						key: 2,
						class: "text-c-1 hover:bg-b-2 active:text-c-1 gitbook-show -mr-1.5 rounded p-2",
						type: "button",
						onClick: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("hideModal"))
					}, [createVNode(unref(ScalarIcon), {
						icon: "Close",
						size: "md",
						thickness: "1.75"
					}), _cache[4] || (_cache[4] = createElementVNode("span", { class: "sr-only" }, "Close Client", -1))])) : createCommentVNode("", true)
				])
			]);
		};
	}
});
//#endregion
export { RequestSubpageHeader_vue_vue_type_script_setup_true_lang_default as default };

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