import { defineComponent as d, computed as c, createElementBlock as i, openBlock as r, withModifiers as f, createVNode as a, createElementVNode as h, unref as k, withCtx as C, createTextVNode as s, toDisplayString as u, Fragment as y } from "vue";
import { ScalarIcon as B } from "@scalar/components";
import b from "../../components/ScreenReader.vue.js";
import { useConfig as g } from "../../hooks/useConfig.js";
import { useApiClient as q } from "../api-client-modal/useApiClient.js";
const v = ["method"], S = /* @__PURE__ */ d({
  __name: "TestRequestButton",
  props: {
    operation: {}
  },
  setup(o) {
    const { client: t } = q(), p = g(), l = c(
      () => p.value.hideTestRequestButton !== !0
    ), m = () => {
      var e;
      o.operation && ((e = t == null ? void 0 : t.value) != null && e.open) && t.value.open({
        requestUid: o.operation.uid
      });
    };
    return (e, n) => e.operation && l.value ? (r(), i("button", {
      key: 0,
      class: "show-api-client-button",
      method: e.operation.method,
      type: "button",
      onClick: f(m, ["stop"])
    }, [
      a(k(B), {
        icon: "Play",
        size: "sm"
      }),
      n[0] || (n[0] = h("span", null, "Test Request", -1)),
      a(b, null, {
        default: C(() => [
          s("(" + u(e.operation.method) + " " + u(e.operation.path) + ")", 1)
        ]),
        _: 1
      })
    ], 8, v)) : (r(), i(y, { key: 1 }, [
      s(" ")
    ], 64));
  }
});
export {
  S as default
};
