import { t as e } from "./_plugin-vue_export-helper-C_T2la-V.mjs";
import { c as t, l as n, s as r, t as i } from "./style-BTq83Oqx.mjs";
import { r as a } from "./baseNodeComponent-QYqKOWZV.mjs";
import { createElementBlock as o, createElementVNode as s, defineComponent as c, nextTick as l, onBeforeUnmount as u, onMounted as d, openBlock as f, ref as p } from "vue";
import './view.css';//#region src/pages/flow-create/flow-model/createComponents/flow/view.vue?vue&type=script&setup=true&lang.ts
var m = { class: "page-main logic-panel" }, h = /* @__PURE__ */ e(/* @__PURE__ */ c({
	name: "FlowModelViewer",
	__name: "view",
	props: {
		xmlString: {},
		viewStyle: {}
	},
	setup(e) {
		let c = e, h = p(null), g = p();
		return d(() => {
			let e = i(c.xmlString);
			console.warn("graphData-->:", e), g.value = new n({
				container: h.value,
				isSilentMode: !0,
				allowRotation: !1,
				allowRotate: !1,
				allowResize: !1,
				hideAnchors: !0,
				outline: !1,
				hoverOutline: !1,
				nodeSelectedOutline: !1,
				edgeSelectedOutline: !1,
				nodeTextEdit: !1,
				edgeTextEdit: !1,
				adjustEdge: !1,
				grid: {
					visible: !0,
					type: "dot",
					config: {
						color: "#dfdfdf",
						thickness: 1
					}
				}
			}), g.value.setTheme({
				background: { background: "#f2f4f7" },
				anchorLine: {
					stroke: "#b1b1b7",
					strokeWidth: 1,
					strokeDasharray: "3,2"
				}
			}), g.value.batchRegister([t]), g.value.setDefaultEdgeType("custom-bezier-edge"), r(g.value), l(() => {
				if (g.value.render(e), g.value.translateCenter(), c.viewStyle) {
					let { unfinishedTaskActivityIds: e, finishedTaskActivityIds: t, finishedSequenceFlowActivityIds: n, rejectedTaskActivityIds: r } = c.viewStyle;
					Array.isArray(n) && n.forEach((e) => {
						g.value.getEdgeModelById(e).setProperties({ strokeColor: "#4eb819" });
					});
					let i = a();
					Array.isArray(t) && i.setFinishedNodeIds(t), Array.isArray(r) && i.setRejectedNodeIds(r);
				}
			});
		}), u(() => {
			g.value && g.value.destroy();
		}), (e, t) => (f(), o("div", m, [s("div", {
			ref_key: "container",
			ref: h,
			class: "flow-container"
		}, null, 512)]));
	}
}), [["__scopeId", "data-v-b89f496b"]]);
//#endregion
export { h as t };
