import { defineComponent as C, defineAsyncComponent as b, ref as f, openBlock as l, createElementBlock as d, Fragment as w, unref as e, createElementVNode as i, renderSlot as m, createVNode as n, withCtx as p, withDirectives as y, vShow as _, createCommentVNode as u } from "vue";
import { useApiClientStore as k } from "@scalar/api-client";
import { ScalarIcon as v } from "@scalar/components";
import { useMediaQuery as A } from "@vueuse/core";
import B from "./Sidebar/Sidebar.vue.js";
const g = {
  key: 0,
  class: "api-client-drawer"
}, x = { class: "api-client-container" }, E = { class: "scalar-api-client-height" }, M = { class: "scalar-api-client-states" }, U = { class: "t-doc__sidebar" }, K = /* @__PURE__ */ C({
  __name: "ApiClientModalOld",
  props: {
    parsedSpec: {},
    overloadShow: { type: Boolean },
    proxyUrl: {},
    theme: {}
  },
  emits: ["toggleDarkMode"],
  setup($) {
    const h = b(
      () => import("@scalar/api-client").then((t) => t.ApiClient)
    ), { hideApiClient: r, state: c } = k(), S = A("(max-width: 1000px)"), s = f(!1);
    return (t, o) => (l(), d(w, null, [
      e(c).showApiClient || t.overloadShow ? (l(), d("div", g, [
        i("div", x, [
          m(t.$slots, "header", {}, void 0, !0),
          i("div", E, [
            n(e(h), {
              proxyUrl: t.proxyUrl,
              showSideBar: s.value,
              theme: t.theme ?? "none",
              withDefaultFonts: !1,
              onEscapeKeyPress: e(r),
              onToggleSidebar: o[2] || (o[2] = (a) => s.value = !s.value)
            }, {
              "address-bar-controls": p(() => [
                i("div", M, [
                  i("button", {
                    class: "scalar-api-client-states-button scalar-api-client-states-button__endpoints",
                    type: "button",
                    onClick: o[0] || (o[0] = (a) => s.value = !s.value)
                  }, [
                    n(e(v), {
                      icon: s.value ? "SideBarClosed" : "SideBarOpen",
                      size: "sm"
                    }, null, 8, ["icon"])
                  ]),
                  i("button", {
                    class: "scalar-api-client-states-button",
                    type: "button",
                    onClick: o[1] || (o[1] = //@ts-ignore
                    (...a) => e(r) && e(r)(...a))
                  }, [
                    n(e(v), {
                      icon: "Close",
                      size: "sm"
                    })
                  ])
                ])
              ]),
              sidebar: p(() => [
                i("div", U, [
                  y(n(e(B), { parsedSpec: t.parsedSpec }, {
                    "sidebar-start": p(() => [
                      m(t.$slots, "sidebar-start", {}, void 0, !0)
                    ]),
                    _: 3
                  }, 8, ["parsedSpec"]), [
                    [_, !e(S)]
                  ])
                ])
              ]),
              _: 3
            }, 8, ["proxyUrl", "showSideBar", "theme", "onEscapeKeyPress"])
          ])
        ])
      ])) : u("", !0),
      e(c).showApiClient ? (l(), d("div", {
        key: 1,
        class: "api-client-drawer-exit",
        onClick: o[3] || (o[3] = //@ts-ignore
        (...a) => e(r) && e(r)(...a))
      })) : u("", !0)
    ], 64));
  }
});
export {
  K as default
};
