import { n as e } from "./chunk-TYymryXo.mjs";
import { t } from "./_plugin-vue_export-helper-C_T2la-V.mjs";
import { n, t as r } from "./selectedInfo-CT8ehCR8.mjs";
import { computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createVNode as l, defineComponent as u, normalizeClass as d, normalizeStyle as f, openBlock as p, ref as m, resolveDynamicComponent as h, unref as g, vShow as _, watch as v, withDirectives as y } from "vue";
import { CaretRightOutlined as b, CloseSquareOutlined as x, CopyOutlined as S, DeleteOutlined as C, FileOutlined as w, PicCenterOutlined as T, PoweroffOutlined as E, UserOutlined as D } from "@ant-design/icons-vue";
import { defineStore as O } from "pinia";
import './baseNodeComponent.css';//#region src/pages/flow-create/flow-model/createComponents/flow/stores/nodeStatusInfo.ts
var k = O("nodeStatusInfo", () => {
	let e = m([]), t = m([]);
	function n(t) {
		e.value = [...t];
	}
	function r(e) {
		t.value = [...e];
	}
	return {
		finishedNodeIds: e,
		setFinishedNodeIds: n,
		rejectedNodeIds: t,
		setRejectedNodeIds: r
	};
}), A = {
	CaretRightOutlined: b,
	CloseSquareOutlined: x,
	FileOutlined: w,
	PicCenterOutlined: T,
	PoweroffOutlined: E,
	UserOutlined: D
}, j = { class: "operate-panel" }, M = { class: "flow-node" }, N = /* @__PURE__ */ u({
	name: "NodeWarperNew",
	__name: "baseNodeComponent",
	props: {
		node: {},
		graph: {}
	},
	setup(e) {
		let t = e, u = n(), b = r(), x = k(), w = i(() => t.node?.id), T = i(() => t.graph), E = i(() => t.node), D = i(() => t.node.properties), O = i(() => w.value && x.finishedNodeIds.includes(w.value) ? "#4eb819" : w.value && x.rejectedNodeIds.includes(w.value) ? "#ff4d4f" : ""), N = m(b.selectId === w.value);
		v(() => b.selectId, (e) => {
			N.value = e === w.value;
		});
		function P() {
			u.deleteElement(w.value), T.value.deleteNode(w.value);
		}
		function F() {
			let e = `node-${Date.now()}`;
			T.value.addNode({
				type: E.value.type,
				id: e,
				x: (E.value.x || 0) + 40,
				y: (E.value.y || 0) + 40,
				properties: { ...D.value }
			});
			let t = {
				id: e,
				type: E.value.type,
				title: D.value?.title || ""
			};
			u.updateElement(e, t);
		}
		return (e, t) => (p(), s("div", {
			class: d(["node-warp", { "node-m-selected": N.value }]),
			style: f({ borderColor: O.value })
		}, [y(c("div", j, [l(g(S), {
			style: {
				fontSize: "12px",
				color: "#aaa",
				cursor: "pointer"
			},
			onClick: F
		}), l(g(C), {
			style: {
				fontSize: "12px",
				color: "#aaa",
				marginLeft: "6px",
				cursor: "pointer"
			},
			onClick: P
		})], 512), [[_, N.value]]), c("div", M, [D.value.iconName ? (p(), a(h(g(A)[D.value.iconName]), { key: 0 })) : o("", !0)])], 6));
	}
}), P = /* @__PURE__ */ e({ default: () => F }), F = /* @__PURE__ */ t(N, [["__scopeId", "data-v-d8f3cb7a"]]);
//#endregion
export { P as n, k as r, F as t };
