import { defineComponent, createElementBlock, openBlock, withModifiers, createVNode, createElementVNode, unref, withCtx, createTextVNode, toDisplayString } from "vue";
import { ScalarIconPlay } from "@scalar/icons";
import ScreenReader from "../../components/ScreenReader.vue.js";
const _hoisted_1 = ["method"];
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "TestRequestButton",
  props: {
    id: {},
    method: {},
    path: {},
    eventBus: {},
    exampleName: {}
  },
  setup(__props) {
    const handleClick = () => {
      const payload = {
        id: __props.id,
        ...__props.exampleName && { exampleName: __props.exampleName }
      };
      __props.eventBus.emit("ui:open:client-modal", payload);
    };
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("button", {
        class: "show-api-client-button",
        method: __props.method,
        type: "button",
        onClick: withModifiers(handleClick, ["stop"])
      }, [
        createVNode(unref(ScalarIconPlay), {
          class: "size-3",
          weight: "fill"
        }),
        _cache[0] || (_cache[0] = createElementVNode("span", null, "Test Request", -1)),
        createVNode(ScreenReader, null, {
          default: withCtx(() => [
            createTextVNode("(" + toDisplayString(__props.method) + " " + toDisplayString(__props.path) + ")", 1)
          ]),
          _: 1
        })
      ], 8, _hoisted_1);
    };
  }
});
export {
  _sfc_main as default
};
