import "../../../../../../../../../../node_modules/.pnpm/vue@3.3.4/node_modules/vue/dist/vue.runtime.esm-bundler.mjs";
import { useTargetData } from "../../../../../hooks/useTargetData.hook.mjs";
import _sfc_main$1 from "../RequestHeaderTable/index.vue2.mjs";
import "../RequestHeaderTable/index.vue.mjs";
import { RequestParamsTypeEnum } from "../../../../../../../../../enums/httpEnum.mjs";
import { defineComponent, resolveComponent, openBlock, createElementBlock, createVNode, withCtx, Fragment, renderList, createTextVNode, createElementVNode as createBaseVNode, createBlock, createCommentVNode } from "../../../../../../../../../../node_modules/.pnpm/@vue_runtime-core@3.3.4/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.mjs";
import { toRefs, ref, unref } from "../../../../../../../../../../node_modules/.pnpm/@vue_reactivity@3.3.4/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.mjs";
import { toDisplayString } from "../../../../../../../../../../node_modules/.pnpm/@vue_shared@3.3.4/node_modules/@vue/shared/dist/shared.esm-bundler.mjs";
const _hoisted_1 = { class: "go-mt-3" };
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "index",
  props: {
    editDisabled: {
      type: Boolean,
      default: true
    }
  },
  setup(__props) {
    const { chartEditStore } = useTargetData();
    const { requestParams } = toRefs(chartEditStore.getRequestGlobalConfig);
    const tabValue = ref(RequestParamsTypeEnum.HEADER);
    const tabs = [RequestParamsTypeEnum.HEADER];
    const updateRequestParams = (paramsObj) => {
      if (tabValue.value === RequestParamsTypeEnum.HEADER) {
        requestParams.value[tabValue.value] = paramsObj;
      }
    };
    return (_ctx, _cache) => {
      const _component_n_tab = resolveComponent("n-tab");
      const _component_n_tabs = resolveComponent("n-tabs");
      return openBlock(), createElementBlock("div", null, [
        createVNode(_component_n_tabs, {
          type: "line",
          animated: "",
          value: tabValue.value,
          "onUpdate:value": _cache[0] || (_cache[0] = ($event) => tabValue.value = $event)
        }, {
          default: withCtx(() => [
            (openBlock(), createElementBlock(Fragment, null, renderList(tabs, (item) => {
              return createVNode(_component_n_tab, {
                key: item,
                name: item,
                tab: item
              }, {
                default: withCtx(() => [
                  createTextVNode(toDisplayString(item), 1)
                ]),
                _: 2
              }, 1032, ["name", "tab"]);
            }), 64))
          ]),
          _: 1
        }, 8, ["value"]),
        createBaseVNode("div", _hoisted_1, [
          tabValue.value === unref(RequestParamsTypeEnum).HEADER ? (openBlock(), createBlock(unref(_sfc_main$1), {
            key: 0,
            editDisabled: __props.editDisabled,
            target: unref(requestParams)[tabValue.value],
            onUpdate: updateRequestParams
          }, null, 8, ["editDisabled", "target"])) : createCommentVNode("", true)
        ])
      ]);
    };
  }
});
export {
  _sfc_main as default
};
