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