import { defineComponent as N, openBlock as n, createBlock as s, unref as e, withCtx as o, createVNode as a, createTextVNode as p, toDisplayString as u, createElementVNode as c, createElementBlock as f, Fragment as b, renderList as y, createCommentVNode as V } from "vue";
import { HttpMethod as E } from "@scalar/api-client";
import { ScalarMarkdown as H } from "@scalar/components";
import I from "../../Section/Section.vue.js";
import w from "../../Section/SectionContent.vue.js";
import A from "../../Section/SectionColumns.vue.js";
import g from "../../Section/SectionColumn.vue.js";
import B from "../../Section/SectionHeader.vue.js";
import T from "../../Anchor/Anchor.vue.js";
import M from "../../Card/Card.vue.js";
import O from "../../Card/CardHeader.vue.js";
import D from "../../Card/CardContent.vue.js";
import { useSidebar as F } from "../../../hooks/useSidebar.js";
import { useNavState as L } from "../../../hooks/useNavState.js";
const U = { class: "endpoints" }, $ = ["onClick"], oe = /* @__PURE__ */ N({
  __name: "Endpoints",
  props: {
    id: {},
    tag: {}
  },
  emits: ["observeAndNavigate"],
  setup(C, { emit: h }) {
    const l = C, v = h, { getOperationId: i, getTagId: d } = L(), { setCollapsedSidebarItem: _ } = F(), S = (t) => {
      v("observeAndNavigate", t);
    };
    async function k(t) {
      S(i(t, l.tag)), _(d(l.tag), !0);
    }
    return (t, j) => (n(), s(e(I), {
      id: t.id,
      label: t.tag.name.toUpperCase()
    }, {
      default: o(() => [
        a(e(w), null, {
          default: o(() => [
            a(e(A), null, {
              default: o(() => [
                a(e(g), null, {
                  default: o(() => [
                    a(e(B), { level: 2 }, {
                      default: o(() => [
                        a(e(T), {
                          id: e(d)(t.tag)
                        }, {
                          default: o(() => [
                            p(u(t.tag["x-displayName"] ?? t.tag.name), 1)
                          ]),
                          _: 1
                        }, 8, ["id"])
                      ]),
                      _: 1
                    }),
                    a(e(H), {
                      value: t.tag.description,
                      withImages: ""
                    }, null, 8, ["value"])
                  ]),
                  _: 1
                }),
                a(e(g), null, {
                  default: o(() => {
                    var m;
                    return [
                      ((m = t.tag.operations) == null ? void 0 : m.length) > 0 ? (n(), s(e(M), {
                        key: 0,
                        class: "scalar-card-sticky"
                      }, {
                        default: o(() => [
                          a(e(O), { muted: "" }, {
                            default: o(() => [
                              p("Endpoints")
                            ]),
                            _: 1
                          }),
                          a(e(D), {
                            class: "custom-scroll",
                            muted: ""
                          }, {
                            default: o(() => [
                              c("div", U, [
                                (n(!0), f(b, null, y(t.tag.operations, (r) => (n(), f("a", {
                                  key: e(i)(r, t.tag),
                                  class: "endpoint",
                                  onClick: (q) => k(r)
                                }, [
                                  a(e(E), {
                                    method: r.httpVerb
                                  }, null, 8, ["method"]),
                                  c("span", null, u(r.path), 1)
                                ], 8, $))), 128))
                              ])
                            ]),
                            _: 1
                          })
                        ]),
                        _: 1
                      })) : V("", !0)
                    ];
                  }),
                  _: 1
                })
              ]),
              _: 1
            })
          ]),
          _: 1
        })
      ]),
      _: 1
    }, 8, ["id", "label"]));
  }
});
export {
  oe as default
};
