"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
require("../../../../../node_modules/element-plus/es/index.js");
;/* empty css                                                             */
;/* empty css                                                                  */
;/* empty css                                                                   */
;/* empty css                                                                  */
;/* empty css                                                                 */
;/* empty css                                                                */
const Vue = require("vue");
;/* empty css         */
const _pluginVue_exportHelper = require("../../../../../_virtual/_plugin-vue_export-helper.js");
const index = require("../../../../../node_modules/element-plus/es/components/popover/index.js");
const index$1 = require("../../../../../node_modules/element-plus/es/components/space/index.js");
const index$2 = require("../../../../../node_modules/element-plus/es/components/text/index.js");
const index$3 = require("../../../../../node_modules/element-plus/es/components/button/index.js");
const _hoisted_1 = { class: "add-but" };
const _sfc_main = {
  __name: "Add",
  emits: ["addNode"],
  setup(__props, { emit: __emit }) {
    const { readOnly } = Vue.inject("flowDesign", { readOnly: Vue.ref(false) });
    const popoverRef = Vue.ref();
    const $emits = __emit;
    const addApprovalNode = () => {
      var _a;
      $emits("addNode", "approval");
      (_a = popoverRef.value) == null ? void 0 : _a.hide();
    };
    const addExclusiveNode = () => {
      var _a;
      $emits("addNode", "exclusive");
      (_a = popoverRef.value) == null ? void 0 : _a.hide();
    };
    return (_ctx, _cache) => {
      const _component_svg_icon = Vue.resolveComponent("svg-icon");
      const _component_el_text = index$2.ElText;
      const _component_el_space = index$1.ElSpace;
      const _component_el_button = index$3.ElButton;
      const _component_el_popover = index.ElPopover;
      return Vue.openBlock(), Vue.createElementBlock("div", _hoisted_1, [
        Vue.createVNode(_component_el_popover, {
          placement: "bottom-start",
          ref_key: "popoverRef",
          ref: popoverRef,
          trigger: "click",
          width: 336
        }, {
          reference: Vue.withCtx(() => [
            Vue.withDirectives(Vue.createVNode(_component_el_button, {
              icon: "Plus",
              type: "primary",
              style: { "z-index": "1" },
              circle: ""
            }, null, 512), [
              [Vue.vShow, !Vue.unref(readOnly)]
            ])
          ]),
          default: Vue.withCtx(() => [
            Vue.createVNode(_component_el_space, { wrap: "" }, {
              default: Vue.withCtx(() => [
                Vue.createElementVNode("div", {
                  class: "node-select",
                  onClick: addApprovalNode
                }, [
                  Vue.createVNode(_component_svg_icon, { name: "el:Stamp" }),
                  Vue.createVNode(_component_el_text, null, {
                    default: Vue.withCtx(() => _cache[0] || (_cache[0] = [
                      Vue.createTextVNode("动作")
                    ])),
                    _: 1
                  })
                ]),
                Vue.createElementVNode("div", {
                  class: "node-select",
                  onClick: addExclusiveNode
                }, [
                  Vue.createVNode(_component_svg_icon, { name: "el:Share" }),
                  Vue.createVNode(_component_el_text, null, {
                    default: Vue.withCtx(() => _cache[1] || (_cache[1] = [
                      Vue.createTextVNode("条件")
                    ])),
                    _: 1
                  })
                ])
              ]),
              _: 1
            })
          ]),
          _: 1
        }, 512)
      ]);
    };
  }
};
const Add = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-3b2a9845"]]);
exports.default = Add;
