import { ref as e } from "vue";
import { defineStore as t } from "pinia";
//#region src/pages/flow-create/flow-model/createComponents/flow/stores/elementsInfo.ts
var n = t("elementsInfo", () => {
	let t = e([]);
	function n(e, n) {
		let r = t.value.findIndex((t) => t.id === e);
		r === -1 ? t.value.push({
			id: e,
			...n
		}) : t.value[r] = {
			...t.value[r],
			...n
		};
	}
	function r(e) {
		return t.value.find((t) => t.id === e);
	}
	function i(e) {
		let n = t.value.findIndex((t) => t.id === e);
		n !== -1 && t.value.splice(n, 1);
	}
	function a() {
		t.value = [];
	}
	function o(e) {
		let n = t.value.findIndex((e) => e.type === "flow");
		if (n >= 0) {
			let r = t.value.find((e) => e.type === "flow");
			r && (r.title = e, t.value[n] = { ...r });
		}
	}
	function s(e) {
		let n = t.value.findIndex((e) => e.type === "flow");
		if (n >= 0) {
			let r = t.value.find((e) => e.type === "flow");
			r && (r.id = e, t.value[n] = { ...r });
		}
	}
	return {
		elements: t,
		updateElement: n,
		getElementById: r,
		deleteElement: i,
		clearElements: a,
		editFlowName: o,
		editFlowId: s
	};
}), r = t("selectedInfo", () => {
	let t = e(void 0), n = e("");
	function r(e) {
		n.value = e;
	}
	function i(e) {
		t.value = e;
	}
	return {
		selectId: n,
		setSelectId: r,
		selectType: t,
		setSelectType: i
	};
});
//#endregion
export { n, r as t };
