import { defineComponent as I, computed as N, useId as O, createBlock as l, openBlock as s, unref as o, withCtx as r, createVNode as a, createCommentVNode as i, createElementVNode as n, normalizeClass as S, createTextVNode as m, toDisplayString as q, createSlots as W } from "vue";
import { ScalarMarkdown as D, ScalarErrorBoundary as p } from "@scalar/components";
import { ScalarIconWebhooksLogo as L } from "@scalar/icons";
import P from "../../../components/OperationPath.vue.js";
import { useConfig as R } from "../../../hooks/useConfig.js";
import { getOperationStability as C, getOperationStabilityColor as $, isOperationDeprecated as A } from "../../../libs/openapi.js";
import H from "../components/callbacks/Callbacks.vue.js";
import M from "../components/OperationParameters.vue.js";
import U from "../components/OperationResponses.vue.js";
import j from "../../../components/Section/Section.vue.js";
import z from "../../../components/Section/SectionContent.vue.js";
import B from "../../../components/Badge/Badge.vue.js";
import F from "../../../components/Section/SectionHeader.vue.js";
import G from "../../../components/Anchor/Anchor.vue.js";
import J from "../../../components/Section/SectionHeaderTag.vue.js";
import K from "../../../components/Section/SectionColumns.vue.js";
import V from "../../../components/Section/SectionColumn.vue.js";
import Q from "../../example-request/ExampleRequest.vue.js";
import X from "../../test-request-button/TestRequestButton.vue.js";
import Y from "../../example-responses/ExampleResponses.vue.js";
const Z = { class: "operation-details" }, _ = { class: "examples" }, ke = /* @__PURE__ */ I({
  __name: "ModernLayout",
  props: {
    id: {},
    path: {},
    method: {},
    operation: {},
    isWebhook: { type: Boolean },
    collection: {},
    server: {},
    request: {},
    schemas: {}
  },
  emits: ["update:modelValue"],
  setup(d, { emit: w }) {
    const u = N(() => {
      var e;
      return ((e = d.operation) == null ? void 0 : e.summary) || d.path || "";
    }), T = w, c = O(), E = R(), f = (e) => {
      T("update:modelValue", e);
    };
    return (e, h) => (s(), l(o(j), {
      id: e.id,
      "aria-labelledby": o(c),
      label: u.value,
      tabindex: "-1"
    }, {
      default: r(() => [
        a(o(z), {
          loading: o(E).isLoading
        }, {
          default: r(() => [
            o(C)(e.operation) ? (s(), l(o(B), {
              key: 0,
              class: S(o($)(e.operation))
            }, {
              default: r(() => [
                m(q(o(C)(e.operation)), 1)
              ]),
              _: 1
            }, 8, ["class"])) : i("", !0),
            e.isWebhook ? (s(), l(o(B), {
              key: 1,
              class: "font-code text-green flex w-fit items-center justify-center gap-1"
            }, {
              default: r(() => [
                a(o(L), { weight: "bold" }),
                h[0] || (h[0] = m("Webhook "))
              ]),
              _: 1
            })) : i("", !0),
            n("div", {
              class: S(o(A)(e.operation) ? "deprecated" : "")
            }, [
              a(o(F), null, {
                default: r(() => [
                  a(o(G), { id: e.id }, {
                    default: r(() => [
                      a(o(J), {
                        id: o(c),
                        level: 3
                      }, {
                        default: r(() => [
                          m(q(u.value), 1)
                        ]),
                        _: 1
                      }, 8, ["id"])
                    ]),
                    _: 1
                  }, 8, ["id"])
                ]),
                _: 1
              })
            ], 2),
            a(o(K), null, {
              default: r(() => [
                a(o(V), null, {
                  default: r(() => {
                    var t, b, y, g;
                    return [
                      n("div", Z, [
                        a(o(D), {
                          value: (t = e.operation) == null ? void 0 : t.description,
                          withImages: "",
                          withAnchors: "",
                          transformType: "heading",
                          anchorPrefix: e.id
                        }, null, 8, ["value", "anchorPrefix"]),
                        a(M, {
                          parameters: (b = e.operation) == null ? void 0 : b.parameters,
                          requestBody: (y = e.operation) == null ? void 0 : y.requestBody,
                          schemas: e.schemas,
                          "onUpdate:modelValue": f
                        }, null, 8, ["parameters", "requestBody", "schemas"]),
                        a(U, {
                          responses: (g = e.operation) == null ? void 0 : g.responses,
                          schemas: e.schemas
                        }, null, 8, ["responses", "schemas"]),
                        a(o(p), null, {
                          default: r(() => {
                            var k, v;
                            return [
                              (k = e.operation) != null && k.callbacks ? (s(), l(H, {
                                key: 0,
                                callbacks: (v = e.operation) == null ? void 0 : v.callbacks,
                                collection: e.collection,
                                schemas: e.schemas
                              }, null, 8, ["callbacks", "collection", "schemas"])) : i("", !0)
                            ];
                          }),
                          _: 1
                        })
                      ])
                    ];
                  }),
                  _: 1
                }),
                a(o(V), null, {
                  default: r(() => [
                    n("div", _, [
                      a(o(p), null, {
                        default: r(() => [
                          a(o(Q), {
                            request: e.request,
                            method: e.method,
                            collection: e.collection,
                            fallback: "",
                            operation: e.operation,
                            server: e.server,
                            schemas: e.schemas,
                            "onUpdate:modelValue": f
                          }, W({
                            header: r(() => {
                              var t;
                              return [
                                a(P, {
                                  class: "example-path",
                                  deprecated: (t = e.operation) == null ? void 0 : t.deprecated,
                                  path: e.path
                                }, null, 8, ["deprecated", "path"])
                              ];
                            }),
                            _: 2
                          }, [
                            e.request ? {
                              name: "footer",
                              fn: r(() => [
                                a(o(X), { operation: e.request }, null, 8, ["operation"])
                              ]),
                              key: "0"
                            } : void 0
                          ]), 1032, ["request", "method", "collection", "operation", "server", "schemas"])
                        ]),
                        _: 1
                      }),
                      a(o(p), null, {
                        default: r(() => {
                          var t;
                          return [
                            a(o(Y), {
                              responses: (t = e.operation) == null ? void 0 : t.responses,
                              style: { "margin-top": "12px" }
                            }, null, 8, ["responses"])
                          ];
                        }),
                        _: 1
                      })
                    ])
                  ]),
                  _: 1
                })
              ]),
              _: 1
            })
          ]),
          _: 1
        }, 8, ["loading"])
      ]),
      _: 1
    }, 8, ["id", "aria-labelledby", "label"]));
  }
});
export {
  ke as default
};
