build-dxf 0.0.20-10 → 0.0.20-12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/index3.js CHANGED
@@ -1,134 +1,73 @@
1
- import * as THREE from "three";
2
- import { i as isString, n as noop, r as resolveUnref, t as tryOnScopeDispose, c as isClient, d as tryOnMounted, e as identity, f as buildProps, g as definePropType, _ as _export_sfc$1, u as useNamespace, h as isNumber, j as addUnit, w as withInstall, k as useEmptyValuesProps, l as useSizeProp, p as provideGlobalConfig, m as iconPropType, o as useGlobalComponentSettings, T as TypeComponentsMap, q as ElIcon, s as TypeComponents, v as useTimeoutFn, x as isString$1, y as isFunction, z as isBoolean, A as isElement, B as withInstallFunction, L as Lines, D as DomEventRegister, b as ElCheckbox, E as ElButton, S as SelectLocalFile } from "./selectLocalFile.js";
3
- import { C as Component, L as LineSegment, P as Point, B as Box2, E as EventDispatcher, b as PointVirtualGrid, Q as Quadtree, W as WhiteModel } from "./build.js";
1
+ import * as m from "three";
2
+ import { i as dt, n as lt, r as $e, t as He, c as Le, d as ct, e as mt, f as _e, g as B, _ as qe, u as ht, h as me, j as Pe, w as ut, k as pt, l as vt, p as ft, m as gt, o as yt, T as Ie, q as Se, s as wt, v as bt, x as Ne, y as Ee, z as Ce, A as xt, B as Ct, L as he, D as Mt, b as Oe, E as pe, S as Et } from "./selectLocalFile.js";
3
+ import { C as ye, L as ne, P as A, B as We, E as Ue, b as Re, Q as ze, W as Lt } from "./build.js";
4
4
  import "clipper-lib";
5
5
  import "dxf-writer";
6
6
  import "three/addons/controls/OrbitControls.js";
7
- import { watch, ref, defineComponent, computed, createElementBlock, openBlock, normalizeClass, unref, renderSlot, createVNode, Transition, withCtx, withDirectives, createElementVNode, normalizeStyle, createTextVNode, toDisplayString, vShow, shallowReactive, onMounted, createBlock, createCommentVNode, resolveDynamicComponent, Fragment, withModifiers, nextTick, isVNode, render, toRaw, onUnmounted, renderList, createStaticVNode, TransitionGroup, createApp } from "vue";
8
- function unrefElement(elRef) {
9
- var _a;
10
- const plain = resolveUnref(elRef);
11
- return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain;
7
+ import { watch as V, ref as E, defineComponent as oe, computed as _, createElementBlock as S, openBlock as M, normalizeClass as O, unref as v, renderSlot as fe, createVNode as z, Transition as ge, withCtx as F, withDirectives as Qe, createElementVNode as x, normalizeStyle as De, createTextVNode as le, toDisplayString as J, vShow as Ye, shallowReactive as _t, onMounted as Ze, createBlock as de, createCommentVNode as $, resolveDynamicComponent as Dt, Fragment as ce, withModifiers as kt, nextTick as ve, isVNode as Xe, render as Be, toRaw as Pt, onUnmounted as It, renderList as Me, createStaticVNode as St, TransitionGroup as Nt, createApp as Ot } from "vue";
8
+ function Je(r) {
9
+ var e;
10
+ const t = $e(r);
11
+ return (e = t?.$el) != null ? e : t;
12
12
  }
13
- const defaultWindow = isClient ? window : void 0;
14
- function useEventListener(...args) {
15
- let target;
16
- let events;
17
- let listeners;
18
- let options;
19
- if (isString(args[0]) || Array.isArray(args[0])) {
20
- [events, listeners, options] = args;
21
- target = defaultWindow;
22
- } else {
23
- [target, events, listeners, options] = args;
24
- }
25
- if (!target)
26
- return noop;
27
- if (!Array.isArray(events))
28
- events = [events];
29
- if (!Array.isArray(listeners))
30
- listeners = [listeners];
31
- const cleanups = [];
32
- const cleanup = () => {
33
- cleanups.forEach((fn) => fn());
34
- cleanups.length = 0;
13
+ const et = Le ? window : void 0;
14
+ function Rt(...r) {
15
+ let e, t, n, o;
16
+ if (dt(r[0]) || Array.isArray(r[0]) ? ([t, n, o] = r, e = et) : [e, t, n, o] = r, !e)
17
+ return lt;
18
+ Array.isArray(t) || (t = [t]), Array.isArray(n) || (n = [n]);
19
+ const s = [], a = () => {
20
+ s.forEach((c) => c()), s.length = 0;
21
+ }, i = (c, h, w, f) => (c.addEventListener(h, w, f), () => c.removeEventListener(h, w, f)), d = V(() => [Je(e), $e(o)], ([c, h]) => {
22
+ a(), c && s.push(...t.flatMap((w) => n.map((f) => i(c, w, f, h))));
23
+ }, { immediate: !0, flush: "post" }), l = () => {
24
+ d(), a();
35
25
  };
36
- const register = (el, event, listener, options2) => {
37
- el.addEventListener(event, listener, options2);
38
- return () => el.removeEventListener(event, listener, options2);
39
- };
40
- const stopWatch = watch(() => [unrefElement(target), resolveUnref(options)], ([el, options2]) => {
41
- cleanup();
42
- if (!el)
43
- return;
44
- cleanups.push(...events.flatMap((event) => {
45
- return listeners.map((listener) => register(el, event, listener, options2));
46
- }));
47
- }, { immediate: true, flush: "post" });
48
- const stop = () => {
49
- stopWatch();
50
- cleanup();
51
- };
52
- tryOnScopeDispose(stop);
53
- return stop;
26
+ return He(l), l;
54
27
  }
55
- function useSupported(callback, sync = false) {
56
- const isSupported = ref();
57
- const update = () => isSupported.value = Boolean(callback());
58
- update();
59
- tryOnMounted(update, sync);
60
- return isSupported;
28
+ function zt(r, e = !1) {
29
+ const t = E(), n = () => t.value = !!r();
30
+ return n(), ct(n, e), t;
61
31
  }
62
- const _global = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
63
- const globalKey = "__vueuse_ssr_handlers__";
64
- _global[globalKey] = _global[globalKey] || {};
65
- var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
66
- var __hasOwnProp$g = Object.prototype.hasOwnProperty;
67
- var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
68
- var __objRest$2 = (source, exclude) => {
69
- var target = {};
70
- for (var prop in source)
71
- if (__hasOwnProp$g.call(source, prop) && exclude.indexOf(prop) < 0)
72
- target[prop] = source[prop];
73
- if (source != null && __getOwnPropSymbols$g)
74
- for (var prop of __getOwnPropSymbols$g(source)) {
75
- if (exclude.indexOf(prop) < 0 && __propIsEnum$g.call(source, prop))
76
- target[prop] = source[prop];
77
- }
78
- return target;
32
+ const Fe = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Ke = "__vueuse_ssr_handlers__";
33
+ Fe[Ke] = Fe[Ke] || {};
34
+ var Te = Object.getOwnPropertySymbols, Bt = Object.prototype.hasOwnProperty, Ft = Object.prototype.propertyIsEnumerable, Kt = (r, e) => {
35
+ var t = {};
36
+ for (var n in r)
37
+ Bt.call(r, n) && e.indexOf(n) < 0 && (t[n] = r[n]);
38
+ if (r != null && Te)
39
+ for (var n of Te(r))
40
+ e.indexOf(n) < 0 && Ft.call(r, n) && (t[n] = r[n]);
41
+ return t;
79
42
  };
80
- function useResizeObserver(target, callback, options = {}) {
81
- const _a = options, { window: window2 = defaultWindow } = _a, observerOptions = __objRest$2(_a, ["window"]);
82
- let observer;
83
- const isSupported = useSupported(() => window2 && "ResizeObserver" in window2);
84
- const cleanup = () => {
85
- if (observer) {
86
- observer.disconnect();
87
- observer = void 0;
88
- }
89
- };
90
- const stopWatch = watch(() => unrefElement(target), (el) => {
91
- cleanup();
92
- if (isSupported.value && window2 && el) {
93
- observer = new ResizeObserver(callback);
94
- observer.observe(el, observerOptions);
95
- }
96
- }, { immediate: true, flush: "post" });
97
- const stop = () => {
98
- cleanup();
99
- stopWatch();
43
+ function Tt(r, e, t = {}) {
44
+ const n = t, { window: o = et } = n, s = Kt(n, ["window"]);
45
+ let a;
46
+ const i = zt(() => o && "ResizeObserver" in o), d = () => {
47
+ a && (a.disconnect(), a = void 0);
48
+ }, l = V(() => Je(r), (h) => {
49
+ d(), i.value && o && h && (a = new ResizeObserver(e), a.observe(h, s));
50
+ }, { immediate: !0, flush: "post" }), c = () => {
51
+ d(), l();
100
52
  };
101
- tryOnScopeDispose(stop);
102
- return {
103
- isSupported,
104
- stop
53
+ return He(c), {
54
+ isSupported: i,
55
+ stop: c
105
56
  };
106
57
  }
107
- var SwipeDirection;
108
- (function(SwipeDirection2) {
109
- SwipeDirection2["UP"] = "UP";
110
- SwipeDirection2["RIGHT"] = "RIGHT";
111
- SwipeDirection2["DOWN"] = "DOWN";
112
- SwipeDirection2["LEFT"] = "LEFT";
113
- SwipeDirection2["NONE"] = "NONE";
114
- })(SwipeDirection || (SwipeDirection = {}));
115
- var __defProp = Object.defineProperty;
116
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
117
- var __hasOwnProp = Object.prototype.hasOwnProperty;
118
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
119
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
120
- var __spreadValues = (a, b) => {
121
- for (var prop in b || (b = {}))
122
- if (__hasOwnProp.call(b, prop))
123
- __defNormalProp(a, prop, b[prop]);
124
- if (__getOwnPropSymbols)
125
- for (var prop of __getOwnPropSymbols(b)) {
126
- if (__propIsEnum.call(b, prop))
127
- __defNormalProp(a, prop, b[prop]);
128
- }
129
- return a;
58
+ var Ve;
59
+ (function(r) {
60
+ r.UP = "UP", r.RIGHT = "RIGHT", r.DOWN = "DOWN", r.LEFT = "LEFT", r.NONE = "NONE";
61
+ })(Ve || (Ve = {}));
62
+ var Vt = Object.defineProperty, Ae = Object.getOwnPropertySymbols, At = Object.prototype.hasOwnProperty, jt = Object.prototype.propertyIsEnumerable, je = (r, e, t) => e in r ? Vt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, Gt = (r, e) => {
63
+ for (var t in e || (e = {}))
64
+ At.call(e, t) && je(r, t, e[t]);
65
+ if (Ae)
66
+ for (var t of Ae(e))
67
+ jt.call(e, t) && je(r, t, e[t]);
68
+ return r;
130
69
  };
131
- const _TransitionPresets = {
70
+ const $t = {
132
71
  easeInSine: [0.12, 0, 0.39, 0],
133
72
  easeOutSine: [0.61, 1, 0.88, 1],
134
73
  easeInOutSine: [0.37, 0, 0.63, 1],
@@ -154,14 +93,12 @@ const _TransitionPresets = {
154
93
  easeOutBack: [0.34, 1.56, 0.64, 1],
155
94
  easeInOutBack: [0.68, -0.6, 0.32, 1.6]
156
95
  };
157
- __spreadValues({
158
- linear: identity
159
- }, _TransitionPresets);
160
- const mutable = (val) => val;
161
- const EVENT_CODE = {
96
+ Gt({
97
+ linear: mt
98
+ }, $t);
99
+ const Ht = (r) => r, qt = {
162
100
  esc: "Escape"
163
- };
164
- const badgeProps = buildProps({
101
+ }, Wt = _e({
165
102
  value: {
166
103
  type: [String, Number],
167
104
  default: ""
@@ -179,551 +116,440 @@ const badgeProps = buildProps({
179
116
  },
180
117
  showZero: {
181
118
  type: Boolean,
182
- default: true
119
+ default: !0
183
120
  },
184
121
  color: String,
185
122
  badgeStyle: {
186
- type: definePropType([String, Object, Array])
123
+ type: B([String, Object, Array])
187
124
  },
188
125
  offset: {
189
- type: definePropType(Array),
126
+ type: B(Array),
190
127
  default: [0, 0]
191
128
  },
192
129
  badgeClass: {
193
130
  type: String
194
131
  }
195
- });
196
- const __default__$1 = defineComponent({
132
+ }), Ut = oe({
197
133
  name: "ElBadge"
198
- });
199
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
200
- ...__default__$1,
201
- props: badgeProps,
202
- setup(__props, { expose }) {
203
- const props = __props;
204
- const ns = useNamespace("badge");
205
- const content = computed(() => {
206
- if (props.isDot)
207
- return "";
208
- if (isNumber(props.value) && isNumber(props.max)) {
209
- return props.max < props.value ? `${props.max}+` : `${props.value}`;
210
- }
211
- return `${props.value}`;
212
- });
213
- const style = computed(() => {
214
- var _a, _b, _c, _d, _e;
134
+ }), Qt = /* @__PURE__ */ oe({
135
+ ...Ut,
136
+ props: Wt,
137
+ setup(r, { expose: e }) {
138
+ const t = r, n = ht("badge"), o = _(() => t.isDot ? "" : me(t.value) && me(t.max) ? t.max < t.value ? `${t.max}+` : `${t.value}` : `${t.value}`), s = _(() => {
139
+ var a, i, d, l, c;
215
140
  return [
216
141
  {
217
- backgroundColor: props.color,
218
- marginRight: addUnit(-((_b = (_a = props.offset) == null ? void 0 : _a[0]) != null ? _b : 0)),
219
- marginTop: addUnit((_d = (_c = props.offset) == null ? void 0 : _c[1]) != null ? _d : 0)
142
+ backgroundColor: t.color,
143
+ marginRight: Pe(-((i = (a = t.offset) == null ? void 0 : a[0]) != null ? i : 0)),
144
+ marginTop: Pe((l = (d = t.offset) == null ? void 0 : d[1]) != null ? l : 0)
220
145
  },
221
- (_e = props.badgeStyle) != null ? _e : {}
146
+ (c = t.badgeStyle) != null ? c : {}
222
147
  ];
223
148
  });
224
- expose({
225
- content
226
- });
227
- return (_ctx, _cache) => {
228
- return openBlock(), createElementBlock("div", {
229
- class: normalizeClass(unref(ns).b())
230
- }, [
231
- renderSlot(_ctx.$slots, "default"),
232
- createVNode(Transition, {
233
- name: `${unref(ns).namespace.value}-zoom-in-center`,
234
- persisted: ""
235
- }, {
236
- default: withCtx(() => [
237
- withDirectives(createElementVNode("sup", {
238
- class: normalizeClass([
239
- unref(ns).e("content"),
240
- unref(ns).em("content", _ctx.type),
241
- unref(ns).is("fixed", !!_ctx.$slots.default),
242
- unref(ns).is("dot", _ctx.isDot),
243
- unref(ns).is("hide-zero", !_ctx.showZero && props.value === 0),
244
- _ctx.badgeClass
245
- ]),
246
- style: normalizeStyle(unref(style))
247
- }, [
248
- renderSlot(_ctx.$slots, "content", { value: unref(content) }, () => [
249
- createTextVNode(toDisplayString(unref(content)), 1)
250
- ])
251
- ], 6), [
252
- [vShow, !_ctx.hidden && (unref(content) || _ctx.isDot || _ctx.$slots.content)]
149
+ return e({
150
+ content: o
151
+ }), (a, i) => (M(), S("div", {
152
+ class: O(v(n).b())
153
+ }, [
154
+ fe(a.$slots, "default"),
155
+ z(ge, {
156
+ name: `${v(n).namespace.value}-zoom-in-center`,
157
+ persisted: ""
158
+ }, {
159
+ default: F(() => [
160
+ Qe(x("sup", {
161
+ class: O([
162
+ v(n).e("content"),
163
+ v(n).em("content", a.type),
164
+ v(n).is("fixed", !!a.$slots.default),
165
+ v(n).is("dot", a.isDot),
166
+ v(n).is("hide-zero", !a.showZero && t.value === 0),
167
+ a.badgeClass
168
+ ]),
169
+ style: De(v(s))
170
+ }, [
171
+ fe(a.$slots, "content", { value: v(o) }, () => [
172
+ le(J(v(o)), 1)
253
173
  ])
254
- ]),
255
- _: 3
256
- }, 8, ["name"])
257
- ], 2);
258
- };
174
+ ], 6), [
175
+ [Ye, !a.hidden && (v(o) || a.isDot || a.$slots.content)]
176
+ ])
177
+ ]),
178
+ _: 3
179
+ }, 8, ["name"])
180
+ ], 2));
259
181
  }
260
182
  });
261
- var Badge = /* @__PURE__ */ _export_sfc$1(_sfc_main$2, [["__file", "badge.vue"]]);
262
- const ElBadge = withInstall(Badge);
263
- const configProviderProps = buildProps({
183
+ var Yt = /* @__PURE__ */ qe(Qt, [["__file", "badge.vue"]]);
184
+ const Zt = ut(Yt), Xt = _e({
264
185
  a11y: {
265
186
  type: Boolean,
266
- default: true
187
+ default: !0
267
188
  },
268
189
  locale: {
269
- type: definePropType(Object)
190
+ type: B(Object)
270
191
  },
271
- size: useSizeProp,
192
+ size: vt,
272
193
  button: {
273
- type: definePropType(Object)
194
+ type: B(Object)
274
195
  },
275
196
  card: {
276
- type: definePropType(Object)
197
+ type: B(Object)
277
198
  },
278
199
  dialog: {
279
- type: definePropType(Object)
200
+ type: B(Object)
280
201
  },
281
202
  link: {
282
- type: definePropType(Object)
203
+ type: B(Object)
283
204
  },
284
205
  experimentalFeatures: {
285
- type: definePropType(Object)
206
+ type: B(Object)
286
207
  },
287
208
  keyboardNavigation: {
288
209
  type: Boolean,
289
- default: true
210
+ default: !0
290
211
  },
291
212
  message: {
292
- type: definePropType(Object)
213
+ type: B(Object)
293
214
  },
294
215
  zIndex: Number,
295
216
  namespace: {
296
217
  type: String,
297
218
  default: "el"
298
219
  },
299
- ...useEmptyValuesProps
300
- });
301
- const messageConfig = {};
302
- defineComponent({
220
+ ...pt
221
+ }), N = {};
222
+ oe({
303
223
  name: "ElConfigProvider",
304
- props: configProviderProps,
305
- setup(props, { slots }) {
306
- const config = provideGlobalConfig(props);
307
- watch(() => props.message, (val) => {
308
- var _a, _b;
309
- Object.assign(messageConfig, (_b = (_a = config == null ? void 0 : config.value) == null ? void 0 : _a.message) != null ? _b : {}, val != null ? val : {});
310
- }, { immediate: true, deep: true });
311
- return () => renderSlot(slots, "default", { config: config == null ? void 0 : config.value });
224
+ props: Xt,
225
+ setup(r, { slots: e }) {
226
+ const t = ft(r);
227
+ return V(() => r.message, (n) => {
228
+ var o, s;
229
+ Object.assign(N, (s = (o = t?.value) == null ? void 0 : o.message) != null ? s : {}, n ?? {});
230
+ }, { immediate: !0, deep: !0 }), () => fe(e, "default", { config: t?.value });
312
231
  }
313
232
  });
314
- const messageTypes = [
233
+ const tt = [
315
234
  "primary",
316
235
  "success",
317
236
  "info",
318
237
  "warning",
319
238
  "error"
320
- ];
321
- const messageDefaults = mutable({
239
+ ], I = Ht({
322
240
  customClass: "",
323
- dangerouslyUseHTMLString: false,
241
+ dangerouslyUseHTMLString: !1,
324
242
  duration: 3e3,
325
243
  icon: void 0,
326
244
  id: "",
327
245
  message: "",
328
246
  onClose: void 0,
329
- showClose: false,
247
+ showClose: !1,
330
248
  type: "info",
331
- plain: false,
249
+ plain: !1,
332
250
  offset: 16,
333
251
  zIndex: 0,
334
- grouping: false,
252
+ grouping: !1,
335
253
  repeatNum: 1,
336
- appendTo: isClient ? document.body : void 0
337
- });
338
- const messageProps = buildProps({
254
+ appendTo: Le ? document.body : void 0
255
+ }), Jt = _e({
339
256
  customClass: {
340
257
  type: String,
341
- default: messageDefaults.customClass
258
+ default: I.customClass
342
259
  },
343
260
  dangerouslyUseHTMLString: {
344
261
  type: Boolean,
345
- default: messageDefaults.dangerouslyUseHTMLString
262
+ default: I.dangerouslyUseHTMLString
346
263
  },
347
264
  duration: {
348
265
  type: Number,
349
- default: messageDefaults.duration
266
+ default: I.duration
350
267
  },
351
268
  icon: {
352
- type: iconPropType,
353
- default: messageDefaults.icon
269
+ type: gt,
270
+ default: I.icon
354
271
  },
355
272
  id: {
356
273
  type: String,
357
- default: messageDefaults.id
274
+ default: I.id
358
275
  },
359
276
  message: {
360
- type: definePropType([
277
+ type: B([
361
278
  String,
362
279
  Object,
363
280
  Function
364
281
  ]),
365
- default: messageDefaults.message
282
+ default: I.message
366
283
  },
367
284
  onClose: {
368
- type: definePropType(Function),
369
- default: messageDefaults.onClose
285
+ type: B(Function),
286
+ default: I.onClose
370
287
  },
371
288
  showClose: {
372
289
  type: Boolean,
373
- default: messageDefaults.showClose
290
+ default: I.showClose
374
291
  },
375
292
  type: {
376
293
  type: String,
377
- values: messageTypes,
378
- default: messageDefaults.type
294
+ values: tt,
295
+ default: I.type
379
296
  },
380
297
  plain: {
381
298
  type: Boolean,
382
- default: messageDefaults.plain
299
+ default: I.plain
383
300
  },
384
301
  offset: {
385
302
  type: Number,
386
- default: messageDefaults.offset
303
+ default: I.offset
387
304
  },
388
305
  zIndex: {
389
306
  type: Number,
390
- default: messageDefaults.zIndex
307
+ default: I.zIndex
391
308
  },
392
309
  grouping: {
393
310
  type: Boolean,
394
- default: messageDefaults.grouping
311
+ default: I.grouping
395
312
  },
396
313
  repeatNum: {
397
314
  type: Number,
398
- default: messageDefaults.repeatNum
399
- }
400
- });
401
- const messageEmits = {
402
- destroy: () => true
403
- };
404
- const instances = shallowReactive([]);
405
- const getInstance = (id) => {
406
- const idx = instances.findIndex((instance) => instance.id === id);
407
- const current = instances[idx];
408
- let prev;
409
- if (idx > 0) {
410
- prev = instances[idx - 1];
411
- }
412
- return { current, prev };
413
- };
414
- const getLastOffset = (id) => {
415
- const { prev } = getInstance(id);
416
- if (!prev)
417
- return 0;
418
- return prev.vm.exposed.bottom.value;
419
- };
420
- const getOffsetOrSpace = (id, offset) => {
421
- const idx = instances.findIndex((instance) => instance.id === id);
422
- return idx > 0 ? 16 : offset;
423
- };
424
- const __default__ = defineComponent({
315
+ default: I.repeatNum
316
+ }
317
+ }), en = {
318
+ destroy: () => !0
319
+ }, K = _t([]), tn = (r) => {
320
+ const e = K.findIndex((o) => o.id === r), t = K[e];
321
+ let n;
322
+ return e > 0 && (n = K[e - 1]), { current: t, prev: n };
323
+ }, nn = (r) => {
324
+ const { prev: e } = tn(r);
325
+ return e ? e.vm.exposed.bottom.value : 0;
326
+ }, on = (r, e) => K.findIndex((n) => n.id === r) > 0 ? 16 : e, sn = oe({
425
327
  name: "ElMessage"
426
- });
427
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
428
- ...__default__,
429
- props: messageProps,
430
- emits: messageEmits,
431
- setup(__props, { expose, emit }) {
432
- const props = __props;
433
- const { Close } = TypeComponents;
434
- const isStartTransition = ref(false);
435
- const { ns, zIndex } = useGlobalComponentSettings("message");
436
- const { currentZIndex, nextZIndex } = zIndex;
437
- const messageRef = ref();
438
- const visible = ref(false);
439
- const height = ref(0);
440
- let stopTimer = void 0;
441
- const badgeType = computed(() => props.type ? props.type === "error" ? "danger" : props.type : "info");
442
- const typeClass = computed(() => {
443
- const type = props.type;
444
- return { [ns.bm("icon", type)]: type && TypeComponentsMap[type] };
445
- });
446
- const iconComponent = computed(() => props.icon || TypeComponentsMap[props.type] || "");
447
- const lastOffset = computed(() => getLastOffset(props.id));
448
- const offset = computed(() => getOffsetOrSpace(props.id, props.offset) + lastOffset.value);
449
- const bottom = computed(() => height.value + offset.value);
450
- const customStyle = computed(() => ({
451
- top: `${offset.value}px`,
452
- zIndex: currentZIndex.value
328
+ }), an = /* @__PURE__ */ oe({
329
+ ...sn,
330
+ props: Jt,
331
+ emits: en,
332
+ setup(r, { expose: e, emit: t }) {
333
+ const n = r, { Close: o } = wt, s = E(!1), { ns: a, zIndex: i } = yt("message"), { currentZIndex: d, nextZIndex: l } = i, c = E(), h = E(!1), w = E(0);
334
+ let f;
335
+ const C = _(() => n.type ? n.type === "error" ? "danger" : n.type : "info"), b = _(() => {
336
+ const y = n.type;
337
+ return { [a.bm("icon", y)]: y && Ie[y] };
338
+ }), P = _(() => n.icon || Ie[n.type] || ""), D = _(() => nn(n.id)), j = _(() => on(n.id, n.offset) + D.value), se = _(() => w.value + j.value), ue = _(() => ({
339
+ top: `${j.value}px`,
340
+ zIndex: d.value
453
341
  }));
454
- function startTimer() {
455
- if (props.duration === 0)
456
- return;
457
- ({ stop: stopTimer } = useTimeoutFn(() => {
458
- close();
459
- }, props.duration));
342
+ function X() {
343
+ n.duration !== 0 && ({ stop: f } = bt(() => {
344
+ L();
345
+ }, n.duration));
460
346
  }
461
- function clearTimer() {
462
- stopTimer == null ? void 0 : stopTimer();
347
+ function R() {
348
+ f?.();
463
349
  }
464
- function close() {
465
- visible.value = false;
466
- nextTick(() => {
467
- var _a;
468
- if (!isStartTransition.value) {
469
- (_a = props.onClose) == null ? void 0 : _a.call(props);
470
- emit("destroy");
471
- }
350
+ function L() {
351
+ h.value = !1, ve(() => {
352
+ var y;
353
+ s.value || ((y = n.onClose) == null || y.call(n), t("destroy"));
472
354
  });
473
355
  }
474
- function keydown({ code }) {
475
- if (code === EVENT_CODE.esc) {
476
- close();
477
- }
356
+ function H({ code: y }) {
357
+ y === qt.esc && L();
478
358
  }
479
- onMounted(() => {
480
- startTimer();
481
- nextZIndex();
482
- visible.value = true;
483
- });
484
- watch(() => props.repeatNum, () => {
485
- clearTimer();
486
- startTimer();
487
- });
488
- useEventListener(document, "keydown", keydown);
489
- useResizeObserver(messageRef, () => {
490
- height.value = messageRef.value.getBoundingClientRect().height;
491
- });
492
- expose({
493
- visible,
494
- bottom,
495
- close
496
- });
497
- return (_ctx, _cache) => {
498
- return openBlock(), createBlock(Transition, {
499
- name: unref(ns).b("fade"),
500
- onBeforeEnter: ($event) => isStartTransition.value = true,
501
- onBeforeLeave: _ctx.onClose,
502
- onAfterLeave: ($event) => _ctx.$emit("destroy"),
503
- persisted: ""
504
- }, {
505
- default: withCtx(() => [
506
- withDirectives(createElementVNode("div", {
507
- id: _ctx.id,
508
- ref_key: "messageRef",
509
- ref: messageRef,
510
- class: normalizeClass([
511
- unref(ns).b(),
512
- { [unref(ns).m(_ctx.type)]: _ctx.type },
513
- unref(ns).is("closable", _ctx.showClose),
514
- unref(ns).is("plain", _ctx.plain),
515
- _ctx.customClass
359
+ return Ze(() => {
360
+ X(), l(), h.value = !0;
361
+ }), V(() => n.repeatNum, () => {
362
+ R(), X();
363
+ }), Rt(document, "keydown", H), Tt(c, () => {
364
+ w.value = c.value.getBoundingClientRect().height;
365
+ }), e({
366
+ visible: h,
367
+ bottom: se,
368
+ close: L
369
+ }), (y, we) => (M(), de(ge, {
370
+ name: v(a).b("fade"),
371
+ onBeforeEnter: (ae) => s.value = !0,
372
+ onBeforeLeave: y.onClose,
373
+ onAfterLeave: (ae) => y.$emit("destroy"),
374
+ persisted: ""
375
+ }, {
376
+ default: F(() => [
377
+ Qe(x("div", {
378
+ id: y.id,
379
+ ref_key: "messageRef",
380
+ ref: c,
381
+ class: O([
382
+ v(a).b(),
383
+ { [v(a).m(y.type)]: y.type },
384
+ v(a).is("closable", y.showClose),
385
+ v(a).is("plain", y.plain),
386
+ y.customClass
387
+ ]),
388
+ style: De(v(ue)),
389
+ role: "alert",
390
+ onMouseenter: R,
391
+ onMouseleave: X
392
+ }, [
393
+ y.repeatNum > 1 ? (M(), de(v(Zt), {
394
+ key: 0,
395
+ value: y.repeatNum,
396
+ type: v(C),
397
+ class: O(v(a).e("badge"))
398
+ }, null, 8, ["value", "type", "class"])) : $("v-if", !0),
399
+ v(P) ? (M(), de(v(Se), {
400
+ key: 1,
401
+ class: O([v(a).e("icon"), v(b)])
402
+ }, {
403
+ default: F(() => [
404
+ (M(), de(Dt(v(P))))
516
405
  ]),
517
- style: normalizeStyle(unref(customStyle)),
518
- role: "alert",
519
- onMouseenter: clearTimer,
520
- onMouseleave: startTimer
521
- }, [
522
- _ctx.repeatNum > 1 ? (openBlock(), createBlock(unref(ElBadge), {
406
+ _: 1
407
+ }, 8, ["class"])) : $("v-if", !0),
408
+ fe(y.$slots, "default", {}, () => [
409
+ y.dangerouslyUseHTMLString ? (M(), S(ce, { key: 1 }, [
410
+ $(" Caution here, message could've been compromised, never use user's input as message "),
411
+ x("p", {
412
+ class: O(v(a).e("content")),
413
+ innerHTML: y.message
414
+ }, null, 10, ["innerHTML"])
415
+ ], 2112)) : (M(), S("p", {
523
416
  key: 0,
524
- value: _ctx.repeatNum,
525
- type: unref(badgeType),
526
- class: normalizeClass(unref(ns).e("badge"))
527
- }, null, 8, ["value", "type", "class"])) : createCommentVNode("v-if", true),
528
- unref(iconComponent) ? (openBlock(), createBlock(unref(ElIcon), {
529
- key: 1,
530
- class: normalizeClass([unref(ns).e("icon"), unref(typeClass)])
531
- }, {
532
- default: withCtx(() => [
533
- (openBlock(), createBlock(resolveDynamicComponent(unref(iconComponent))))
534
- ]),
535
- _: 1
536
- }, 8, ["class"])) : createCommentVNode("v-if", true),
537
- renderSlot(_ctx.$slots, "default", {}, () => [
538
- !_ctx.dangerouslyUseHTMLString ? (openBlock(), createElementBlock("p", {
539
- key: 0,
540
- class: normalizeClass(unref(ns).e("content"))
541
- }, toDisplayString(_ctx.message), 3)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
542
- createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),
543
- createElementVNode("p", {
544
- class: normalizeClass(unref(ns).e("content")),
545
- innerHTML: _ctx.message
546
- }, null, 10, ["innerHTML"])
547
- ], 2112))
417
+ class: O(v(a).e("content"))
418
+ }, J(y.message), 3))
419
+ ]),
420
+ y.showClose ? (M(), de(v(Se), {
421
+ key: 2,
422
+ class: O(v(a).e("closeBtn")),
423
+ onClick: kt(L, ["stop"])
424
+ }, {
425
+ default: F(() => [
426
+ z(v(o))
548
427
  ]),
549
- _ctx.showClose ? (openBlock(), createBlock(unref(ElIcon), {
550
- key: 2,
551
- class: normalizeClass(unref(ns).e("closeBtn")),
552
- onClick: withModifiers(close, ["stop"])
553
- }, {
554
- default: withCtx(() => [
555
- createVNode(unref(Close))
556
- ]),
557
- _: 1
558
- }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true)
559
- ], 46, ["id"]), [
560
- [vShow, visible.value]
561
- ])
562
- ]),
563
- _: 3
564
- }, 8, ["name", "onBeforeEnter", "onBeforeLeave", "onAfterLeave"]);
565
- };
428
+ _: 1
429
+ }, 8, ["class", "onClick"])) : $("v-if", !0)
430
+ ], 46, ["id"]), [
431
+ [Ye, h.value]
432
+ ])
433
+ ]),
434
+ _: 3
435
+ }, 8, ["name", "onBeforeEnter", "onBeforeLeave", "onAfterLeave"]));
566
436
  }
567
437
  });
568
- var MessageConstructor = /* @__PURE__ */ _export_sfc$1(_sfc_main$1, [["__file", "message.vue"]]);
569
- let seed = 1;
570
- const normalizeOptions = (params) => {
571
- const options = !params || isString$1(params) || isVNode(params) || isFunction(params) ? { message: params } : params;
572
- const normalized = {
573
- ...messageDefaults,
574
- ...options
438
+ var rn = /* @__PURE__ */ qe(an, [["__file", "message.vue"]]);
439
+ let dn = 1;
440
+ const nt = (r) => {
441
+ const e = !r || Ne(r) || Xe(r) || Ee(r) ? { message: r } : r, t = {
442
+ ...I,
443
+ ...e
575
444
  };
576
- if (!normalized.appendTo) {
577
- normalized.appendTo = document.body;
578
- } else if (isString$1(normalized.appendTo)) {
579
- let appendTo = document.querySelector(normalized.appendTo);
580
- if (!isElement(appendTo)) {
581
- appendTo = document.body;
582
- }
583
- normalized.appendTo = appendTo;
584
- }
585
- if (isBoolean(messageConfig.grouping) && !normalized.grouping) {
586
- normalized.grouping = messageConfig.grouping;
587
- }
588
- if (isNumber(messageConfig.duration) && normalized.duration === 3e3) {
589
- normalized.duration = messageConfig.duration;
590
- }
591
- if (isNumber(messageConfig.offset) && normalized.offset === 16) {
592
- normalized.offset = messageConfig.offset;
593
- }
594
- if (isBoolean(messageConfig.showClose) && !normalized.showClose) {
595
- normalized.showClose = messageConfig.showClose;
596
- }
597
- if (isBoolean(messageConfig.plain) && !normalized.plain) {
598
- normalized.plain = messageConfig.plain;
599
- }
600
- return normalized;
601
- };
602
- const closeMessage = (instance) => {
603
- const idx = instances.indexOf(instance);
604
- if (idx === -1)
445
+ if (!t.appendTo)
446
+ t.appendTo = document.body;
447
+ else if (Ne(t.appendTo)) {
448
+ let n = document.querySelector(t.appendTo);
449
+ xt(n) || (n = document.body), t.appendTo = n;
450
+ }
451
+ return Ce(N.grouping) && !t.grouping && (t.grouping = N.grouping), me(N.duration) && t.duration === 3e3 && (t.duration = N.duration), me(N.offset) && t.offset === 16 && (t.offset = N.offset), Ce(N.showClose) && !t.showClose && (t.showClose = N.showClose), Ce(N.plain) && !t.plain && (t.plain = N.plain), t;
452
+ }, ln = (r) => {
453
+ const e = K.indexOf(r);
454
+ if (e === -1)
605
455
  return;
606
- instances.splice(idx, 1);
607
- const { handler } = instance;
608
- handler.close();
609
- };
610
- const createMessage = ({ appendTo, ...options }, context) => {
611
- const id = `message_${seed++}`;
612
- const userOnClose = options.onClose;
613
- const container = document.createElement("div");
614
- const props = {
615
- ...options,
616
- id,
456
+ K.splice(e, 1);
457
+ const { handler: t } = r;
458
+ t.close();
459
+ }, cn = ({ appendTo: r, ...e }, t) => {
460
+ const n = `message_${dn++}`, o = e.onClose, s = document.createElement("div"), a = {
461
+ ...e,
462
+ id: n,
617
463
  onClose: () => {
618
- userOnClose == null ? void 0 : userOnClose();
619
- closeMessage(instance);
464
+ o?.(), ln(c);
620
465
  },
621
466
  onDestroy: () => {
622
- render(null, container);
467
+ Be(null, s);
623
468
  }
624
- };
625
- const vnode = createVNode(MessageConstructor, props, isFunction(props.message) || isVNode(props.message) ? {
626
- default: isFunction(props.message) ? props.message : () => props.message
469
+ }, i = z(rn, a, Ee(a.message) || Xe(a.message) ? {
470
+ default: Ee(a.message) ? a.message : () => a.message
627
471
  } : null);
628
- vnode.appContext = context || message._context;
629
- render(vnode, container);
630
- appendTo.appendChild(container.firstElementChild);
631
- const vm = vnode.component;
632
- const handler = {
633
- close: () => {
634
- vm.exposed.close();
635
- }
636
- };
637
- const instance = {
638
- id,
639
- vnode,
640
- vm,
641
- handler,
642
- props: vnode.component.props
472
+ i.appContext = t || te._context, Be(i, s), r.appendChild(s.firstElementChild);
473
+ const d = i.component, c = {
474
+ id: n,
475
+ vnode: i,
476
+ vm: d,
477
+ handler: {
478
+ close: () => {
479
+ d.exposed.close();
480
+ }
481
+ },
482
+ props: i.component.props
643
483
  };
644
- return instance;
645
- };
646
- const message = (options = {}, context) => {
647
- if (!isClient)
648
- return { close: () => void 0 };
649
- const normalized = normalizeOptions(options);
650
- if (normalized.grouping && instances.length) {
651
- const instance2 = instances.find(({ vnode: vm }) => {
652
- var _a;
653
- return ((_a = vm.props) == null ? void 0 : _a.message) === normalized.message;
484
+ return c;
485
+ }, te = (r = {}, e) => {
486
+ if (!Le)
487
+ return { close: () => {
488
+ } };
489
+ const t = nt(r);
490
+ if (t.grouping && K.length) {
491
+ const o = K.find(({ vnode: s }) => {
492
+ var a;
493
+ return ((a = s.props) == null ? void 0 : a.message) === t.message;
654
494
  });
655
- if (instance2) {
656
- instance2.props.repeatNum += 1;
657
- instance2.props.type = normalized.type;
658
- return instance2.handler;
659
- }
660
- }
661
- if (isNumber(messageConfig.max) && instances.length >= messageConfig.max) {
662
- return { close: () => void 0 };
663
- }
664
- const instance = createMessage(normalized, context);
665
- instances.push(instance);
666
- return instance.handler;
495
+ if (o)
496
+ return o.props.repeatNum += 1, o.props.type = t.type, o.handler;
497
+ }
498
+ if (me(N.max) && K.length >= N.max)
499
+ return { close: () => {
500
+ } };
501
+ const n = cn(t, e);
502
+ return K.push(n), n.handler;
667
503
  };
668
- messageTypes.forEach((type) => {
669
- message[type] = (options = {}, appContext) => {
670
- const normalized = normalizeOptions(options);
671
- return message({ ...normalized, type }, appContext);
504
+ tt.forEach((r) => {
505
+ te[r] = (e = {}, t) => {
506
+ const n = nt(e);
507
+ return te({ ...n, type: r }, t);
672
508
  };
673
509
  });
674
- function closeAll(type) {
675
- const instancesToClose = [...instances];
676
- for (const instance of instancesToClose) {
677
- if (!type || type === instance.props.type) {
678
- instance.handler.close();
679
- }
680
- }
510
+ function mn(r) {
511
+ const e = [...K];
512
+ for (const t of e)
513
+ (!r || r === t.props.type) && t.handler.close();
681
514
  }
682
- message.closeAll = closeAll;
683
- message._context = null;
684
- const ElMessage = withInstallFunction(message, "$message");
685
- class CommandFlowComponent extends Component {
515
+ te.closeAll = mn;
516
+ te._context = null;
517
+ const k = Ct(te, "$message");
518
+ class T extends ye {
686
519
  _renderer;
687
520
  get renderer() {
688
- if (!this._renderer) this._renderer = this.parent?.findComponentByName("Renderer");
689
- return this._renderer;
521
+ return this._renderer || (this._renderer = this.parent?.findComponentByName("Renderer")), this._renderer;
690
522
  }
691
523
  _domElement;
692
524
  get domElement() {
693
- if (!this._domElement) this._domElement = this.editor?.domContainer?.domElement;
694
- return this._domElement;
525
+ return this._domElement || (this._domElement = this.editor?.domContainer?.domElement), this._domElement;
695
526
  }
696
527
  _editor;
697
528
  get editor() {
698
- if (!this._editor) this._editor = this.parent?.findComponentByName("Editor");
699
- return this._editor;
529
+ return this._editor || (this._editor = this.parent?.findComponentByName("Editor")), this._editor;
700
530
  }
701
531
  _eventInput;
702
532
  get eventInput() {
703
- if (!this._eventInput) this._eventInput = this.parent?.findComponentByName("EventInput");
704
- return this._eventInput;
533
+ return this._eventInput || (this._eventInput = this.parent?.findComponentByName("EventInput")), this._eventInput;
705
534
  }
706
535
  _renderManager;
707
536
  get renderManager() {
708
- if (!this._renderManager) this._renderManager = this.parent?.findComponentByName("RenderManager");
709
- return this._renderManager;
537
+ return this._renderManager || (this._renderManager = this.parent?.findComponentByName("RenderManager")), this._renderManager;
710
538
  }
711
539
  _commandManager;
712
540
  get commandManager() {
713
- if (!this._commandManager) this._commandManager = this.editor?.commandManager;
714
- return this._commandManager;
541
+ return this._commandManager || (this._commandManager = this.editor?.commandManager), this._commandManager;
715
542
  }
716
543
  _default;
717
544
  get default() {
718
- if (!this._default) this._default = this.parent?.findComponentByName("Default");
719
- return this._default;
545
+ return this._default || (this._default = this.parent?.findComponentByName("Default")), this._default;
720
546
  }
721
547
  interruptKeys = ["escape"];
722
548
  commandName = "";
723
549
  constructor() {
724
550
  super();
725
551
  }
726
- onAddFromParent(parent) {
552
+ onAddFromParent(e) {
727
553
  this.editor.addEventListener("cancelCommand", () => {
728
554
  this.cancel();
729
555
  });
@@ -732,23 +558,21 @@ class CommandFlowComponent extends Component {
732
558
  * 取消
733
559
  */
734
560
  cancel() {
735
- const commandName = this.commandName || this.constructor.commandName;
736
- if (this.commandManager.currentName !== commandName) return;
737
- this.commandManager.cancel();
561
+ const e = this.commandName || this.constructor.commandName;
562
+ this.commandManager.currentName === e && this.commandManager.cancel();
738
563
  }
739
564
  /**
740
565
  * 创建中断处理命令节点
741
566
  * @returns
742
567
  */
743
568
  createInterrupt() {
744
- return (next, data) => {
569
+ return (e, t) => {
745
570
  this.addEventRecord(
746
571
  "clear",
747
572
  this.eventInput.addEventListener("codeChange", async () => {
748
- if (this.eventInput.isKeyDowns(this.interruptKeys)) this.cancel();
573
+ this.eventInput.isKeyDowns(this.interruptKeys) && this.cancel();
749
574
  })
750
- );
751
- next(data);
575
+ ), e(t);
752
576
  };
753
577
  }
754
578
  /**
@@ -756,207 +580,153 @@ class CommandFlowComponent extends Component {
756
580
  * @param cursor
757
581
  * @returns
758
582
  */
759
- createCursor(cursor) {
760
- return (next, data) => {
761
- const defaultCursor = this.domElement.style.cursor;
762
- this.domElement.style.cursor = cursor;
763
- this.addEventRecord("clear", () => {
764
- this.domElement.style.cursor = defaultCursor ?? "default";
765
- });
766
- next(data);
583
+ createCursor(e) {
584
+ return (t, n) => {
585
+ const o = this.domElement.style.cursor;
586
+ this.domElement.style.cursor = e, this.addEventRecord("clear", () => {
587
+ this.domElement.style.cursor = o ?? "default";
588
+ }), t(n);
767
589
  };
768
590
  }
769
591
  /**
770
592
  * 创建清理
771
593
  * @returns
772
594
  */
773
- createFinally(keys = []) {
595
+ createFinally(e = []) {
774
596
  return () => {
775
- this.canceEventRecord("clear");
776
- keys.forEach((k) => this.canceEventRecord(k));
597
+ this.canceEventRecord("clear"), e.forEach((t) => this.canceEventRecord(t));
777
598
  };
778
599
  }
779
600
  }
780
- class DrawLine extends CommandFlowComponent {
601
+ class hn extends T {
781
602
  static name = "DrawLine";
782
- container = new THREE.Group();
603
+ container = new m.Group();
783
604
  interruptKeys = ["escape"];
784
605
  withdrawalKeys = ["control", "z"];
785
606
  shortcutKeys = ["control", "l"];
786
607
  confirmKeys = ["enter"];
787
608
  commandName = "draw-line";
788
- onAddFromParent(parent) {
789
- super.onAddFromParent(parent);
790
- this.editor.container.add(this.container);
791
- const commandFlow = this.commandManager.addCommandFlow(this.commandName).add(this.createInterrupt()).add(this.createCursor("crosshair")).add(this.selectPoint.bind(this)).add(this.end.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
792
- commandFlow.addEventListener("finally", this.createFinally());
793
- commandFlow.addEventListener("completed", (e) => this.completed(e.data));
794
- this.eventInput.addKeyCombination(this.commandName, this.shortcutKeys);
795
- this.eventInput.addEventListener("codeChange", async () => this.eventInput.isKeyCombination(this.commandName) && await this.commandManager.start(this.commandName));
796
- this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
609
+ onAddFromParent(e) {
610
+ super.onAddFromParent(e), this.editor.container.add(this.container);
611
+ const t = this.commandManager.addCommandFlow(this.commandName).add(this.createInterrupt()).add(this.createCursor("crosshair")).add(this.selectPoint.bind(this)).add(this.end.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
612
+ t.addEventListener("finally", this.createFinally()), t.addEventListener("completed", (n) => this.completed(n.data)), this.eventInput.addKeyCombination(this.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => this.eventInput.isKeyCombination(this.commandName) && await this.commandManager.start(this.commandName)), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
797
613
  }
798
614
  /** 选择点
799
615
  * @param next
800
616
  */
801
- selectPoint(next) {
802
- let editor = this.parent?.findComponentByName("Editor"), start = null, end = null, points = [], circle = new THREE.Mesh(new THREE.SphereGeometry(0.05), new THREE.MeshBasicMaterial({ color: 65280 })), dom = editor.domContainer.domElement, line2 = new Lines([], 16711935), auxiliaryLine = new Lines([
803
- new THREE.Vector3(-1e4, 0, 0),
804
- new THREE.Vector3(1e4, 0, 0),
805
- new THREE.Vector3(0, -1e4, 0),
806
- new THREE.Vector3(0, 1e4, 0)
617
+ selectPoint(e) {
618
+ let t = this.parent?.findComponentByName("Editor"), n = null, o = null, s = [], a = new m.Mesh(new m.SphereGeometry(0.05), new m.MeshBasicMaterial({ color: 65280 })), i = t.domContainer.domElement, d = new he([], 16711935), l = new he([
619
+ new m.Vector3(-1e4, 0, 0),
620
+ new m.Vector3(1e4, 0, 0),
621
+ new m.Vector3(0, -1e4, 0),
622
+ new m.Vector3(0, 1e4, 0)
807
623
  ], 16711935);
808
- auxiliaryLine.material = new THREE.LineDashedMaterial({
624
+ l.material = new m.LineDashedMaterial({
809
625
  color: 4235007,
810
626
  dashSize: 0.1,
811
627
  gapSize: 0.1,
812
628
  linewidth: 0.1
813
- });
814
- this.container.add(line2);
815
- const updateLine = () => {
816
- line2.setPoint(...points, start, end);
817
- auxiliaryLine.position.copy(end);
818
- this.container.add(auxiliaryLine);
819
- auxiliaryLine.computeLineDistances();
820
- };
821
- const currentPoint = new THREE.Vector3();
629
+ }), this.container.add(d);
630
+ const c = () => {
631
+ d.setPoint(...s, n, o), l.position.copy(o), this.container.add(l), l.computeLineDistances();
632
+ }, h = new m.Vector3();
822
633
  this.addEventRecord(
823
634
  "clear",
824
- editor.addEventListener("pointerPositionChange", () => {
825
- const { point, find } = editor.renderManager.adsorption();
826
- this.dispatchEvent({ type: "pointerMove", point });
827
- if (find) {
828
- circle.position.set(point.x, point.y, 0);
829
- this.container.add(circle);
830
- dom.style.cursor = "none";
831
- } else {
832
- circle.removeFromParent();
833
- dom.style.cursor = "crosshair";
834
- }
835
- currentPoint.copy(point);
836
- if (!(start && end)) return;
837
- if (editor.eventInput.isKeyDown("shift")) {
838
- const x = Math.abs(editor.pointerPosition.x - start.x), y = Math.abs(editor.pointerPosition.y - start.y);
839
- if (x > y) end.set(editor.pointerPosition.x, start.y, 0);
840
- else end.set(start.x, editor.pointerPosition.y, 0);
841
- updateLine();
842
- currentPoint.copy(end);
843
- return;
635
+ t.addEventListener("pointerPositionChange", () => {
636
+ const { point: w, find: f } = t.renderManager.adsorption();
637
+ if (this.dispatchEvent({ type: "pointerMove", point: w }), f ? (a.position.set(w.x, w.y, 0), this.container.add(a), i.style.cursor = "none") : (a.removeFromParent(), i.style.cursor = "crosshair"), h.copy(w), !!(n && o)) {
638
+ if (t.eventInput.isKeyDown("shift")) {
639
+ const C = Math.abs(t.pointerPosition.x - n.x), b = Math.abs(t.pointerPosition.y - n.y);
640
+ C > b ? o.set(t.pointerPosition.x, n.y, 0) : o.set(n.x, t.pointerPosition.y, 0), c(), h.copy(o);
641
+ return;
642
+ }
643
+ o.set(t.pointerPosition.x, t.pointerPosition.y, 0), c();
844
644
  }
845
- end.set(editor.pointerPosition.x, editor.pointerPosition.y, 0);
846
- updateLine();
847
645
  }),
848
- editor.eventInput.addEventListener("codeChange", async () => {
849
- if (editor.eventInput.isKeyDown("mouse_0")) {
850
- if (!start) {
851
- start = currentPoint.clone();
852
- end = currentPoint.clone();
853
- updateLine();
646
+ t.eventInput.addEventListener("codeChange", async () => {
647
+ if (t.eventInput.isKeyDown("mouse_0")) {
648
+ if (!n) {
649
+ n = h.clone(), o = h.clone(), c();
854
650
  return;
855
651
  }
856
- end = currentPoint.clone();
857
- points.push(start.clone(), end.clone());
858
- start.copy(end);
859
- updateLine();
860
- } else if (editor.eventInput.isOnlyKeyDowns(this.withdrawalKeys)) {
861
- if (points.length) {
862
- const { point } = editor.renderManager.adsorption();
863
- points.pop();
864
- end?.copy(point);
865
- start?.copy(points.pop());
866
- updateLine();
652
+ o = h.clone(), s.push(n.clone(), o.clone()), n.copy(o), c();
653
+ } else if (t.eventInput.isOnlyKeyDowns(this.withdrawalKeys)) {
654
+ if (s.length) {
655
+ const { point: w } = t.renderManager.adsorption();
656
+ s.pop(), o?.copy(w), n?.copy(s.pop()), c();
867
657
  }
868
- } else if (editor.eventInput.isKeyDowns(this.confirmKeys)) next(points);
658
+ } else t.eventInput.isKeyDowns(this.confirmKeys) && e(s);
869
659
  }),
870
660
  function() {
871
- line2.removeFromParent();
872
- circle.removeFromParent();
873
- auxiliaryLine.removeFromParent();
661
+ d.removeFromParent(), a.removeFromParent(), l.removeFromParent();
874
662
  }
875
663
  );
876
664
  }
877
665
  /** 结束, 汇总结果
878
666
  * @param points
879
667
  */
880
- end(next, points) {
881
- const lines = [];
882
- for (let i = 0; i < points.length; i += 2) {
883
- lines.push(new LineSegment(Point.from(points[i]), Point.from(points[i + 1])));
884
- }
885
- next(lines);
668
+ end(e, t) {
669
+ const n = [];
670
+ for (let o = 0; o < t.length; o += 2)
671
+ n.push(new ne(A.from(t[o]), A.from(t[o + 1])));
672
+ e(n);
886
673
  }
887
674
  /** 执行完成
888
675
  */
889
- completed(lines) {
890
- this.renderManager.addLines(lines);
891
- this.renderManager.draw();
676
+ completed(e) {
677
+ this.renderManager.addLines(e), this.renderManager.draw();
892
678
  }
893
679
  /** 回滚操作
894
680
  * @param data
895
681
  */
896
- rollback(lines) {
897
- lines.forEach((line2) => this.renderManager.removeLine(line2));
898
- this.renderManager.draw();
899
- return lines;
682
+ rollback(e) {
683
+ return e.forEach((t) => this.renderManager.removeLine(t)), this.renderManager.draw(), e;
900
684
  }
901
685
  /** 撤回回滚
902
686
  * @param lines
903
687
  * @returns
904
688
  */
905
- revokeRollback(lines) {
906
- this.completed(lines);
907
- return lines;
689
+ revokeRollback(e) {
690
+ return this.completed(e), e;
908
691
  }
909
692
  }
910
- class Default extends Component {
693
+ class ke extends ye {
911
694
  static name = "Default";
912
695
  get editor() {
913
696
  return this.parent?.findComponentByName("Editor");
914
697
  }
915
698
  renderer;
916
- container = new THREE.Group();
699
+ container = new m.Group();
917
700
  onAddFromParent() {
918
- const editor = this.editor, commandManager = editor.commandManager;
919
- this.renderer = this.parent?.findComponentByName("Renderer");
920
- editor.container.add(this.container);
921
- commandManager.addCommandFlow("default").add(this.start.bind(this)).addEventListener("finally", this.finally.bind(this));
922
- commandManager.addEventListener("startedBefore", (e) => {
923
- if (e.currentName === "default" && e.name !== "default") commandManager.cancel();
924
- });
925
- commandManager.addEventListener("finally", (e) => e.name !== "default" && commandManager.start("default"));
926
- editor.eventInput.addCancelDefaultBehavior(() => editor.eventInput.isOnlyKeyDowns(["control", "g"]));
701
+ const e = this.editor, t = e.commandManager;
702
+ this.renderer = this.parent?.findComponentByName("Renderer"), e.container.add(this.container), t.addCommandFlow("default").add(this.start.bind(this)).addEventListener("finally", this.finally.bind(this)), t.addEventListener("startedBefore", (n) => {
703
+ n.currentName === "default" && n.name !== "default" && t.cancel();
704
+ }), t.addEventListener("finally", (n) => n.name !== "default" && t.start("default")), e.eventInput.addCancelDefaultBehavior(() => e.eventInput.isOnlyKeyDowns(["control", "g"]));
927
705
  }
928
706
  selectLines = [];
929
- selectLineObject3D = new THREE.Mesh();
707
+ selectLineObject3D = new m.Mesh();
930
708
  /** 添加选择的线段
931
709
  * @param lineSegment
932
710
  */
933
- addSelectLine(lineSegment) {
934
- if (this.selectLines.indexOf(lineSegment) > -1) return;
935
- this.selectLines.push(lineSegment);
936
- this.updateSelectLinesGeometry();
937
- this.dispatchEvent({
711
+ addSelectLine(e) {
712
+ this.selectLines.indexOf(e) > -1 || (this.selectLines.push(e), this.updateSelectLinesGeometry(), this.dispatchEvent({
938
713
  type: "selectLineChange"
939
- });
714
+ }));
940
715
  }
941
716
  /** 移除选择的线段
942
717
  * @param lineSegment
943
718
  */
944
- removeSelectLine(lineSegment) {
945
- const i = this.selectLines.indexOf(lineSegment);
946
- if (i > -1) {
947
- this.selectLines.splice(i, 1);
948
- this.updateSelectLinesGeometry();
949
- this.dispatchEvent({
950
- type: "selectLineChange"
951
- });
952
- }
719
+ removeSelectLine(e) {
720
+ const t = this.selectLines.indexOf(e);
721
+ t > -1 && (this.selectLines.splice(t, 1), this.updateSelectLinesGeometry(), this.dispatchEvent({
722
+ type: "selectLineChange"
723
+ }));
953
724
  }
954
725
  /**
955
726
  * 移除所有选中线段
956
727
  */
957
728
  removeSelectLineAll() {
958
- this.selectLines.length = 0;
959
- this.dispatchEvent({
729
+ this.selectLines.length = 0, this.dispatchEvent({
960
730
  type: "selectLineChange"
961
731
  });
962
732
  }
@@ -965,14 +735,11 @@ class Default extends Component {
965
735
  * 更新选择的线段
966
736
  */
967
737
  updateSelectLinesGeometry() {
968
- if (this._timer) clearTimeout(this._timer);
969
- this._timer = setTimeout(() => {
738
+ this._timer && clearTimeout(this._timer), this._timer = setTimeout(() => {
970
739
  if (this.destroyed) return;
971
- if (this.selectLines.length) this.container.add(this.selectLineObject3D);
972
- else this.selectLineObject3D.removeFromParent();
973
- const editor = this.editor;
974
- const position = this.selectLines.flatMap((line2) => line2.expandToRectangle(0.04, "bothSides").createGeometry());
975
- this.selectLineObject3D.geometry = editor.renderManager.createGeometry({ position }, position.length / 3);
740
+ this.selectLines.length ? this.container.add(this.selectLineObject3D) : this.selectLineObject3D.removeFromParent();
741
+ const e = this.editor, t = this.selectLines.flatMap((n) => n.expandToRectangle(0.04, "bothSides").createGeometry());
742
+ this.selectLineObject3D.geometry = e.renderManager.createGeometry({ position: t }, t.length / 3);
976
743
  }, 10);
977
744
  }
978
745
  /**
@@ -980,95 +747,68 @@ class Default extends Component {
980
747
  * @param next
981
748
  */
982
749
  start() {
983
- const editor = this.editor, eventInput = editor.eventInput, object3D = new THREE.Mesh(), dom = editor.domContainer.domElement;
984
- let currentSelectLine = null;
985
- object3D.position.z = 0.01;
986
- this.selectLineObject3D.position.z = object3D.position.z + 0.01;
987
- object3D.material = new THREE.MeshBasicMaterial({ color: 55561 });
988
- const showSelectBox = () => {
989
- const startPoint = editor.pointerPosition.clone(), endPoint = editor.pointerPosition.clone(), mesh = new THREE.Mesh();
990
- this.container.add(mesh);
991
- mesh.position.z = 0.05;
992
- mesh.material = new THREE.MeshBasicMaterial({
750
+ const e = this.editor, t = e.eventInput, n = new m.Mesh(), o = e.domContainer.domElement;
751
+ let s = null;
752
+ n.position.z = 0.01, this.selectLineObject3D.position.z = n.position.z + 0.01, n.material = new m.MeshBasicMaterial({ color: 55561 });
753
+ const a = () => {
754
+ const i = e.pointerPosition.clone(), d = e.pointerPosition.clone(), l = new m.Mesh();
755
+ this.container.add(l), l.position.z = 0.05, l.material = new m.MeshBasicMaterial({
993
756
  color: 16777215,
994
- transparent: true,
757
+ transparent: !0,
995
758
  opacity: 0.5
996
759
  });
997
- const update = () => {
998
- const minX = Math.min(startPoint.x, endPoint.x), maxX = Math.max(startPoint.x, endPoint.x), minY = Math.min(startPoint.y, endPoint.y), maxY = Math.max(startPoint.y, endPoint.y);
999
- const position = [
1000
- minX,
1001
- maxY,
760
+ const c = () => {
761
+ const f = Math.min(i.x, d.x), C = Math.max(i.x, d.x), b = Math.min(i.y, d.y), P = Math.max(i.y, d.y), D = [
762
+ f,
763
+ P,
1002
764
  0,
1003
- maxX,
1004
- minY,
765
+ C,
766
+ b,
1005
767
  0,
1006
- maxX,
1007
- maxY,
768
+ C,
769
+ P,
1008
770
  0,
1009
- minX,
1010
- maxY,
771
+ f,
772
+ P,
1011
773
  0,
1012
- minX,
1013
- minY,
774
+ f,
775
+ b,
1014
776
  0,
1015
- maxX,
1016
- minY,
777
+ C,
778
+ b,
1017
779
  0
1018
780
  ];
1019
- mesh.geometry = editor.renderManager.createGeometry({ position }, position.length / 3);
1020
- };
1021
- const move = () => {
1022
- endPoint.copy(editor.pointerPosition);
1023
- update();
1024
- };
1025
- const end = () => {
1026
- document.removeEventListener("mousemove", move);
1027
- document.removeEventListener("mouseup", end);
1028
- mesh.removeFromParent();
1029
- const minX = Math.min(startPoint.x, endPoint.x), maxX = Math.max(startPoint.x, endPoint.x), minY = Math.min(startPoint.y, endPoint.y), maxY = Math.max(startPoint.y, endPoint.y);
1030
- const box = new Box2(minX, maxX, minY, maxY);
1031
- const resultList = editor.renderManager.quadtree.queryBox(box);
1032
- this.removeSelectLineAll();
1033
- resultList.forEach((result) => this.addSelectLine(result.line));
1034
- this.updateSelectLinesGeometry();
781
+ l.geometry = e.renderManager.createGeometry({ position: D }, D.length / 3);
782
+ }, h = () => {
783
+ d.copy(e.pointerPosition), c();
784
+ }, w = () => {
785
+ document.removeEventListener("mousemove", h), document.removeEventListener("mouseup", w), l.removeFromParent();
786
+ const f = Math.min(i.x, d.x), C = Math.max(i.x, d.x), b = Math.min(i.y, d.y), P = Math.max(i.y, d.y), D = new We(f, C, b, P), j = e.renderManager.quadtree.queryBox(D);
787
+ this.removeSelectLineAll(), j.forEach((se) => this.addSelectLine(se.line)), this.updateSelectLinesGeometry();
1035
788
  };
1036
- document.addEventListener("mousemove", move);
1037
- document.addEventListener("mouseup", end);
789
+ document.addEventListener("mousemove", h), document.addEventListener("mouseup", w);
1038
790
  };
1039
791
  this.addEventRecord(
1040
792
  "clear",
1041
793
  // 注册鼠标指针位置变化事件
1042
- editor.addEventListener("pointerPositionChange", () => {
1043
- const { line: line2 } = editor.renderManager.adsorption(0.05);
1044
- if (line2) {
1045
- const rectangle = line2.expandToRectangle(0.02, "bothSides");
1046
- object3D.geometry = editor.renderManager.createGeometry({ position: rectangle.createGeometry() }, 6);
1047
- this.container.add(object3D);
1048
- dom.style.cursor = "pointer";
1049
- currentSelectLine = line2;
1050
- } else {
1051
- object3D.removeFromParent();
1052
- dom.style.cursor = "default";
1053
- currentSelectLine = null;
1054
- }
794
+ e.addEventListener("pointerPositionChange", () => {
795
+ const { line: i } = e.renderManager.adsorption(0.05);
796
+ if (i) {
797
+ const d = i.expandToRectangle(0.02, "bothSides");
798
+ n.geometry = e.renderManager.createGeometry({ position: d.createGeometry() }, 6), this.container.add(n), o.style.cursor = "pointer", s = i;
799
+ } else
800
+ n.removeFromParent(), o.style.cursor = "default", s = null;
1055
801
  }),
1056
- eventInput.addEventListener("codeChange", () => {
1057
- if (eventInput.isKeyDown("mouse_0")) {
1058
- if (!currentSelectLine) return showSelectBox();
1059
- if (eventInput.isKeyDown("alt")) {
1060
- return this.removeSelectLine(currentSelectLine);
1061
- }
1062
- if (!eventInput.isKeyDown("control")) this.removeSelectLineAll();
1063
- this.addSelectLine(currentSelectLine);
1064
- } else if (eventInput.isKeyDowns(["control", "z"])) {
1065
- editor.commandManager.rollback();
1066
- } else if (eventInput.isKeyDowns(["control", "y"])) {
1067
- editor.commandManager.revokeRollback();
1068
- }
802
+ t.addEventListener("codeChange", () => {
803
+ if (t.isKeyDown("mouse_0")) {
804
+ if (!s) return a();
805
+ if (t.isKeyDown("alt"))
806
+ return this.removeSelectLine(s);
807
+ t.isKeyDown("control") || this.removeSelectLineAll(), this.addSelectLine(s);
808
+ } else t.isKeyDowns(["control", "z"]) ? e.commandManager.rollback() : t.isKeyDowns(["control", "y"]) && e.commandManager.revokeRollback();
1069
809
  }),
1070
810
  function() {
1071
- object3D.removeFromParent();
811
+ n.removeFromParent();
1072
812
  }
1073
813
  );
1074
814
  }
@@ -1076,50 +816,46 @@ class Default extends Component {
1076
816
  * 清理
1077
817
  */
1078
818
  finally() {
1079
- this.canceEventRecord("clear");
1080
- this.removeSelectLineAll();
1081
- this.updateSelectLinesGeometry();
819
+ this.canceEventRecord("clear"), this.removeSelectLineAll(), this.updateSelectLinesGeometry();
1082
820
  }
1083
821
  }
1084
- class CommandFlow extends EventDispatcher {
822
+ class un extends Ue {
1085
823
  list = [];
1086
824
  rollbacklist = [];
1087
825
  revokeRollbacklist = [];
826
+ // 是否写入操作记录
827
+ writeOperationList = !0;
1088
828
  /**
1089
829
  *
1090
830
  * @param operation
1091
831
  * @returns
1092
832
  */
1093
- add(operation) {
1094
- this.list.push(operation);
1095
- return this;
833
+ add(e) {
834
+ return this.list.push(e), this;
1096
835
  }
1097
836
  /** 添加回滚回调列表
1098
837
  * @param callBack
1099
838
  */
1100
- addRollback(callBack) {
1101
- this.rollbacklist.push(callBack);
1102
- return this;
839
+ addRollback(e) {
840
+ return this.rollbacklist.push(e), this;
1103
841
  }
1104
842
  /** 添加撤回回滚回调列表
1105
843
  * @param callBack
1106
844
  * @returns
1107
845
  */
1108
- addRevokeRollback(callBack) {
1109
- this.revokeRollbacklist.push(callBack);
1110
- return this;
846
+ addRevokeRollback(e) {
847
+ return this.revokeRollbacklist.push(e), this;
1111
848
  }
1112
849
  }
1113
- class CommandManager extends EventDispatcher {
850
+ class pn extends Ue {
1114
851
  commandFlowMap = /* @__PURE__ */ new Map();
1115
- lock = false;
852
+ lock = !1;
1116
853
  abortController = null;
1117
854
  resolve = null;
1118
855
  currentName = null;
1119
- _disabled = false;
1120
- set disabled(disabled) {
1121
- this._disabled = disabled;
1122
- if (this._disabled) this.cancel();
856
+ _disabled = !1;
857
+ set disabled(e) {
858
+ this._disabled = e, this._disabled && this.cancel();
1123
859
  }
1124
860
  get disabled() {
1125
861
  return this._disabled;
@@ -1136,11 +872,10 @@ class CommandManager extends EventDispatcher {
1136
872
  * @param name
1137
873
  * @returns
1138
874
  */
1139
- addCommandFlow(name) {
1140
- if (this.commandFlowMap.has(name)) throw new Error(`${name} 命令已经存在`);
1141
- const commandFlow = new CommandFlow();
1142
- this.commandFlowMap.set(name, commandFlow);
1143
- return commandFlow;
875
+ addCommandFlow(e) {
876
+ if (this.commandFlowMap.has(e)) throw new Error(`${e} 命令已经存在`);
877
+ const t = new un();
878
+ return this.commandFlowMap.set(e, t), t;
1144
879
  }
1145
880
  executionPromise = null;
1146
881
  executionResolve = null;
@@ -1148,94 +883,57 @@ class CommandManager extends EventDispatcher {
1148
883
  * @param name
1149
884
  * @returns
1150
885
  */
1151
- async start(name, data = null, step = 0) {
886
+ async start(e, t = null, n = 0) {
1152
887
  if (this.disabled) throw new Error("命令管理器已禁用,无法启动新的命令流");
1153
- this.dispatchEvent({
888
+ if (this.dispatchEvent({
1154
889
  type: "startedBefore",
1155
- name,
890
+ name: e,
1156
891
  currentName: this.currentName
1157
- });
1158
- this.executionPromise && await this.executionPromise;
1159
- this.executionPromise = null;
1160
- if (this.lock) {
892
+ }), this.executionPromise && await this.executionPromise, this.executionPromise = null, this.lock)
1161
893
  throw new Error("命令管理器已被 " + this.currentName + " 命令锁定,无法启动新的命令流,请退出或等待命令执行结束");
1162
- }
1163
- const commandFlow = this.commandFlowMap.get(name);
1164
- if (!commandFlow) {
1165
- throw new Error(`命令流 ${name} 不存在`);
1166
- }
1167
- this.lock = true;
1168
- this.abortController = new AbortController();
1169
- this.currentName = name;
1170
- commandFlow.dispatchEvent({ type: "started" });
1171
- this.dispatchEvent({ type: "started", name });
894
+ const o = this.commandFlowMap.get(e);
895
+ if (!o)
896
+ throw new Error(`命令流 ${e} 不存在`);
897
+ this.lock = !0, this.abortController = new AbortController(), this.currentName = e, o.dispatchEvent({ type: "started" }), this.dispatchEvent({ type: "started", name: e });
1172
898
  try {
1173
- for (let i = step; i < commandFlow.list.length; i++) {
1174
- const operation = commandFlow.list[i];
1175
- commandFlow.dispatchEvent({ type: "executing", index: i });
1176
- this.dispatchEvent({ type: "executing", name, index: i });
1177
- data = await new Promise((resolve) => {
1178
- this.resolve = resolve;
1179
- operation(resolve, data);
1180
- });
1181
- if (this.abortController.signal.aborted) {
1182
- commandFlow.dispatchEvent({ type: "executionInterrupt", index: i });
1183
- this.dispatchEvent({ type: "executionInterrupt", name, index: i });
1184
- this.dispatchEvent({ type: "cancel", name });
899
+ for (let s = n; s < o.list.length; s++) {
900
+ const a = o.list[s];
901
+ if (o.dispatchEvent({ type: "executing", index: s }), this.dispatchEvent({ type: "executing", name: e, index: s }), t = await new Promise((i) => {
902
+ this.resolve = i, a(i, t);
903
+ }), this.abortController.signal.aborted) {
904
+ o.dispatchEvent({ type: "executionInterrupt", index: s }), this.dispatchEvent({ type: "executionInterrupt", name: e, index: s }), this.dispatchEvent({ type: "cancel", name: e });
1185
905
  break;
1186
- } else {
1187
- commandFlow.dispatchEvent({ type: "executionCompleted", index: i, data });
1188
- this.dispatchEvent({ type: "executionCompleted", name, index: i, data });
1189
- }
906
+ } else
907
+ o.dispatchEvent({ type: "executionCompleted", index: s, data: t }), this.dispatchEvent({ type: "executionCompleted", name: e, index: s, data: t });
1190
908
  }
1191
- } catch (error) {
1192
- console.error(error);
909
+ } catch (s) {
910
+ console.error(s);
1193
911
  } finally {
1194
- if (this.abortController && !this.abortController.signal.aborted) {
1195
- commandFlow.dispatchEvent({ type: "completed", data });
1196
- this.dispatchEvent({ type: "completed", name, data });
1197
- this.operationList.push({ name, data });
1198
- this.rollbackList.length = 0;
1199
- }
1200
- this.lock = false;
1201
- this.abortController = null;
1202
- this.currentName = null;
1203
- commandFlow.dispatchEvent({ type: "finally" });
1204
- this.dispatchEvent({ type: "finally", name });
1205
- if (this.executionResolve) {
1206
- this.executionResolve(null);
1207
- this.executionResolve = null;
1208
- }
912
+ this.abortController && !this.abortController.signal.aborted && (o.dispatchEvent({ type: "completed", data: t }), this.dispatchEvent({ type: "completed", name: e, data: t }), o.writeOperationList && (this.operationList.push({ name: e, data: t }), this.rollbackList.length = 0)), this.lock = !1, this.abortController = null, this.currentName = null, o.dispatchEvent({ type: "finally" }), this.dispatchEvent({ type: "finally", name: e }), this.executionResolve && (this.executionResolve(null), this.executionResolve = null);
1209
913
  }
1210
- return data;
914
+ return t;
1211
915
  }
1212
916
  /** 取消当前命令
1213
917
  */
1214
918
  cancel() {
1215
- if (this.abortController) {
1216
- this.abortController.abort();
1217
- if (this.resolve) this.resolve();
1218
- this.executionPromise = new Promise((resolve) => this.executionResolve = resolve);
1219
- }
919
+ this.abortController && (this.abortController.abort(), this.resolve && this.resolve(), this.executionPromise = new Promise((e) => this.executionResolve = e));
1220
920
  }
1221
921
  /**
1222
922
  * 回滚
1223
923
  */
1224
924
  rollback() {
1225
925
  try {
1226
- const operation = this.operationList.pop();
1227
- if (!operation) return false;
1228
- const commandFlow = this.commandFlowMap.get(operation.name);
1229
- if (!commandFlow) return false;
1230
- const data = commandFlow.rollbacklist.reduce((data2, callBack) => callBack(data2), operation.data);
1231
- this.dispatchEvent({ type: "rollback", name: operation.name });
1232
- this.rollbackList.push({
1233
- data,
1234
- name: operation.name
1235
- });
1236
- return true;
1237
- } catch (error) {
1238
- throw new Error(`回滚失败:${error}`);
926
+ const e = this.operationList.pop();
927
+ if (!e) return !1;
928
+ const t = this.commandFlowMap.get(e.name);
929
+ if (!t) return !1;
930
+ const n = t.rollbacklist.reduce((o, s) => s(o), e.data);
931
+ return this.dispatchEvent({ type: "rollback", name: e.name }), this.rollbackList.push({
932
+ data: n,
933
+ name: e.name
934
+ }), !0;
935
+ } catch (e) {
936
+ throw new Error(`回滚失败:${e}`);
1239
937
  }
1240
938
  }
1241
939
  /**
@@ -1243,107 +941,73 @@ class CommandManager extends EventDispatcher {
1243
941
  */
1244
942
  revokeRollback() {
1245
943
  try {
1246
- const operation = this.rollbackList.pop();
1247
- if (!operation) return false;
1248
- const commandFlow = this.commandFlowMap.get(operation.name);
1249
- if (!commandFlow) return false;
1250
- const data = commandFlow.revokeRollbacklist.reduce((data2, callBack) => callBack(data2), operation.data);
1251
- this.dispatchEvent({ type: "revokeRollback", name: operation.name });
1252
- this.operationList.push({ name: operation.name, data });
1253
- return true;
1254
- } catch (error) {
1255
- throw new Error(`撤回回滚失败:${error}`);
944
+ const e = this.rollbackList.pop();
945
+ if (!e) return !1;
946
+ const t = this.commandFlowMap.get(e.name);
947
+ if (!t) return !1;
948
+ const n = t.revokeRollbacklist.reduce((o, s) => s(o), e.data);
949
+ return this.dispatchEvent({ type: "revokeRollback", name: e.name }), this.operationList.push({ name: e.name, data: n }), !0;
950
+ } catch (e) {
951
+ throw new Error(`撤回回滚失败:${e}`);
1256
952
  }
1257
953
  }
1258
954
  }
1259
- const connection = "data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M639.999191%20893.597594c-0.999994-54.699654-36.39977-101.099361-85.39946-118.399252-6.39996-2.199986-10.599933-8.299948-10.599933-14.999905V263.801573c0-6.699958%204.199973-12.799919%2010.599933-14.999905%2049.09969-17.299891%2084.399467-63.599598%2085.39946-118.399252C641.299183%2059.902862%20583.399549%200.503237%20512.899994%200.00324%20441.800444-0.496757%20384.000809%2057.00288%20384.000809%20128.002431c0%2055.699648%2035.599775%20103.099349%2085.299461%20120.699238%206.39996%202.299985%2010.699932%208.299948%2010.699932%2015.099904v496.396864c0%206.799957-4.299973%2012.799919-10.699932%2015.099904-49.699686%2017.599889-85.299461%2064.999589-85.299461%20120.699238%200%2070.999551%2057.799635%20128.499188%20128.899185%20127.999191%2070.499555-0.499997%20128.399189-59.899622%20127.099197-130.399176zM448.000404%20128.002431c0-35.299777%2028.699819-63.999596%2063.999596-63.999595s63.999596%2028.699819%2063.999596%2063.999595-28.699819%2063.999596-63.999596%2063.999596-63.999596-28.699819-63.999596-63.999596z%20m0%20767.995148c0-35.299777%2028.699819-63.999596%2063.999596-63.999596s63.999596%2028.699819%2063.999596%2063.999596-28.699819%2063.999596-63.999596%2063.999595-63.999596-28.699819-63.999596-63.999595z'%3e%3c/path%3e%3c/svg%3e";
1260
- const __vite_glob_0_0 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
955
+ const vn = "data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M639.999191%20893.597594c-0.999994-54.699654-36.39977-101.099361-85.39946-118.399252-6.39996-2.199986-10.599933-8.299948-10.599933-14.999905V263.801573c0-6.699958%204.199973-12.799919%2010.599933-14.999905%2049.09969-17.299891%2084.399467-63.599598%2085.39946-118.399252C641.299183%2059.902862%20583.399549%200.503237%20512.899994%200.00324%20441.800444-0.496757%20384.000809%2057.00288%20384.000809%20128.002431c0%2055.699648%2035.599775%20103.099349%2085.299461%20120.699238%206.39996%202.299985%2010.699932%208.299948%2010.699932%2015.099904v496.396864c0%206.799957-4.299973%2012.799919-10.699932%2015.099904-49.699686%2017.599889-85.299461%2064.999589-85.299461%20120.699238%200%2070.999551%2057.799635%20128.499188%20128.899185%20127.999191%2070.499555-0.499997%20128.399189-59.899622%20127.099197-130.399176zM448.000404%20128.002431c0-35.299777%2028.699819-63.999596%2063.999596-63.999595s63.999596%2028.699819%2063.999596%2063.999595-28.699819%2063.999596-63.999596%2063.999596-63.999596-28.699819-63.999596-63.999596z%20m0%20767.995148c0-35.299777%2028.699819-63.999596%2063.999596-63.999596s63.999596%2028.699819%2063.999596%2063.999596-28.699819%2063.999596-63.999596%2063.999595-63.999596-28.699819-63.999596-63.999595z'%3e%3c/path%3e%3c/svg%3e", fn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1261
956
  __proto__: null,
1262
- default: connection
1263
- }, Symbol.toStringTag, { value: "Module" }));
1264
- const deleteSelectLine = "data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M909.050991%20169.476903l-217.554898%200%200-31.346939c0-39.5866-32.205493-71.792093-71.793116-71.792093L408.15591%2066.337871c-39.5866%200-71.792093%2032.205493-71.792093%2071.792093l0%2031.346939L113.349581%20169.476903c-11.013845%200-19.942191%208.940626-19.942191%2019.954471s8.928347%2019.954471%2019.942191%2019.954471l84.264149%200%200%20640.687918c0%2060.479443%2049.203632%20109.683075%20109.683075%20109.683075l416.474366%200c60.479443%200%20109.683075-49.203632%20109.683075-109.683075L833.454246%20209.385844l75.595722%200c11.012821%200%2019.942191-8.940626%2019.942191-19.954471S920.063813%20169.476903%20909.050991%20169.476903zM376.2482%20138.130987c0-17.593703%2014.314007-31.907711%2031.907711-31.907711l211.547067%200c17.593703%200%2031.907711%2014.314007%2031.907711%2031.907711l0%2031.346939L376.2482%20169.477926%20376.2482%20138.130987zM793.569864%20850.074785c0%2038.486546-31.312146%2069.798692-69.798692%2069.798692L307.297828%20919.873478c-38.486546%200-69.798692-31.312146-69.798692-69.798692L237.499136%20211.042577l556.070728%200L793.569864%20850.074785zM510.662539%20861.276918c11.012821%200%2019.954471-8.92937%2019.954471-19.942191L530.61701%20294.912753c0-11.013845-8.94165-19.942191-19.954471-19.942191s-19.954471%208.928347-19.954471%2019.942191L490.708068%20841.334727C490.708068%20852.347548%20499.649717%20861.276918%20510.662539%20861.276918zM374.562814%20801.449321c11.012821%200%2019.954471-8.92937%2019.954471-19.942191L394.517285%20354.74035c0-11.013845-8.94165-19.942191-19.954471-19.942191s-19.954471%208.928347-19.954471%2019.942191l0%20426.76678C354.608344%20792.519951%20363.549993%20801.449321%20374.562814%20801.449321zM649.832182%20801.449321c11.012821%200%2019.954471-8.92937%2019.954471-19.942191L669.786653%20354.74035c0-11.013845-8.94165-19.942191-19.954471-19.942191s-19.954471%208.928347-19.954471%2019.942191l0%20426.76678C629.877711%20792.519951%20638.81936%20801.449321%20649.832182%20801.449321z'%20%3e%3c/path%3e%3c/svg%3e";
1265
- const __vite_glob_0_1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
957
+ default: vn
958
+ }, Symbol.toStringTag, { value: "Module" })), gn = "data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M909.050991%20169.476903l-217.554898%200%200-31.346939c0-39.5866-32.205493-71.792093-71.793116-71.792093L408.15591%2066.337871c-39.5866%200-71.792093%2032.205493-71.792093%2071.792093l0%2031.346939L113.349581%20169.476903c-11.013845%200-19.942191%208.940626-19.942191%2019.954471s8.928347%2019.954471%2019.942191%2019.954471l84.264149%200%200%20640.687918c0%2060.479443%2049.203632%20109.683075%20109.683075%20109.683075l416.474366%200c60.479443%200%20109.683075-49.203632%20109.683075-109.683075L833.454246%20209.385844l75.595722%200c11.012821%200%2019.942191-8.940626%2019.942191-19.954471S920.063813%20169.476903%20909.050991%20169.476903zM376.2482%20138.130987c0-17.593703%2014.314007-31.907711%2031.907711-31.907711l211.547067%200c17.593703%200%2031.907711%2014.314007%2031.907711%2031.907711l0%2031.346939L376.2482%20169.477926%20376.2482%20138.130987zM793.569864%20850.074785c0%2038.486546-31.312146%2069.798692-69.798692%2069.798692L307.297828%20919.873478c-38.486546%200-69.798692-31.312146-69.798692-69.798692L237.499136%20211.042577l556.070728%200L793.569864%20850.074785zM510.662539%20861.276918c11.012821%200%2019.954471-8.92937%2019.954471-19.942191L530.61701%20294.912753c0-11.013845-8.94165-19.942191-19.954471-19.942191s-19.954471%208.928347-19.954471%2019.942191L490.708068%20841.334727C490.708068%20852.347548%20499.649717%20861.276918%20510.662539%20861.276918zM374.562814%20801.449321c11.012821%200%2019.954471-8.92937%2019.954471-19.942191L394.517285%20354.74035c0-11.013845-8.94165-19.942191-19.954471-19.942191s-19.954471%208.928347-19.954471%2019.942191l0%20426.76678C354.608344%20792.519951%20363.549993%20801.449321%20374.562814%20801.449321zM649.832182%20801.449321c11.012821%200%2019.954471-8.92937%2019.954471-19.942191L669.786653%20354.74035c0-11.013845-8.94165-19.942191-19.954471-19.942191s-19.954471%208.928347-19.954471%2019.942191l0%20426.76678C629.877711%20792.519951%20638.81936%20801.449321%20649.832182%20801.449321z'%20%3e%3c/path%3e%3c/svg%3e", yn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1266
959
  __proto__: null,
1267
- default: deleteSelectLine
1268
- }, Symbol.toStringTag, { value: "Module" }));
1269
- const deleteSelectWindow = "data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M220.451548%20913.518482V318.145854c0-27.62038%2022.505495-50.125874%2050.125875-50.125874H865.95005c27.62038%200%2050.125874%2022.505495%2050.125874%2050.125874v218.917083h59.332667V318.145854c0-60.355644-49.102897-109.458541-109.458541-109.458541h-39.896104v-99.228772C826.053946%2049.102897%20776.951049%200%20716.595405%200H121.222777C60.867133%200%2011.764236%2049.102897%2011.764236%20109.458541V705.854146c0%2060.355644%2049.102897%20109.458541%20109.458541%20109.458541h39.896104v99.228772c0%2060.355644%2049.102897%20109.458541%20109.458542%20109.458541h257.790209v-59.332667H269.554446c-26.597403-1.022977-49.102897-23.528472-49.102898-51.148851z%20m-59.332667-595.372628v436.811189h-39.896104c-27.62038%200-50.125874-22.505495-50.125874-50.125874V109.458541c0-27.62038%2022.505495-50.125874%2050.125874-50.125874H716.595405c27.62038%200%2050.125874%2022.505495%2050.125874%2050.125874v99.228772H269.554446c-59.332667%200-108.435564%2049.102897-108.435565%20109.458541z'%20%3e%3c/path%3e%3cpath%20d='M902.777223%20854.185814l98.205794-98.205794c15.344655-15.344655%2015.344655-40.919081%200-56.263736s-40.919081-15.344655-56.263736%200L846.513487%20797.922078%20747.284715%20699.716284c-15.344655-15.344655-40.919081-15.344655-56.263736%200s-15.344655%2040.919081%200%2056.263736l98.205794%2098.205794-98.205794%2098.205794c-15.344655%2015.344655-15.344655%2040.919081%200%2056.263737s40.919081%2015.344655%2056.263736%200l98.205794-98.205795%2098.205795%2098.205795c15.344655%2015.344655%2040.919081%2015.344655%2056.263736%200s15.344655-40.919081%200-56.263737l-97.182817-98.205794z'%20%3e%3c/path%3e%3c/svg%3e";
1270
- const __vite_glob_0_2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
960
+ default: gn
961
+ }, Symbol.toStringTag, { value: "Module" })), wn = "data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M220.451548%20913.518482V318.145854c0-27.62038%2022.505495-50.125874%2050.125875-50.125874H865.95005c27.62038%200%2050.125874%2022.505495%2050.125874%2050.125874v218.917083h59.332667V318.145854c0-60.355644-49.102897-109.458541-109.458541-109.458541h-39.896104v-99.228772C826.053946%2049.102897%20776.951049%200%20716.595405%200H121.222777C60.867133%200%2011.764236%2049.102897%2011.764236%20109.458541V705.854146c0%2060.355644%2049.102897%20109.458541%20109.458541%20109.458541h39.896104v99.228772c0%2060.355644%2049.102897%20109.458541%20109.458542%20109.458541h257.790209v-59.332667H269.554446c-26.597403-1.022977-49.102897-23.528472-49.102898-51.148851z%20m-59.332667-595.372628v436.811189h-39.896104c-27.62038%200-50.125874-22.505495-50.125874-50.125874V109.458541c0-27.62038%2022.505495-50.125874%2050.125874-50.125874H716.595405c27.62038%200%2050.125874%2022.505495%2050.125874%2050.125874v99.228772H269.554446c-59.332667%200-108.435564%2049.102897-108.435565%20109.458541z'%20%3e%3c/path%3e%3cpath%20d='M902.777223%20854.185814l98.205794-98.205794c15.344655-15.344655%2015.344655-40.919081%200-56.263736s-40.919081-15.344655-56.263736%200L846.513487%20797.922078%20747.284715%20699.716284c-15.344655-15.344655-40.919081-15.344655-56.263736%200s-15.344655%2040.919081%200%2056.263736l98.205794%2098.205794-98.205794%2098.205794c-15.344655%2015.344655-15.344655%2040.919081%200%2056.263737s40.919081%2015.344655%2056.263736%200l98.205794-98.205795%2098.205795%2098.205795c15.344655%2015.344655%2040.919081%2015.344655%2056.263736%200s15.344655-40.919081%200-56.263737l-97.182817-98.205794z'%20%3e%3c/path%3e%3c/svg%3e", bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1271
962
  __proto__: null,
1272
- default: deleteSelectWindow
1273
- }, Symbol.toStringTag, { value: "Module" }));
1274
- const door = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1757902601497'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='9801'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M761.344%20119.296H226.816c-18.944%200-39.424%2011.776-39.424%2030.72V921.6h614.4V148.48c0.512-18.944-22.016-29.184-40.448-29.184z%20m-537.6%20768c-2.048%200-2.048%200%200%200L221.696%20163.84c0-5.12%205.12-10.24%2010.24-10.24h522.24c8.704%200%2013.824%205.12%2013.824%2013.824v720.384s0%201.536-1.536%201.536h-15.36V194.56c0-16.896-8.704-24.064-29.184-24.064H266.24c-18.944%200-27.136%208.704-27.136%2024.064v692.736h-15.36z%20m49.152%200V204.8H716.8v682.496H272.896z'%20p-id='9802'%3e%3c/path%3e%3cpath%20d='M648.704%20508.416c-16.896%200-32.256%2013.824-32.256%2032.256%200%2016.896%2013.824%2032.256%2032.256%2032.256s32.256-13.824%2032.256-32.256c0-16.896-13.824-32.256-32.256-32.256z'%20p-id='9803'%3e%3c/path%3e%3c/svg%3e";
1275
- const __vite_glob_0_3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
963
+ default: wn
964
+ }, Symbol.toStringTag, { value: "Module" })), xn = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1757902601497'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='9801'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M761.344%20119.296H226.816c-18.944%200-39.424%2011.776-39.424%2030.72V921.6h614.4V148.48c0.512-18.944-22.016-29.184-40.448-29.184z%20m-537.6%20768c-2.048%200-2.048%200%200%200L221.696%20163.84c0-5.12%205.12-10.24%2010.24-10.24h522.24c8.704%200%2013.824%205.12%2013.824%2013.824v720.384s0%201.536-1.536%201.536h-15.36V194.56c0-16.896-8.704-24.064-29.184-24.064H266.24c-18.944%200-27.136%208.704-27.136%2024.064v692.736h-15.36z%20m49.152%200V204.8H716.8v682.496H272.896z'%20p-id='9802'%3e%3c/path%3e%3cpath%20d='M648.704%20508.416c-16.896%200-32.256%2013.824-32.256%2032.256%200%2016.896%2013.824%2032.256%2032.256%2032.256s32.256-13.824%2032.256-32.256c0-16.896-13.824-32.256-32.256-32.256z'%20p-id='9803'%3e%3c/path%3e%3c/svg%3e", Cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1276
965
  __proto__: null,
1277
- default: door
1278
- }, Symbol.toStringTag, { value: "Module" }));
1279
- const intersectionConnection = "data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M491.80027198%20557.44938977c-10.0998647-15.14979706-20.19972802-25.24966037-35.34952507-35.34952507-15.14979706-10.0998647-30.29959271-15.14979706-50.49932211-15.14979704-55.54925309%200-100.99864286%2045.44938977-100.99864287%20100.99864285%200%2015.14979706%205.04993234%2035.34952507%2015.14979568%2050.49932212%2010.0998647%2015.14979706%2020.19972802%2030.29959271%2035.34952506%2035.34952508%2015.14979706%2010.0998647%2035.34952507%2015.14979706%2050.49932213%2015.14979567%2055.54925309%200%20100.99864286-45.44938977%20100.99864286-100.99864287%200-15.14979706-5.04993234-35.34952507-15.14979568-50.49932074z%20m-85.84884718%20100.99864286h-15.14979706c-20.19972802-5.04993234-30.29959271-20.19972802-35.34952507-35.34952507V612.99864286c0-30.29959271%2025.24966037-50.49932212%2050.49932213-50.49932074h10.09986469c15.14979706%205.04993234%2030.29959271%2015.14979706%2035.34952507%2035.34952507v15.14979567c5.04993234%2025.24966037-20.19972802%2045.44938977-45.44938976%2045.44938977z'%3e%3c/path%3e%3cpath%20d='M390.80162774%20658.44803263l-40.39945604%2040.39945743-227.24694747%20222.19701373-35.34952506-35.34952508%20227.24694745-227.24694608%2040.39945605-40.39945743c5.04993234%2020.19972802%2020.19972802%2035.34952507%2035.34952507%2040.39945743zM648.34816793%20405.9514248l-40.39945742%2040.3994574-116.14843853%20116.14843992-40.39945742%2035.34952507c-5.04993234-20.19972802-20.19972802-30.29959271-35.34952507-35.34952507l40.39945742-40.39945742%20116.14843853-111.09850756%2035.34952507-35.34952507c10.0998647%2015.14979706%2020.19972802%2025.24966037%2040.39945742%2030.29959273zM926.09443614%20133.25508894L749.34681078%20310.00271428l-40.3994574%2040.39945742c-5.04993234-20.19972802-15.14979706-35.34952507-30.29959272-40.39945742l35.34952506-40.39945742%20176.74762534-176.74762535%2035.34952508%2040.39945743z'%20%3e%3c/path%3e%3cpath%20d='M749.34681078%20310.00271428c-10.0998647-15.14979706-20.19972802-30.29959271-35.34952506-35.34952506-15.14979706-10.0998647-35.34952507-15.14979706-55.54925309-15.14979706-55.54925309%200-100.99864286%2045.44938977-100.99864286%20100.99864286%200%2020.19972802%205.04993234%2040.39945743%2015.14979567%2055.54925447%2010.0998647%2015.14979706%2020.19972802%2025.24966037%2035.34952507%2035.34952507%2015.14979706%2010.0998647%2030.29959271%2015.14979706%2050.49932212%2015.14979567%2055.54925309%200%20100.99864286-45.44938977%20100.99864286-100.99864286%200-25.24966037-5.04993234-40.39945743-10.09986471-55.54925309z%20m-90.89877815%2095.94871052h-10.0998647c-20.19972802-5.04993234-35.34952507-15.14979706-40.39945742-35.34952509%200-5.04993234-5.04993234-10.0998647-5.04993234-15.14979704%200-30.29959271%2025.24966037-50.49932212%2050.49932212-50.49932074%205.04993234%200%2010.0998647%200%2015.14979704%205.04993235%2015.14979706%205.04993234%2030.29959271%2020.19972802%2030.29959273%2040.39945742v10.09986332c10.0998647%2025.24966037-15.14979706%2045.44938977-40.39945743%2045.44938978z'%20%3e%3c/path%3e%3c/svg%3e";
1280
- const __vite_glob_0_4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
966
+ default: xn
967
+ }, Symbol.toStringTag, { value: "Module" })), Mn = "data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M491.80027198%20557.44938977c-10.0998647-15.14979706-20.19972802-25.24966037-35.34952507-35.34952507-15.14979706-10.0998647-30.29959271-15.14979706-50.49932211-15.14979704-55.54925309%200-100.99864286%2045.44938977-100.99864287%20100.99864285%200%2015.14979706%205.04993234%2035.34952507%2015.14979568%2050.49932212%2010.0998647%2015.14979706%2020.19972802%2030.29959271%2035.34952506%2035.34952508%2015.14979706%2010.0998647%2035.34952507%2015.14979706%2050.49932213%2015.14979567%2055.54925309%200%20100.99864286-45.44938977%20100.99864286-100.99864287%200-15.14979706-5.04993234-35.34952507-15.14979568-50.49932074z%20m-85.84884718%20100.99864286h-15.14979706c-20.19972802-5.04993234-30.29959271-20.19972802-35.34952507-35.34952507V612.99864286c0-30.29959271%2025.24966037-50.49932212%2050.49932213-50.49932074h10.09986469c15.14979706%205.04993234%2030.29959271%2015.14979706%2035.34952507%2035.34952507v15.14979567c5.04993234%2025.24966037-20.19972802%2045.44938977-45.44938976%2045.44938977z'%3e%3c/path%3e%3cpath%20d='M390.80162774%20658.44803263l-40.39945604%2040.39945743-227.24694747%20222.19701373-35.34952506-35.34952508%20227.24694745-227.24694608%2040.39945605-40.39945743c5.04993234%2020.19972802%2020.19972802%2035.34952507%2035.34952507%2040.39945743zM648.34816793%20405.9514248l-40.39945742%2040.3994574-116.14843853%20116.14843992-40.39945742%2035.34952507c-5.04993234-20.19972802-20.19972802-30.29959271-35.34952507-35.34952507l40.39945742-40.39945742%20116.14843853-111.09850756%2035.34952507-35.34952507c10.0998647%2015.14979706%2020.19972802%2025.24966037%2040.39945742%2030.29959273zM926.09443614%20133.25508894L749.34681078%20310.00271428l-40.3994574%2040.39945742c-5.04993234-20.19972802-15.14979706-35.34952507-30.29959272-40.39945742l35.34952506-40.39945742%20176.74762534-176.74762535%2035.34952508%2040.39945743z'%20%3e%3c/path%3e%3cpath%20d='M749.34681078%20310.00271428c-10.0998647-15.14979706-20.19972802-30.29959271-35.34952506-35.34952506-15.14979706-10.0998647-35.34952507-15.14979706-55.54925309-15.14979706-55.54925309%200-100.99864286%2045.44938977-100.99864286%20100.99864286%200%2020.19972802%205.04993234%2040.39945743%2015.14979567%2055.54925447%2010.0998647%2015.14979706%2020.19972802%2025.24966037%2035.34952507%2035.34952507%2015.14979706%2010.0998647%2030.29959271%2015.14979706%2050.49932212%2015.14979567%2055.54925309%200%20100.99864286-45.44938977%20100.99864286-100.99864286%200-25.24966037-5.04993234-40.39945743-10.09986471-55.54925309z%20m-90.89877815%2095.94871052h-10.0998647c-20.19972802-5.04993234-35.34952507-15.14979706-40.39945742-35.34952509%200-5.04993234-5.04993234-10.0998647-5.04993234-15.14979704%200-30.29959271%2025.24966037-50.49932212%2050.49932212-50.49932074%205.04993234%200%2010.0998647%200%2015.14979704%205.04993235%2015.14979706%205.04993234%2030.29959271%2020.19972802%2030.29959273%2040.39945742v10.09986332c10.0998647%2025.24966037-15.14979706%2045.44938977-40.39945743%2045.44938978z'%20%3e%3c/path%3e%3c/svg%3e", En = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1281
968
  __proto__: null,
1282
- default: intersectionConnection
1283
- }, Symbol.toStringTag, { value: "Module" }));
1284
- const line = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1757902422799'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='1735'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M843.2%20726.4c-20.2%200-39.2%205.2-55.8%2014.3L283.8%20237.2c9-16.5%2014.1-35.4%2014.1-55.5%200-64.2-52.3-116.5-116.5-116.5S65%20117.4%2065%20181.6s52.3%20116.5%20116.5%20116.5c20.2%200%2039.2-5.2%2055.8-14.2l503.5%20503.5c-9%2016.5-14.1%2035.4-14.1%2055.5%200%2064.2%2052.3%20116.5%20116.5%20116.5s116.5-52.3%20116.5-116.5-52.3-116.5-116.5-116.5zM181.4%20232.1c-27.8%200-50.5-22.6-50.5-50.5s22.6-50.5%2050.5-50.5%2050.5%2022.6%2050.5%2050.5-22.6%2050.5-50.5%2050.5z%20m661.8%20661.3c-27.8%200-50.5-22.6-50.5-50.5%200-27.8%2022.6-50.5%2050.5-50.5s50.5%2022.6%2050.5%2050.5c0%2027.8-22.7%2050.5-50.5%2050.5z'%20fill='%23231815'%20p-id='1736'%3e%3c/path%3e%3c/svg%3e";
1285
- const __vite_glob_0_5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
969
+ default: Mn
970
+ }, Symbol.toStringTag, { value: "Module" })), Ln = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1757902422799'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='1735'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M843.2%20726.4c-20.2%200-39.2%205.2-55.8%2014.3L283.8%20237.2c9-16.5%2014.1-35.4%2014.1-55.5%200-64.2-52.3-116.5-116.5-116.5S65%20117.4%2065%20181.6s52.3%20116.5%20116.5%20116.5c20.2%200%2039.2-5.2%2055.8-14.2l503.5%20503.5c-9%2016.5-14.1%2035.4-14.1%2055.5%200%2064.2%2052.3%20116.5%20116.5%20116.5s116.5-52.3%20116.5-116.5-52.3-116.5-116.5-116.5zM181.4%20232.1c-27.8%200-50.5-22.6-50.5-50.5s22.6-50.5%2050.5-50.5%2050.5%2022.6%2050.5%2050.5-22.6%2050.5-50.5%2050.5z%20m661.8%20661.3c-27.8%200-50.5-22.6-50.5-50.5%200-27.8%2022.6-50.5%2050.5-50.5s50.5%2022.6%2050.5%2050.5c0%2027.8-22.7%2050.5-50.5%2050.5z'%20fill='%23231815'%20p-id='1736'%3e%3c/path%3e%3c/svg%3e", _n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1286
971
  __proto__: null,
1287
- default: line
1288
- }, Symbol.toStringTag, { value: "Module" }));
1289
- const mergeLine = "data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M114.176%2046.528h618.496c37.312%200.064%2067.584%2030.336%2067.648%2067.648v618.56c0%2037.248-30.336%2067.584-67.648%2067.584H114.176A67.776%2067.776%200%200%201%2046.528%20732.8V114.176c0-37.312%2030.336-67.648%2067.648-67.648z%20m2.176%20686.208l616.32-2.24-2.176-616.32-614.144%202.176v616.32zM907.648%20291.2l2.176%20616.32H291.264a34.88%2034.88%200%201%200%200%2069.888h618.56c37.312%200%2067.648-30.336%2067.648-67.648V291.264a34.88%2034.88%200%201%200-69.824%200z'%20%3e%3c/path%3e%3c/svg%3e";
1290
- const __vite_glob_0_6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
972
+ default: Ln
973
+ }, Symbol.toStringTag, { value: "Module" })), Dn = "data:image/svg+xml,%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M114.176%2046.528h618.496c37.312%200.064%2067.584%2030.336%2067.648%2067.648v618.56c0%2037.248-30.336%2067.584-67.648%2067.584H114.176A67.776%2067.776%200%200%201%2046.528%20732.8V114.176c0-37.312%2030.336-67.648%2067.648-67.648z%20m2.176%20686.208l616.32-2.24-2.176-616.32-614.144%202.176v616.32zM907.648%20291.2l2.176%20616.32H291.264a34.88%2034.88%200%201%200%200%2069.888h618.56c37.312%200%2067.648-30.336%2067.648-67.648V291.264a34.88%2034.88%200%201%200-69.824%200z'%20%3e%3c/path%3e%3c/svg%3e", kn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1291
974
  __proto__: null,
1292
- default: mergeLine
1293
- }, Symbol.toStringTag, { value: "Module" }));
1294
- const revokeRollback = "data:image/svg+xml,%3csvg%20viewBox='0%200%201029%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M788.17984%2016l-55.424%2060.672%20116.48%20106.56H418.13184a410.816%20410.816%200%201%200%200%20821.632h547.712v-82.176H418.13184a328.64%20328.64%200%200%201%200-657.28l441.792-0.128-124.8%2098.368%2050.752%2064.512%20243.328-191.488L788.17984%2016z'%3e%3c/path%3e%3c/svg%3e";
1295
- const __vite_glob_0_7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
975
+ default: Dn
976
+ }, Symbol.toStringTag, { value: "Module" })), Pn = "data:image/svg+xml,%3csvg%20viewBox='0%200%201029%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M788.17984%2016l-55.424%2060.672%20116.48%20106.56H418.13184a410.816%20410.816%200%201%200%200%20821.632h547.712v-82.176H418.13184a328.64%20328.64%200%200%201%200-657.28l441.792-0.128-124.8%2098.368%2050.752%2064.512%20243.328-191.488L788.17984%2016z'%3e%3c/path%3e%3c/svg%3e", In = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1296
977
  __proto__: null,
1297
- default: revokeRollback
1298
- }, Symbol.toStringTag, { value: "Module" }));
1299
- const rollback = "data:image/svg+xml,%3csvg%20viewBox='0%200%201048%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M310.04722%20451.334244A49.95122%2049.95122%200%200%201%20239.416195%20521.990244L27.473171%20310.04722a49.95122%2049.95122%200%200%201%200-70.631025L239.416195%2027.473171a49.95122%2049.95122%200%200%201%2070.631025%2070.631024l-126.651318%20126.626342L649.365854%20224.780488c220.709463%200%20399.609756%20178.900293%20399.609756%20399.609756s-178.900293%20399.609756-399.609756%20399.609756H124.878049a49.95122%2049.95122%200%201%201%200-99.902439h524.487805c165.513366%200%20299.707317-134.193951%20299.707317-299.707317s-134.193951-299.707317-299.707317-299.707317H183.395902l126.651318%20126.651317z'%3e%3c/path%3e%3c/svg%3e";
1300
- const __vite_glob_0_8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
978
+ default: Pn
979
+ }, Symbol.toStringTag, { value: "Module" })), Sn = "data:image/svg+xml,%3csvg%20viewBox='0%200%201048%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M310.04722%20451.334244A49.95122%2049.95122%200%200%201%20239.416195%20521.990244L27.473171%20310.04722a49.95122%2049.95122%200%200%201%200-70.631025L239.416195%2027.473171a49.95122%2049.95122%200%200%201%2070.631025%2070.631024l-126.651318%20126.626342L649.365854%20224.780488c220.709463%200%20399.609756%20178.900293%20399.609756%20399.609756s-178.900293%20399.609756-399.609756%20399.609756H124.878049a49.95122%2049.95122%200%201%201%200-99.902439h524.487805c165.513366%200%20299.707317-134.193951%20299.707317-299.707317s-134.193951-299.707317-299.707317-299.707317H183.395902l126.651318%20126.651317z'%3e%3c/path%3e%3c/svg%3e", Nn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1301
980
  __proto__: null,
1302
- default: rollback
1303
- }, Symbol.toStringTag, { value: "Module" }));
1304
- const selectAll = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='11576'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M102.4%20302.08c5.12%205.12%2015.36%2010.24%2025.6%2010.24s15.36-5.12%2025.6-10.24l174.08-174.08c5.12-5.12%2010.24-15.36%2010.24-25.6s-5.12-15.36-10.24-25.6c-20.48-5.12-40.96-5.12-51.2%2010.24l-148.48%20153.6-71.68-76.8C51.2%20158.72%2040.96%20158.72%2035.84%20158.72c-10.24%200-15.36%205.12-25.6%2010.24-5.12%205.12-10.24%2010.24-10.24%2020.48s5.12%2015.36%2010.24%2025.6L102.4%20302.08zM276.48%20409.6l-148.48%20153.6-71.68-71.68C51.2%20486.4%2040.96%20481.28%2035.84%20481.28c-10.24%200-15.36%205.12-25.6%2010.24-5.12%2010.24-10.24%2015.36-10.24%2025.6s5.12%2015.36%2010.24%2025.6L102.4%20629.76c5.12%205.12%2015.36%2010.24%2025.6%2010.24s15.36-5.12%2025.6-10.24L322.56%20460.8c5.12-5.12%2010.24-15.36%2010.24-25.6s-5.12-15.36-10.24-25.6c-10.24-10.24-30.72-10.24-46.08%200z%20m0%20327.68l-148.48%20153.6L56.32%20819.2c-5.12-5.12-15.36-10.24-25.6-10.24s-15.36%205.12-25.6%2010.24c0%205.12-5.12%2015.36-5.12%2025.6s5.12%2015.36%2010.24%2025.6L102.4%20957.44c5.12%205.12%2015.36%2010.24%2025.6%2010.24h5.12c10.24%200%2015.36-5.12%2025.6-10.24l174.08-174.08c5.12-5.12%2010.24-15.36%2010.24-25.6s-5.12-15.36-10.24-25.6c-25.6-5.12-40.96-5.12-56.32%205.12zM1024%20153.6c0%2030.72-25.6%2056.32-56.32%2056.32h-460.8c-30.72%200-61.44-25.6-61.44-56.32%200-30.72%2025.6-56.32%2056.32-56.32h455.68c35.84-5.12%2066.56%2020.48%2066.56%2056.32z%20m0%20358.4c0%2030.72-25.6%2056.32-56.32%2056.32h-460.8c-30.72%200-56.32-25.6-56.32-56.32s25.6-56.32%2056.32-56.32h455.68c35.84%200%2061.44%2025.6%2061.44%2056.32z%20m-5.12%20358.4c0%2030.72-25.6%2056.32-56.32%2056.32h-460.8c-30.72%200-56.32-25.6-56.32-56.32%200-30.72%2025.6-56.32%2056.32-56.32h455.68c35.84%200%2061.44%2025.6%2061.44%2056.32z%20m0%200'%20%3e%3c/path%3e%3c/svg%3e";
1305
- const __vite_glob_0_9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
981
+ default: Sn
982
+ }, Symbol.toStringTag, { value: "Module" })), On = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='11576'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M102.4%20302.08c5.12%205.12%2015.36%2010.24%2025.6%2010.24s15.36-5.12%2025.6-10.24l174.08-174.08c5.12-5.12%2010.24-15.36%2010.24-25.6s-5.12-15.36-10.24-25.6c-20.48-5.12-40.96-5.12-51.2%2010.24l-148.48%20153.6-71.68-76.8C51.2%20158.72%2040.96%20158.72%2035.84%20158.72c-10.24%200-15.36%205.12-25.6%2010.24-5.12%205.12-10.24%2010.24-10.24%2020.48s5.12%2015.36%2010.24%2025.6L102.4%20302.08zM276.48%20409.6l-148.48%20153.6-71.68-71.68C51.2%20486.4%2040.96%20481.28%2035.84%20481.28c-10.24%200-15.36%205.12-25.6%2010.24-5.12%2010.24-10.24%2015.36-10.24%2025.6s5.12%2015.36%2010.24%2025.6L102.4%20629.76c5.12%205.12%2015.36%2010.24%2025.6%2010.24s15.36-5.12%2025.6-10.24L322.56%20460.8c5.12-5.12%2010.24-15.36%2010.24-25.6s-5.12-15.36-10.24-25.6c-10.24-10.24-30.72-10.24-46.08%200z%20m0%20327.68l-148.48%20153.6L56.32%20819.2c-5.12-5.12-15.36-10.24-25.6-10.24s-15.36%205.12-25.6%2010.24c0%205.12-5.12%2015.36-5.12%2025.6s5.12%2015.36%2010.24%2025.6L102.4%20957.44c5.12%205.12%2015.36%2010.24%2025.6%2010.24h5.12c10.24%200%2015.36-5.12%2025.6-10.24l174.08-174.08c5.12-5.12%2010.24-15.36%2010.24-25.6s-5.12-15.36-10.24-25.6c-25.6-5.12-40.96-5.12-56.32%205.12zM1024%20153.6c0%2030.72-25.6%2056.32-56.32%2056.32h-460.8c-30.72%200-61.44-25.6-61.44-56.32%200-30.72%2025.6-56.32%2056.32-56.32h455.68c35.84-5.12%2066.56%2020.48%2066.56%2056.32z%20m0%20358.4c0%2030.72-25.6%2056.32-56.32%2056.32h-460.8c-30.72%200-56.32-25.6-56.32-56.32s25.6-56.32%2056.32-56.32h455.68c35.84%200%2061.44%2025.6%2061.44%2056.32z%20m-5.12%20358.4c0%2030.72-25.6%2056.32-56.32%2056.32h-460.8c-30.72%200-56.32-25.6-56.32-56.32%200-30.72%2025.6-56.32%2056.32-56.32h455.68c35.84%200%2061.44%2025.6%2061.44%2056.32z%20m0%200'%20%3e%3c/path%3e%3c/svg%3e", Rn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1306
983
  __proto__: null,
1307
- default: selectAll
1308
- }, Symbol.toStringTag, { value: "Module" }));
1309
- const selectPoint = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1757902488735'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='3957'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M520.416%20179.392c-12.384%200-22.4%204.672-22.4%2010.432l-0.032%20139.136c0%205.76%2010.016%2010.432%2022.368%2010.432%2012.352%200%2022.368-4.672%2022.368-10.432l0.064-139.136c0-5.76-10.016-10.432-22.4-10.432M520.32%20623.04c-12.352%200-22.368%204.64-22.368%2010.4l-0.032%20139.168c0%205.76%2010.016%2010.432%2022.368%2010.432%2012.352%200%2022.368-4.672%2022.368-10.432l0.064-139.168c0-5.76-10.016-10.4-22.4-10.4M800.256%20458.72l-139.168-0.064c-5.76%200-10.432%2010.016-10.432%2022.4%200%2012.352%204.672%2022.368%2010.432%2022.368l139.168%200.032c5.76%200%2010.4-10.016%2010.4-22.368%200-12.352-4.64-22.368-10.4-22.4zM352.256%20458.72l-139.168-0.064c-5.76%200-10.432%2010.016-10.432%2022.4%200%2012.352%204.672%2022.368%2010.432%2022.368l139.168%200.032c5.76%200%2010.4-10.016%2010.4-22.368%200-12.352-4.64-22.368-10.4-22.4M801.568%20748.672l-72.544-72.544%2073.792-23.2a4.416%204.416%200%200%200%200.096-8.384l-183.136-62.4a4.416%204.416%200%200%200-5.6%205.568l62.464%20183.168a4.416%204.416%200%200%200%208.352-0.064l23.36-73.6%2072.32%2072.32a14.752%2014.752%200%200%200%2020.896-20.864M510.688%20382.112c49.952%200%2092.8%2040.832%2092.8%2092.8%200%2051.968-42.848%2092.8-92.8%2092.8-49.984%200-92.8-40.832-92.8-92.8%200-51.968%2042.816-92.8%2092.8-92.8z'%20p-id='3958'%3e%3c/path%3e%3c/svg%3e";
1310
- const __vite_glob_0_10 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
984
+ default: On
985
+ }, Symbol.toStringTag, { value: "Module" })), zn = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1757902488735'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='3957'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M520.416%20179.392c-12.384%200-22.4%204.672-22.4%2010.432l-0.032%20139.136c0%205.76%2010.016%2010.432%2022.368%2010.432%2012.352%200%2022.368-4.672%2022.368-10.432l0.064-139.136c0-5.76-10.016-10.432-22.4-10.432M520.32%20623.04c-12.352%200-22.368%204.64-22.368%2010.4l-0.032%20139.168c0%205.76%2010.016%2010.432%2022.368%2010.432%2012.352%200%2022.368-4.672%2022.368-10.432l0.064-139.168c0-5.76-10.016-10.4-22.4-10.4M800.256%20458.72l-139.168-0.064c-5.76%200-10.432%2010.016-10.432%2022.4%200%2012.352%204.672%2022.368%2010.432%2022.368l139.168%200.032c5.76%200%2010.4-10.016%2010.4-22.368%200-12.352-4.64-22.368-10.4-22.4zM352.256%20458.72l-139.168-0.064c-5.76%200-10.432%2010.016-10.432%2022.4%200%2012.352%204.672%2022.368%2010.432%2022.368l139.168%200.032c5.76%200%2010.4-10.016%2010.4-22.368%200-12.352-4.64-22.368-10.4-22.4M801.568%20748.672l-72.544-72.544%2073.792-23.2a4.416%204.416%200%200%200%200.096-8.384l-183.136-62.4a4.416%204.416%200%200%200-5.6%205.568l62.464%20183.168a4.416%204.416%200%200%200%208.352-0.064l23.36-73.6%2072.32%2072.32a14.752%2014.752%200%200%200%2020.896-20.864M510.688%20382.112c49.952%200%2092.8%2040.832%2092.8%2092.8%200%2051.968-42.848%2092.8-92.8%2092.8-49.984%200-92.8-40.832-92.8-92.8%200-51.968%2042.816-92.8%2092.8-92.8z'%20p-id='3958'%3e%3c/path%3e%3c/svg%3e", Bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1311
986
  __proto__: null,
1312
- default: selectPoint
1313
- }, Symbol.toStringTag, { value: "Module" }));
1314
- const verticalCorrection = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='10587'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M64.21%20703.88h888.34M64.21%20667.88h888.34v72H64.21z'%3e%3c/path%3e%3cpath%20d='M509.58%20102.72v566.13M473.58%20102.72h72v566.14h-72z'%3e%3c/path%3e%3c/svg%3e";
1315
- const __vite_glob_0_11 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
987
+ default: zn
988
+ }, Symbol.toStringTag, { value: "Module" })), Fn = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='10587'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20fill='%23555'%20width='16'%20height='16'%3e%3cpath%20d='M64.21%20703.88h888.34M64.21%20667.88h888.34v72H64.21z'%3e%3c/path%3e%3cpath%20d='M509.58%20102.72v566.13M473.58%20102.72h72v566.14h-72z'%3e%3c/path%3e%3c/svg%3e", Kn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1316
989
  __proto__: null,
1317
- default: verticalCorrection
1318
- }, Symbol.toStringTag, { value: "Module" }));
1319
- const window$1 = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1757902547951'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='5129'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M59.355%2091.776v867.881h867.881V91.776H59.356zM897.31%20929.73H89.282V121.703h808.027V929.73z'%20fill=''%20p-id='5130'%3e%3c/path%3e%3cpath%20d='M833.964%20185.048H152.627v681.337h681.337V185.048z%20m-355.632%20651.41H182.554V532.2h295.778v304.257z%20m0-334.184H182.554V214.975h295.778v287.299z%20m325.705%20334.184H508.259V532.2h295.778v304.257z%20m0-334.184H508.259V214.975h295.778v287.299z'%20fill=''%20p-id='5131'%3e%3c/path%3e%3c/svg%3e";
1320
- const __vite_glob_0_12 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
990
+ default: Fn
991
+ }, Symbol.toStringTag, { value: "Module" })), Tn = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1757902547951'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='5129'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M59.355%2091.776v867.881h867.881V91.776H59.356zM897.31%20929.73H89.282V121.703h808.027V929.73z'%20fill=''%20p-id='5130'%3e%3c/path%3e%3cpath%20d='M833.964%20185.048H152.627v681.337h681.337V185.048z%20m-355.632%20651.41H182.554V532.2h295.778v304.257z%20m0-334.184H182.554V214.975h295.778v287.299z%20m325.705%20334.184H508.259V532.2h295.778v304.257z%20m0-334.184H508.259V214.975h295.778v287.299z'%20fill=''%20p-id='5131'%3e%3c/path%3e%3c/svg%3e", Vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1321
992
  __proto__: null,
1322
- default: window$1
993
+ default: Tn
1323
994
  }, Symbol.toStringTag, { value: "Module" }));
1324
- class RenderManager extends Component {
995
+ class An extends ye {
1325
996
  static name = "RenderManager";
1326
- container = new THREE.Group();
997
+ container = new m.Group();
1327
998
  lines = [];
1328
- pointVirtualGrid = new PointVirtualGrid();
1329
- quadtree = new Quadtree(new Box2());
999
+ pointVirtualGrid = new Re();
1000
+ quadtree = new ze(new We());
1330
1001
  actionHistory = /* @__PURE__ */ new Set();
1331
1002
  onAddFromParent() {
1332
- const dxfLineModel = this.dxfLineModel;
1333
- this.editor.container.add(this.container);
1334
- this.editor.container.add(dxfLineModel.dxfModelGroup);
1335
- dxfLineModel.dxfLineModel.material = new THREE.LineBasicMaterial({
1336
- transparent: true,
1003
+ const e = this.dxfLineModel;
1004
+ this.editor.container.add(this.container), this.editor.container.add(e.dxfModelGroup), e.dxfLineModel.material = new m.LineBasicMaterial({
1005
+ transparent: !0,
1337
1006
  opacity: 0.5,
1338
1007
  color: 16777215
1339
- });
1340
- dxfLineModel.addEventListener("modelUpdate", (e) => {
1341
- e.model.position.z = 0;
1342
- dxfLineModel.dxfDoorsLineModel.visible = false;
1343
- });
1344
- this.variable.addEventListener("dxfVisible", (e) => dxfLineModel.dxfModelGroup.visible = e.value);
1345
- this.dxf.addEventListener("createGroup", () => this.reset());
1346
- this.reset();
1008
+ }), e.addEventListener("modelUpdate", (t) => {
1009
+ t.model.position.z = 0, e.dxfDoorsLineModel.visible = !1;
1010
+ }), this.variable.addEventListener("dxfVisible", (t) => e.dxfModelGroup.visible = t.value), this.dxf.addEventListener("createGroup", () => this.reset()), this.reset();
1347
1011
  }
1348
1012
  updatedMode = null;
1349
1013
  /** 重新设置数据
@@ -1352,184 +1016,145 @@ class RenderManager extends Component {
1352
1016
  if (this.updatedMode === "self") {
1353
1017
  this.updatedMode = null;
1354
1018
  return;
1355
- } else {
1019
+ } else
1356
1020
  this.updatedMode = "dxf";
1357
- }
1358
- this.pointVirtualGrid = new PointVirtualGrid();
1359
- const box = this.dxf.box.clone().expansion(Math.max(this.dxf.box.width, this.dxf.box.height) * 2);
1360
- if (box.width === 0 || box.height === 0) box.set(-200, -200, 200, 200);
1361
- this.quadtree = new Quadtree(box);
1362
- this.lines.length = 0;
1363
- this.dxf.lineSegments.forEach((line2) => {
1364
- if (line2.userData.isDoor && !line2.userData.doorDirectConnection) return;
1365
- this.addLine(line2.clone());
1366
- });
1367
- this.dxf.doorLineSegment.forEach((line2) => {
1368
- const door2 = line2.clone();
1369
- door2.userData = {
1370
- isDoor: true,
1371
- doorDirectConnection: true
1372
- };
1373
- this.addLine(door2);
1374
- });
1375
- this.draw();
1021
+ this.pointVirtualGrid = new Re();
1022
+ const e = this.dxf.box.clone().expansion(Math.max(this.dxf.box.width, this.dxf.box.height) * 2);
1023
+ (e.width === 0 || e.height === 0) && e.set(-200, -200, 200, 200), this.quadtree = new ze(e), this.lines.length = 0, this.dxf.lineSegments.forEach((t) => {
1024
+ t.userData.isDoor && !t.userData.doorDirectConnection || this.addLine(t.clone());
1025
+ }), this.dxf.doorLineSegment.forEach((t) => {
1026
+ const n = t.clone();
1027
+ n.userData = {
1028
+ isDoor: !0,
1029
+ doorDirectConnection: !0
1030
+ }, this.addLine(n);
1031
+ }), this.draw();
1376
1032
  }
1377
1033
  /** 添加线段
1378
1034
  * @param line
1379
1035
  */
1380
- addLine(line2) {
1381
- if (!line2.userData) line2.userData = {};
1382
- this.lines.push(line2);
1383
- this.pointVirtualGrid.insert(line2.start, line2);
1384
- this.pointVirtualGrid.insert(line2.end, line2);
1385
- const quadtreeNode = {
1386
- line: line2,
1036
+ addLine(e) {
1037
+ e.userData || (e.userData = {}), this.lines.push(e), this.pointVirtualGrid.insert(e.start, e), this.pointVirtualGrid.insert(e.end, e);
1038
+ const t = {
1039
+ line: e,
1387
1040
  userData: void 0
1388
1041
  };
1389
- line2.userData.quadtreeNode = quadtreeNode;
1390
- this.quadtree.insert(quadtreeNode);
1391
- this.actionHistory.add({
1042
+ e.userData.quadtreeNode = t, this.quadtree.insert(t), this.actionHistory.add({
1392
1043
  type: "addLine",
1393
- data: [line2]
1044
+ data: [e]
1394
1045
  });
1395
1046
  }
1396
1047
  /**
1397
1048
  * 批量添加
1398
1049
  * @param lines
1399
1050
  */
1400
- addLines(lines) {
1401
- for (let i = 0; i < lines.length; i++) {
1402
- const line2 = lines[i];
1403
- this.lines.push(line2);
1404
- this.pointVirtualGrid.insert(line2.start, line2);
1405
- this.pointVirtualGrid.insert(line2.end, line2);
1406
- const quadtreeNode = {
1407
- line: line2,
1051
+ addLines(e) {
1052
+ for (let t = 0; t < e.length; t++) {
1053
+ const n = e[t];
1054
+ this.lines.push(n), this.pointVirtualGrid.insert(n.start, n), this.pointVirtualGrid.insert(n.end, n);
1055
+ const o = {
1056
+ line: n,
1408
1057
  userData: void 0
1409
1058
  };
1410
- line2.userData.quadtreeNode = quadtreeNode;
1411
- this.quadtree.insert(quadtreeNode);
1059
+ n.userData.quadtreeNode = o, this.quadtree.insert(o);
1412
1060
  }
1413
1061
  this.actionHistory.add({
1414
1062
  type: "addLine",
1415
- data: [...lines]
1063
+ data: [...e]
1416
1064
  });
1417
1065
  }
1418
1066
  /** 移除线段
1419
1067
  * @param line
1420
1068
  */
1421
- removeLine(line2) {
1422
- line2.userData.quadtreeNode && this.quadtree.remove(line2.userData.quadtreeNode);
1423
- this.pointVirtualGrid.remove(line2.start);
1424
- this.pointVirtualGrid.remove(line2.end);
1425
- const index = this.lines.indexOf(line2);
1426
- this.lines.splice(index, 1);
1427
- this.draw();
1428
- this.actionHistory.add({
1069
+ removeLine(e) {
1070
+ e.userData.quadtreeNode && this.quadtree.remove(e.userData.quadtreeNode), this.pointVirtualGrid.remove(e.start), this.pointVirtualGrid.remove(e.end);
1071
+ const t = this.lines.indexOf(e);
1072
+ this.lines.splice(t, 1), this.draw(), this.actionHistory.add({
1429
1073
  type: "removeLine",
1430
- data: [line2]
1074
+ data: [e]
1431
1075
  });
1432
1076
  }
1433
1077
  /**
1434
1078
  * 绘制
1435
1079
  */
1436
- draw(synchronize = true) {
1080
+ draw(e = !0) {
1437
1081
  this.container.clear();
1438
- const position = [], doorPosition = [], windowPosition = [];
1439
- this.lines.forEach((line2) => {
1440
- line2.points.forEach((p) => {
1441
- if (line2.userData.isDoor) doorPosition.push(p.x, p.y, 0);
1442
- else position.push(p.x, p.y, 0);
1082
+ const t = [], n = [], o = [];
1083
+ this.lines.forEach((s) => {
1084
+ s.points.forEach((a) => {
1085
+ s.userData.isDoor ? n.push(a.x, a.y, 0) : t.push(a.x, a.y, 0);
1086
+ }), s.userData.isWindow && s.userData.drawDoorData && s.userData.drawDoorData.forEach(({ width: a, p: i }) => {
1087
+ const d = A.from(i), l = s.direction(), c = d.clone().add(l.clone().multiplyScalar(a * 0.5)), h = d.clone().add(l.clone().multiplyScalar(-a * 0.5));
1088
+ o.push(c.x, c.y, 1e-3), o.push(h.x, h.y, 1e-3);
1443
1089
  });
1444
- if (line2.userData.isWindow && line2.userData.drawDoorData) {
1445
- line2.userData.drawDoorData.forEach(({ width, p }) => {
1446
- const center = Point.from(p), direction = line2.direction(), start = center.clone().add(direction.clone().multiplyScalar(width * 0.5)), end = center.clone().add(direction.clone().multiplyScalar(-width * 0.5));
1447
- windowPosition.push(start.x, start.y, 1e-3);
1448
- windowPosition.push(end.x, end.y, 1e-3);
1449
- });
1450
- }
1451
- });
1452
- position.length && this.renderer.createLineSegments({
1453
- position
1454
- }, position.length / 3, {
1090
+ }), t.length && this.renderer.createLineSegments({
1091
+ position: t
1092
+ }, t.length / 3, {
1455
1093
  color: 5745151
1456
- }, this.container);
1457
- doorPosition.length && this.renderer.createLineSegments({
1458
- position: doorPosition
1459
- }, doorPosition.length / 3, {
1094
+ }, this.container), n.length && this.renderer.createLineSegments({
1095
+ position: n
1096
+ }, n.length / 3, {
1460
1097
  color: 16776960
1461
- }, this.container);
1462
- windowPosition.length && this.renderer.createLineSegments({
1463
- position: windowPosition
1464
- }, windowPosition.length / 3, {
1098
+ }, this.container), o.length && this.renderer.createLineSegments({
1099
+ position: o
1100
+ }, o.length / 3, {
1465
1101
  color: 16711935
1466
- }, this.container);
1467
- synchronize && this.synchronizeDxf();
1102
+ }, this.container), e && this.synchronizeDxf();
1468
1103
  }
1469
1104
  /** 获取鼠标当前点, 吸附后的点
1470
1105
  * @param point
1471
1106
  * @returns
1472
1107
  */
1473
- adsorption(radius = 0.1, pointVirtualGrid = this.pointVirtualGrid, quadtree = this.quadtree) {
1474
- const editor = this.parent?.findComponentByName("Editor"), point = Point.from(editor.pointerPosition);
1475
- const p = pointVirtualGrid.queryCircle(point, radius).sort((a, b) => a.point.distance(point) - b.point.distance(point));
1476
- if (p.length) return {
1477
- point: new THREE.Vector3(p[0].point.x, p[0].point.y, 0),
1478
- find: true,
1108
+ adsorption(e = 0.1, t = this.pointVirtualGrid, n = this.quadtree) {
1109
+ const o = this.parent?.findComponentByName("Editor"), s = A.from(o.pointerPosition), a = t.queryCircle(s, e).sort((d, l) => d.point.distance(s) - l.point.distance(s));
1110
+ if (a.length) return {
1111
+ point: new m.Vector3(a[0].point.x, a[0].point.y, 0),
1112
+ find: !0,
1479
1113
  mode: "point",
1480
- line: p[0].userData
1114
+ line: a[0].userData
1481
1115
  };
1482
- let result = quadtree.queryCircle(point, radius);
1483
- if (result.length) {
1484
- let projectPoints = result.map((res) => res.line.projectPoint(point));
1485
- projectPoints.sort((a, b) => {
1486
- if (a && b) return a.distance(point) - b.distance(point);
1487
- return 0;
1488
- });
1489
- result = result.filter((_, i) => !!projectPoints[i]);
1490
- projectPoints = projectPoints.filter((_, i) => !!projectPoints[i]);
1491
- return {
1492
- point: new THREE.Vector3(projectPoints[0].x, projectPoints[0].y, 0),
1493
- find: true,
1116
+ let i = n.queryCircle(s, e);
1117
+ if (i.length) {
1118
+ let d = i.map((l) => l.line.projectPoint(s));
1119
+ return d.sort((l, c) => l && c ? l.distance(s) - c.distance(s) : 0), i = i.filter((l, c) => !!d[c]), d = d.filter((l, c) => !!d[c]), {
1120
+ point: new m.Vector3(d[0].x, d[0].y, 0),
1121
+ find: !0,
1494
1122
  mode: "line",
1495
- line: result[0].line
1123
+ line: i[0].line
1496
1124
  };
1497
1125
  }
1498
1126
  return {
1499
- point: new THREE.Vector3(editor.pointerPosition.x, editor.pointerPosition.y, 0),
1500
- find: false
1127
+ point: new m.Vector3(o.pointerPosition.x, o.pointerPosition.y, 0),
1128
+ find: !1
1501
1129
  };
1502
1130
  }
1503
1131
  /** 创建几何体
1504
1132
  * @param rectangle
1505
1133
  */
1506
- createGeometry(map, count) {
1507
- const geometry = new THREE.BufferGeometry();
1508
- Object.keys(map).forEach((k) => {
1509
- geometry.setAttribute("position", new THREE.BufferAttribute(new Float32Array(map[k]), map[k].length / count));
1510
- });
1511
- return geometry;
1134
+ createGeometry(e, t) {
1135
+ const n = new m.BufferGeometry();
1136
+ return Object.keys(e).forEach((o) => {
1137
+ n.setAttribute("position", new m.BufferAttribute(new Float32Array(e[o]), e[o].length / t));
1138
+ }), n;
1512
1139
  }
1513
1140
  /**
1514
1141
  * 转为json
1515
1142
  */
1516
1143
  toJson() {
1517
- return this.lines.map((line2) => {
1518
- const userData = line2.userData;
1519
- const drawDoorData = userData.drawDoorData;
1520
- const insetionArr = this.quadtree.queryLineSegment(line2).filter((r) => r.line !== line2 && !r.userData?.isDoor).map((r) => ({ index: this.lines.indexOf(r.line) }));
1144
+ return this.lines.map((e) => {
1145
+ const t = e.userData, n = t.drawDoorData, o = this.quadtree.queryLineSegment(e).filter((s) => s.line !== e && !s.userData?.isDoor).map((s) => ({ index: this.lines.indexOf(s.line) }));
1521
1146
  return {
1522
- start: line2.start.toJson(this.dxf.originalZAverage),
1523
- end: line2.end.toJson(this.dxf.originalZAverage),
1524
- insetionArr,
1525
- isDoor: userData.isDoor,
1526
- doorDirectConnection: userData.isDoor,
1527
- length: line2.length(),
1528
- isWindow: userData.isWindow,
1529
- drawDoorData: drawDoorData && drawDoorData.map((w) => ({
1530
- p: { x: w.p.x, y: w.p.y, z: w.p.z },
1531
- width: w.width,
1532
- full: w.full
1147
+ start: e.start.toJson(this.dxf.originalZAverage),
1148
+ end: e.end.toJson(this.dxf.originalZAverage),
1149
+ insetionArr: o,
1150
+ isDoor: t.isDoor,
1151
+ doorDirectConnection: t.isDoor,
1152
+ length: e.length(),
1153
+ isWindow: t.isWindow,
1154
+ drawDoorData: n && n.map((s) => ({
1155
+ p: { x: s.p.x, y: s.p.y, z: s.p.z },
1156
+ width: s.width,
1157
+ full: s.full
1533
1158
  }))
1534
1159
  };
1535
1160
  });
@@ -1543,13 +1168,11 @@ class RenderManager extends Component {
1543
1168
  this.updatedMode = null;
1544
1169
  return;
1545
1170
  }
1546
- if (this._timer) clearTimeout(this._timer);
1547
- this._timer = setTimeout(() => {
1171
+ this._timer && clearTimeout(this._timer), this._timer = setTimeout(() => {
1548
1172
  this.updatedMode = "self";
1549
- const dxf = this.dxf;
1550
- const json = this.toJson();
1551
- dxf.set(json).then(() => {
1552
- dxf.lineOffset();
1173
+ const e = this.dxf, t = this.toJson();
1174
+ e.set(t).then(() => {
1175
+ e.lineOffset();
1553
1176
  });
1554
1177
  }, 10);
1555
1178
  }
@@ -1572,72 +1195,55 @@ class RenderManager extends Component {
1572
1195
  return this.parent?.findComponentByName("DxfLineModel");
1573
1196
  }
1574
1197
  }
1575
- class DrawDoorLine extends CommandFlowComponent {
1198
+ class jn extends T {
1576
1199
  static name = "DrawDoorLine";
1577
- container = new THREE.Group();
1200
+ container = new m.Group();
1578
1201
  interruptKeys = ["escape"];
1579
1202
  shortcutKeys = ["control", "m"];
1580
1203
  commandName = "draw-door-line";
1581
- onAddFromParent(parent) {
1582
- super.onAddFromParent(parent);
1583
- const editor = parent.findComponentByName("Editor"), eventInput = editor.eventInput, commandManager = editor.commandManager;
1204
+ onAddFromParent(e) {
1205
+ super.onAddFromParent(e);
1206
+ const t = e.findComponentByName("Editor"), n = t.eventInput, o = t.commandManager;
1584
1207
  this.editor.container.add(this.container);
1585
- const commandFlow = this.commandManager.addCommandFlow("draw-door-line").add(this.createInterrupt()).add(this.createCursor("no-drop")).add(this.selectPoint.bind(this)).add(this.end.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
1586
- eventInput.addKeyCombination(this.commandName, this.shortcutKeys);
1587
- commandFlow.addEventListener("finally", this.createFinally());
1588
- commandFlow.addEventListener("completed", (e) => this.completed(e.data));
1589
- eventInput.addCancelDefaultBehavior(() => eventInput.isOnlyKeyDowns(this.shortcutKeys));
1590
- eventInput.addEventListener("codeChange", async () => {
1591
- eventInput.isKeyCombination(this.commandName) && await commandManager.start(this.commandName);
1208
+ const s = this.commandManager.addCommandFlow("draw-door-line").add(this.createInterrupt()).add(this.createCursor("no-drop")).add(this.selectPoint.bind(this)).add(this.end.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
1209
+ n.addKeyCombination(this.commandName, this.shortcutKeys), s.addEventListener("finally", this.createFinally()), s.addEventListener("completed", (a) => this.completed(a.data)), n.addCancelDefaultBehavior(() => n.isOnlyKeyDowns(this.shortcutKeys)), n.addEventListener("codeChange", async () => {
1210
+ n.isKeyCombination(this.commandName) && await o.start(this.commandName);
1592
1211
  });
1593
1212
  }
1594
1213
  /** 选择点
1595
1214
  * @param next
1596
1215
  */
1597
- selectPoint(next) {
1598
- let editor = this.parent?.findComponentByName("Editor"), start = null, circle = new THREE.Mesh(new THREE.SphereGeometry(0.05), new THREE.MeshBasicMaterial({ color: 65280 })), line2 = new Lines([], 16711935), auxiliaryLine = new Lines([
1599
- new THREE.Vector3(-1e4, 0, 0),
1600
- new THREE.Vector3(1e4, 0, 0),
1601
- new THREE.Vector3(0, -1e4, 0),
1602
- new THREE.Vector3(0, 1e4, 0)
1216
+ selectPoint(e) {
1217
+ let t = this.parent?.findComponentByName("Editor"), n = null, o = new m.Mesh(new m.SphereGeometry(0.05), new m.MeshBasicMaterial({ color: 65280 })), s = new he([], 16711935), a = new he([
1218
+ new m.Vector3(-1e4, 0, 0),
1219
+ new m.Vector3(1e4, 0, 0),
1220
+ new m.Vector3(0, -1e4, 0),
1221
+ new m.Vector3(0, 1e4, 0)
1603
1222
  ], 16711935);
1604
- auxiliaryLine.material = new THREE.LineDashedMaterial({
1223
+ a.material = new m.LineDashedMaterial({
1605
1224
  color: 4235007,
1606
1225
  dashSize: 0.1,
1607
1226
  gapSize: 0.1,
1608
1227
  linewidth: 0.1
1609
- });
1610
- this.container.add(line2);
1611
- let currentPoint = null;
1228
+ }), this.container.add(s);
1229
+ let i = null;
1612
1230
  this.addEventRecord(
1613
1231
  "clear",
1614
- editor.addEventListener("pointerPositionChange", () => {
1615
- const { point, find } = editor.renderManager.adsorption(0.05);
1616
- start && line2.setPoint(start, point);
1617
- if (find) {
1618
- circle.position.set(point.x, point.y, 0);
1619
- this.container.add(circle);
1620
- this.domElement.style.cursor = "none";
1621
- currentPoint = point.clone();
1622
- } else {
1623
- currentPoint = null;
1624
- circle.removeFromParent();
1625
- this.domElement.style.cursor = "no-drop";
1626
- }
1232
+ t.addEventListener("pointerPositionChange", () => {
1233
+ const { point: d, find: l } = t.renderManager.adsorption(0.05);
1234
+ n && s.setPoint(n, d), l ? (o.position.set(d.x, d.y, 0), this.container.add(o), this.domElement.style.cursor = "none", i = d.clone()) : (i = null, o.removeFromParent(), this.domElement.style.cursor = "no-drop");
1627
1235
  }),
1628
- editor.eventInput.addEventListener("codeChange", async () => {
1629
- if (editor.eventInput.isKeyDown("mouse_0") && currentPoint) {
1630
- if (!start) {
1631
- start = currentPoint.clone();
1236
+ t.eventInput.addEventListener("codeChange", async () => {
1237
+ if (t.eventInput.isKeyDown("mouse_0") && i) {
1238
+ if (!n) {
1239
+ n = i.clone();
1632
1240
  return;
1633
1241
  }
1634
- next([start.clone(), currentPoint.clone()]);
1242
+ e([n.clone(), i.clone()]);
1635
1243
  }
1636
1244
  }),
1637
1245
  function() {
1638
- line2.removeFromParent();
1639
- circle.removeFromParent();
1640
- auxiliaryLine.removeFromParent();
1246
+ s.removeFromParent(), o.removeFromParent(), a.removeFromParent();
1641
1247
  }
1642
1248
  );
1643
1249
  }
@@ -1646,100 +1252,66 @@ class DrawDoorLine extends CommandFlowComponent {
1646
1252
  * @param next
1647
1253
  * @param points
1648
1254
  */
1649
- end(next, points) {
1650
- const lines = [];
1651
- for (let i = 0; i < points.length; i += 2) {
1652
- const line2 = new LineSegment(Point.from(points[i]), Point.from(points[i + 1]));
1653
- line2.userData.isDoor = true;
1654
- line2.userData.doorDirectConnection = true;
1655
- lines.push(line2);
1255
+ end(e, t) {
1256
+ const n = [];
1257
+ for (let o = 0; o < t.length; o += 2) {
1258
+ const s = new ne(A.from(t[o]), A.from(t[o + 1]));
1259
+ s.userData.isDoor = !0, s.userData.doorDirectConnection = !0, n.push(s);
1656
1260
  }
1657
- next(lines);
1261
+ e(n);
1658
1262
  }
1659
1263
  /** 执行完成
1660
1264
  */
1661
- completed(lines) {
1662
- this.renderManager.addLines(lines);
1663
- this.renderManager.draw();
1265
+ completed(e) {
1266
+ this.renderManager.addLines(e), this.renderManager.draw();
1664
1267
  }
1665
1268
  /** 回滚操作
1666
1269
  * @param data
1667
1270
  */
1668
- rollback(lines) {
1669
- lines.forEach((line2) => this.renderManager.removeLine(line2));
1670
- this.renderManager.draw();
1671
- return lines;
1271
+ rollback(e) {
1272
+ return e.forEach((t) => this.renderManager.removeLine(t)), this.renderManager.draw(), e;
1672
1273
  }
1673
1274
  /** 撤回回滚
1674
1275
  * @param lines
1675
1276
  * @returns
1676
1277
  */
1677
- revokeRollback(lines) {
1678
- this.completed(lines);
1679
- return lines;
1278
+ revokeRollback(e) {
1279
+ return this.completed(e), e;
1680
1280
  }
1681
1281
  }
1682
- class DrawWindow extends CommandFlowComponent {
1282
+ class Gn extends T {
1683
1283
  static name = "DrawWindow";
1684
- container = new THREE.Group();
1284
+ container = new m.Group();
1685
1285
  interruptKeys = ["escape"];
1686
1286
  shortcutKeys = ["control", "q"];
1687
1287
  commandName = "draw-window-line";
1688
- onAddFromParent(parent) {
1689
- super.onAddFromParent(parent);
1690
- this.editor.container.add(this.container);
1691
- const commandFlow = this.commandManager.addCommandFlow(this.commandName).add(this.createInterrupt()).add(this.createCursor("no-drop")).add(this.selectPointStart.bind(this)).add(this.selectPointEnd.bind(this)).add(this.end.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
1692
- commandFlow.addEventListener("finally", this.createFinally(["selectPointStart"]));
1693
- commandFlow.addEventListener("completed", (e) => this.completed(e.data));
1694
- this.eventInput.addKeyCombination(this.commandName, this.shortcutKeys);
1695
- this.eventInput.addEventListener("codeChange", async () => this.eventInput.isKeyCombination(this.commandName) && await this.commandManager.start(this.commandName));
1696
- this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
1288
+ onAddFromParent(e) {
1289
+ super.onAddFromParent(e), this.editor.container.add(this.container);
1290
+ const t = this.commandManager.addCommandFlow(this.commandName).add(this.createInterrupt()).add(this.createCursor("no-drop")).add(this.selectPointStart.bind(this)).add(this.selectPointEnd.bind(this)).add(this.end.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
1291
+ t.addEventListener("finally", this.createFinally(["selectPointStart"])), t.addEventListener("completed", (n) => this.completed(n.data)), this.eventInput.addKeyCombination(this.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => this.eventInput.isKeyCombination(this.commandName) && await this.commandManager.start(this.commandName)), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
1697
1292
  }
1698
1293
  /** 选择开始点
1699
1294
  * @param next
1700
1295
  */
1701
- selectPointStart(next) {
1702
- let currentPoint = null, circle = new THREE.Mesh(new THREE.SphereGeometry(0.05), new THREE.MeshBasicMaterial({ color: 16711935 })), currentLine = null;
1296
+ selectPointStart(e) {
1297
+ let t = null, n = new m.Mesh(new m.SphereGeometry(0.05), new m.MeshBasicMaterial({ color: 16711935 })), o = null;
1703
1298
  this.addEventRecord("selectPointStart").add(this.editor.addEventListener("pointerPositionChange", () => {
1704
- const { point, line: line2, find } = this.editor.renderManager.adsorption();
1705
- if (find) {
1706
- this.domElement.style.cursor = "none";
1707
- circle.position.copy(point);
1708
- currentLine = line2;
1709
- currentPoint = point.clone();
1710
- this.container.add(circle);
1711
- } else {
1712
- this.domElement.style.cursor = "no-drop";
1713
- currentPoint = null;
1714
- circle.removeFromParent();
1715
- }
1299
+ const { point: s, line: a, find: i } = this.editor.renderManager.adsorption();
1300
+ i ? (this.domElement.style.cursor = "none", n.position.copy(s), o = a, t = s.clone(), this.container.add(n)) : (this.domElement.style.cursor = "no-drop", t = null, n.removeFromParent());
1716
1301
  })).add(this.eventInput.addEventListener("codeChange", () => {
1717
- if (this.eventInput.isKeyDown("mouse_0") && currentPoint) {
1718
- this.canceEventRecord("selectPointStart");
1719
- next({ point: currentPoint, line: currentLine });
1720
- }
1721
- }));
1722
- this.addEventRecord("clear").add(() => circle.removeFromParent());
1302
+ this.eventInput.isKeyDown("mouse_0") && t && (this.canceEventRecord("selectPointStart"), e({ point: t, line: o }));
1303
+ })), this.addEventRecord("clear").add(() => n.removeFromParent());
1723
1304
  }
1724
1305
  /** 选择结束点
1725
1306
  * @param next
1726
1307
  */
1727
- selectPointEnd(next, { point, line: line2 }) {
1728
- let currentPoint = null, circle = new THREE.Mesh(new THREE.SphereGeometry(0.05), new THREE.MeshBasicMaterial({ color: 16711935 }));
1729
- this.addEventRecord("clear").add(() => circle.removeFromParent()).add(this.editor.addEventListener("pointerPositionChange", () => {
1730
- const { point: point2, find, line: l } = this.editor.renderManager.adsorption();
1731
- if (find && l === line2) {
1732
- this.domElement.style.cursor = "none";
1733
- circle.position.copy(point2);
1734
- currentPoint = point2.clone();
1735
- this.container.add(circle);
1736
- } else {
1737
- this.domElement.style.cursor = "no-drop";
1738
- currentPoint = null;
1739
- circle.removeFromParent();
1740
- }
1308
+ selectPointEnd(e, { point: t, line: n }) {
1309
+ let o = null, s = new m.Mesh(new m.SphereGeometry(0.05), new m.MeshBasicMaterial({ color: 16711935 }));
1310
+ this.addEventRecord("clear").add(() => s.removeFromParent()).add(this.editor.addEventListener("pointerPositionChange", () => {
1311
+ const { point: a, find: i, line: d } = this.editor.renderManager.adsorption();
1312
+ i && d === n ? (this.domElement.style.cursor = "none", s.position.copy(a), o = a.clone(), this.container.add(s)) : (this.domElement.style.cursor = "no-drop", o = null, s.removeFromParent());
1741
1313
  })).add(this.eventInput.addEventListener("codeChange", () => {
1742
- if (this.eventInput.isKeyDown("mouse_0") && currentPoint) next({ line: line2, start: point, end: currentPoint });
1314
+ this.eventInput.isKeyDown("mouse_0") && o && e({ line: n, start: t, end: o });
1743
1315
  }));
1744
1316
  }
1745
1317
  /**
@@ -1747,1077 +1319,846 @@ class DrawWindow extends CommandFlowComponent {
1747
1319
  * @param next
1748
1320
  * @param points
1749
1321
  */
1750
- end(next, { start, end, line: line2 }) {
1751
- const win = new LineSegment(Point.from(start), Point.from(end)), center = win.center, len = win.length();
1752
- const doorDataItem = {
1753
- p: new THREE.Vector3(center.x, center.y, 0),
1754
- width: len,
1755
- full: Math.abs(len - line2.length()) < 0.01
1322
+ end(e, { start: t, end: n, line: o }) {
1323
+ const s = new ne(A.from(t), A.from(n)), a = s.center, i = s.length(), d = {
1324
+ p: new m.Vector3(a.x, a.y, 0),
1325
+ width: i,
1326
+ full: Math.abs(i - o.length()) < 0.01
1756
1327
  };
1757
- next({ line: line2, doorDataItem });
1328
+ e({ line: o, doorDataItem: d });
1758
1329
  }
1759
1330
  /** 执行完成
1760
1331
  */
1761
- completed({ doorDataItem, line: line2 }) {
1762
- line2.userData.isWindow = true;
1763
- if (!line2.userData.drawDoorData) line2.userData.drawDoorData = [];
1764
- line2.userData.drawDoorData.push(doorDataItem);
1765
- this.renderManager.draw();
1332
+ completed({ doorDataItem: e, line: t }) {
1333
+ t.userData.isWindow = !0, t.userData.drawDoorData || (t.userData.drawDoorData = []), t.userData.drawDoorData.push(e), this.renderManager.draw();
1766
1334
  }
1767
1335
  /** 回滚操作
1768
1336
  * @param data
1769
1337
  */
1770
- rollback(data) {
1771
- const { doorDataItem, line: line2 } = data;
1772
- if (line2.userData.drawDoorData) {
1773
- const index = line2.userData.drawDoorData.indexOf(doorDataItem);
1774
- if (index !== -1) {
1775
- line2.userData.drawDoorData.splice(index, 1);
1776
- if (line2.userData.drawDoorData.length === 0) {
1777
- delete line2.userData.drawDoorData;
1778
- delete line2.userData.isWindow;
1779
- }
1780
- this.renderManager.draw();
1781
- }
1338
+ rollback(e) {
1339
+ const { doorDataItem: t, line: n } = e;
1340
+ if (n.userData.drawDoorData) {
1341
+ const o = n.userData.drawDoorData.indexOf(t);
1342
+ o !== -1 && (n.userData.drawDoorData.splice(o, 1), n.userData.drawDoorData.length === 0 && (delete n.userData.drawDoorData, delete n.userData.isWindow), this.renderManager.draw());
1782
1343
  }
1783
- return data;
1344
+ return e;
1784
1345
  }
1785
1346
  /** 撤回回滚
1786
1347
  * @param data
1787
1348
  * @returns
1788
1349
  */
1789
- revokeRollback(data) {
1790
- this.completed(data);
1791
- return data;
1350
+ revokeRollback(e) {
1351
+ return this.completed(e), e;
1792
1352
  }
1793
1353
  }
1794
- class VerticalCorrection extends CommandFlowComponent {
1354
+ class ee extends T {
1795
1355
  static name = "VerticalCorrection";
1796
- container = new THREE.Group();
1356
+ container = new m.Group();
1797
1357
  shortcutKeys = ["control", "c"];
1358
+ shortcutKeys2 = ["control", "shift", "c"];
1798
1359
  static commandName = "verticalCorrection";
1799
- onAddFromParent(parent) {
1800
- super.onAddFromParent(parent);
1801
- this.editor.container.add(this.container);
1802
- this.container.position.z = 1e-3;
1803
- const commandFlow = this.commandManager.addCommandFlow(VerticalCorrection.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.verticalCorrection.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
1804
- commandFlow.addEventListener("finally", this.createFinally());
1805
- commandFlow.addEventListener("completed", (e) => this.completed(e.data));
1806
- this.eventInput.addKeyCombination(VerticalCorrection.commandName, this.shortcutKeys);
1807
- this.eventInput.addEventListener("codeChange", async () => {
1808
- this.eventInput.isKeyCombination(VerticalCorrection.commandName) && await this.commandManager.start(VerticalCorrection.commandName, [...this.default.selectLines]);
1809
- });
1810
- this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
1360
+ recursion = !1;
1361
+ onAddFromParent(e) {
1362
+ super.onAddFromParent(e), this.editor.container.add(this.container), this.container.position.z = 1e-3;
1363
+ const t = this.commandManager.addCommandFlow(ee.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.verticalCorrection.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
1364
+ t.addEventListener("finally", this.createFinally()), t.addEventListener("completed", (n) => this.completed(n.data)), t.addEventListener("started", () => {
1365
+ !this.eventInput.isOnlyKeyDowns(this.shortcutKeys) && !this.eventInput.isOnlyKeyDowns(this.shortcutKeys2) && (this.recursion = !1);
1366
+ }), this.eventInput.addEventListener("codeChange", async () => {
1367
+ this.eventInput.isOnlyKeyDowns(this.shortcutKeys) ? (this.recursion = !1, this.commandManager.start(ee.commandName, [...this.default.selectLines])) : this.eventInput.isOnlyKeyDowns(this.shortcutKeys2) && (this.recursion = !0, this.commandManager.start(ee.commandName, [...this.default.selectLines]));
1368
+ }), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys) || this.eventInput.isOnlyKeyDowns(this.shortcutKeys2));
1811
1369
  }
1812
1370
  /**
1813
1371
  * 进入命令约束
1814
1372
  */
1815
- constraint(next, selectLines) {
1816
- if (!Array.isArray(selectLines)) {
1817
- ElMessage({ message: "进入命令失败", type: "warning" });
1818
- this.cancel();
1819
- } else if (selectLines.length !== 1) {
1820
- ElMessage({ message: "请选择一条线段", type: "warning" });
1821
- this.cancel();
1822
- } else next(selectLines);
1373
+ constraint(e, t) {
1374
+ Array.isArray(t) ? t.length !== 1 ? (k({ message: "请选择一条线段", type: "warning" }), this.cancel()) : e(t) : (k({ message: "进入命令失败", type: "warning" }), this.cancel());
1823
1375
  }
1824
1376
  /**
1825
1377
  * 线段是否为结尾线段
1826
1378
  * @param line
1827
1379
  */
1828
- lineIsPathEnd(line2) {
1829
- for (let i = 0; i < line2.points.length; i++) {
1830
- const point = line2.points[i];
1831
- const length = this.renderManager.pointVirtualGrid.queryPoint(point).filter((p) => !p.point.equal(point)).length;
1832
- if (length === 0) return true;
1380
+ lineIsPathEnd(e) {
1381
+ for (let t = 0; t < e.points.length; t++) {
1382
+ const n = e.points[t];
1383
+ if (this.renderManager.pointVirtualGrid.queryPoint(n).filter((s) => !s.point.equal(n)).length === 0) return !0;
1833
1384
  }
1834
- return false;
1385
+ return !1;
1835
1386
  }
1836
1387
  /**
1837
1388
  *
1838
1389
  * @param line0
1839
1390
  * @param line1
1840
1391
  */
1841
- isTowLineSegmentConnect(line0, line1) {
1842
- if (line0.start.equal(line1.start) || line0.start.equal(line1.end) || line0.end.equal(line1.start) || line0.end.equal(line1.end)) {
1843
- return true;
1844
- }
1845
- return false;
1392
+ isTowLineSegmentConnect(e, t) {
1393
+ return !!(e.start.equal(t.start) || e.start.equal(t.end) || e.end.equal(t.start) || e.end.equal(t.end));
1846
1394
  }
1847
1395
  /**
1848
1396
  * 获取所有相同点的位置信息
1849
1397
  * @param point
1850
1398
  * @param point2
1851
1399
  */
1852
- getSamePointAll(point, point2) {
1853
- const resultList = this.renderManager.pointVirtualGrid.queryPoint(point);
1854
- return resultList.map((result) => ({
1855
- point: result.point,
1856
- oldPoint: result.point.clone(),
1857
- newPoint: point2,
1858
- line: result.userData
1400
+ getSamePointAll(e, t) {
1401
+ return this.renderManager.pointVirtualGrid.queryPoint(e).map((o) => ({
1402
+ point: o.point,
1403
+ oldPoint: o.point.clone(),
1404
+ newPoint: t,
1405
+ line: o.userData
1859
1406
  }));
1860
1407
  }
1861
1408
  /** 修正
1862
1409
  * @param targettLine
1863
1410
  * @param vistedList
1864
1411
  */
1865
- correction(targettLine, resultList = [], vistedList = /* @__PURE__ */ new Set()) {
1866
- if (vistedList.has(targettLine)) return;
1867
- vistedList.add(targettLine);
1868
- const lines = this.renderManager.quadtree.queryLineSegment(targettLine).filter(({ line: line2 }) => {
1869
- if (line2 === targettLine || line2.userData.isDoor) return false;
1870
- return true;
1871
- }).map((result) => result.line), targettLineDirection = targettLine.direction();
1872
- lines.forEach((line2) => {
1873
- if (vistedList.has(line2)) return false;
1874
- const direction = line2.direction(), angle = targettLineDirection.angleBetween(direction, "angle"), gap = Math.abs(90 - angle);
1875
- if (gap > 10 || gap < 1) return;
1876
- if (this.isTowLineSegmentConnect(targettLine, line2)) {
1877
- const point0 = targettLine.start.equal(line2.start) || targettLine.start.equal(line2.end) ? targettLine.start : targettLine.end, point1 = line2.start.equal(targettLine.start) || line2.start.equal(targettLine.end) ? line2.end : line2.start, projectLine = new LineSegment(
1878
- point1.clone().add(targettLineDirection.clone().multiplyScalar(1)),
1879
- point1.clone().add(targettLineDirection.clone().multiplyScalar(-1))
1880
- ), projectPoint = projectLine.projectPoint(point0, false);
1881
- if (projectPoint) {
1882
- resultList.push(this.getSamePointAll(point1, projectPoint));
1883
- }
1884
- } else {
1885
- console.log("交点");
1886
- }
1887
- });
1888
- lines.forEach((line2) => this.correction(line2, resultList, vistedList));
1889
- return resultList;
1412
+ correction(e, t = [], n = /* @__PURE__ */ new Set()) {
1413
+ if (n.has(e)) return;
1414
+ n.add(e);
1415
+ const o = this.renderManager.quadtree.queryLineSegment(e).filter(({ line: a }) => !(a === e || a.userData.isDoor)).map((a) => a.line), s = e.direction();
1416
+ return o.forEach((a) => {
1417
+ if (n.has(a)) return !1;
1418
+ if (a.length() / e.length() > 1) return;
1419
+ const i = a.direction(), d = s.angleBetween(i, "angle"), l = Math.abs(90 - d);
1420
+ if (!(l > 20 || l < 1))
1421
+ if (this.isTowLineSegmentConnect(e, a)) {
1422
+ const c = e.start.equal(a.start) || e.start.equal(a.end) ? e.start : e.end, h = a.start.equal(e.start) || a.start.equal(e.end) ? a.end : a.start, w = new ne(
1423
+ h.clone().add(s.clone().multiplyScalar(1)),
1424
+ h.clone().add(s.clone().multiplyScalar(-1))
1425
+ ), f = w.projectPoint(c, !1);
1426
+ f && t.push(this.getSamePointAll(h, f));
1427
+ } else
1428
+ console.log("交点");
1429
+ }), this.recursion && o.forEach((a) => this.correction(a, t, n)), t;
1890
1430
  }
1891
1431
  /** 开始
1892
1432
  * @param next
1893
1433
  */
1894
- verticalCorrection(next, selectLines) {
1895
- next(this.correction(selectLines[0]));
1434
+ verticalCorrection(e, t) {
1435
+ e(this.correction(t[0]));
1896
1436
  }
1897
1437
  /** 执行完成
1898
1438
  * @param data
1899
1439
  */
1900
- completed(data) {
1901
- data.forEach((items) => {
1902
- items.forEach((item) => {
1903
- const { line: line2, newPoint, point } = item;
1904
- point.copy(newPoint);
1905
- this.renderManager.removeLine(line2);
1906
- this.renderManager.addLine(line2);
1440
+ completed(e) {
1441
+ e.forEach((t) => {
1442
+ t.forEach((n) => {
1443
+ const { line: o, newPoint: s, point: a } = n;
1444
+ a.copy(s), this.renderManager.removeLine(o), this.renderManager.addLine(o);
1907
1445
  });
1908
- });
1909
- this.renderManager.draw();
1446
+ }), this.renderManager.draw();
1910
1447
  }
1911
1448
  /** 回滚操作
1912
1449
  * @param data
1913
1450
  */
1914
- rollback(data) {
1915
- data.forEach((items) => {
1916
- items.forEach((item) => {
1917
- const { line: line2, oldPoint, point } = item;
1918
- point.copy(oldPoint);
1919
- this.renderManager.removeLine(line2);
1920
- this.renderManager.addLine(line2);
1451
+ rollback(e) {
1452
+ return e.forEach((t) => {
1453
+ t.forEach((n) => {
1454
+ const { line: o, oldPoint: s, point: a } = n;
1455
+ a.copy(s), this.renderManager.removeLine(o), this.renderManager.addLine(o);
1921
1456
  });
1922
- });
1923
- this.renderManager.draw();
1924
- return data;
1457
+ }), this.renderManager.draw(), e;
1925
1458
  }
1926
1459
  /** 撤回回滚
1927
1460
  * @param lines
1928
1461
  * @returns
1929
1462
  */
1930
- revokeRollback(data) {
1931
- this.completed(data);
1932
- return data;
1463
+ revokeRollback(e) {
1464
+ return this.completed(e), e;
1933
1465
  }
1934
1466
  }
1935
- class MergeLine extends CommandFlowComponent {
1467
+ class q extends T {
1936
1468
  static name = "MergeLine";
1937
1469
  shortcutKeys = ["control", "g"];
1938
1470
  static commandName = "merge-line";
1939
- onAddFromParent(parent) {
1940
- super.onAddFromParent(parent);
1941
- const defaultComponent = parent.findComponentByType(Default);
1942
- const commandFlow = this.commandManager.addCommandFlow(MergeLine.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.mergeLine.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
1943
- commandFlow.addEventListener("finally", this.createFinally());
1944
- commandFlow.addEventListener("completed", (e) => this.completed(e.data));
1945
- this.eventInput.addKeyCombination(MergeLine.commandName, this.shortcutKeys);
1946
- this.eventInput.addEventListener("codeChange", async () => {
1947
- defaultComponent?.selectLines.length === 2 && this.eventInput.isKeyCombination(MergeLine.commandName) && await this.commandManager.start(MergeLine.commandName, [...this.default.selectLines]);
1948
- });
1949
- this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
1471
+ onAddFromParent(e) {
1472
+ super.onAddFromParent(e);
1473
+ const t = e.findComponentByType(ke), n = this.commandManager.addCommandFlow(q.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.mergeLine.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
1474
+ n.addEventListener("finally", this.createFinally()), n.addEventListener("completed", (o) => this.completed(o.data)), this.eventInput.addKeyCombination(q.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => {
1475
+ t?.selectLines.length === 2 && this.eventInput.isKeyCombination(q.commandName) && await this.commandManager.start(q.commandName, [...this.default.selectLines]);
1476
+ }), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
1950
1477
  }
1951
1478
  /**
1952
1479
  * 进入命令约束
1953
1480
  */
1954
- constraint(next, selectLines) {
1955
- if (!Array.isArray(selectLines)) {
1956
- ElMessage({ message: "进入命令失败", type: "warning" });
1957
- this.cancel();
1958
- } else if (selectLines.length !== 2) {
1959
- ElMessage({ message: "未执行线段合并,请选择两条线段", type: "warning" });
1960
- this.cancel();
1961
- } else {
1962
- next(selectLines);
1963
- }
1481
+ constraint(e, t) {
1482
+ Array.isArray(t) ? t.length !== 2 ? (k({ message: "未执行线段合并,请选择两条线段", type: "warning" }), this.cancel()) : e(t) : (k({ message: "进入命令失败", type: "warning" }), this.cancel());
1964
1483
  }
1965
1484
  /** 开始
1966
1485
  * @param next
1967
- */
1968
- mergeLine(next, selectLines) {
1969
- const line1 = selectLines[0], line2 = selectLines[1];
1970
- for (let i = 0; i < line1.points.length; i++) {
1971
- const p1 = line1.points[i];
1972
- for (let j = 0; j < line2.points.length; j++) {
1973
- const p2 = line2.points[j];
1974
- if (p1.equal(p2)) {
1975
- const p1Next = line1.points[(i + 1) % 2];
1976
- const p2Next = line2.points[(j + 1) % 2];
1977
- const line3 = new LineSegment(p1Next, p2Next);
1978
- next({ line1, line2, newLine: line3 });
1979
- return ElMessage({ message: "已合并", type: "success" });
1486
+ * @todo 合并所有
1487
+ */
1488
+ mergeLine(e, t) {
1489
+ const n = t[0], o = t[1];
1490
+ for (let s = 0; s < n.points.length; s++) {
1491
+ const a = n.points[s];
1492
+ for (let i = 0; i < o.points.length; i++) {
1493
+ const d = o.points[i];
1494
+ if (a.equal(d)) {
1495
+ const l = n.points[(s + 1) % 2], c = o.points[(i + 1) % 2], h = new ne(l, c);
1496
+ return e({ line1: n, line2: o, newLine: h }), k({ message: "已合并", type: "success" });
1980
1497
  }
1981
1498
  }
1982
1499
  }
1983
- ElMessage({ message: "合并失败,两条线未找到共用点", type: "warning" });
1984
- next();
1500
+ k({ message: "合并失败,两条线未找到共用点", type: "warning" }), this.commandManager.cancel();
1985
1501
  }
1986
1502
  /** 执行完成
1987
1503
  * @param data
1988
1504
  */
1989
- completed(data) {
1990
- this.renderManager.removeLine(data.line1);
1991
- this.renderManager.removeLine(data.line2);
1992
- this.renderManager.addLine(data.newLine);
1993
- this.renderManager.draw();
1505
+ completed(e) {
1506
+ this.renderManager.removeLine(e.line1), this.renderManager.removeLine(e.line2), this.renderManager.addLine(e.newLine), this.renderManager.draw();
1994
1507
  }
1995
1508
  /** 回滚操作
1996
1509
  * @param data
1997
1510
  */
1998
- rollback(data) {
1999
- this.renderManager.addLines([data.line1, data.line2]);
2000
- this.renderManager.removeLine(data.newLine);
2001
- this.renderManager.draw();
2002
- return data;
1511
+ rollback(e) {
1512
+ return this.renderManager.addLines([e.line1, e.line2]), this.renderManager.removeLine(e.newLine), this.renderManager.draw(), e;
2003
1513
  }
2004
1514
  /** 撤回回滚
2005
1515
  * @param lines
2006
1516
  * @returns
2007
1517
  */
2008
- revokeRollback(data) {
2009
- this.completed(data);
2010
- return data;
1518
+ revokeRollback(e) {
1519
+ return this.completed(e), e;
2011
1520
  }
2012
1521
  }
2013
- class DeleteSelectLine extends CommandFlowComponent {
1522
+ class W extends T {
2014
1523
  static name = "DeleteSelectLine";
2015
1524
  shortcutKeys = ["Delete"];
2016
1525
  static commandName = "deleteSelectLine";
2017
- onAddFromParent(parent) {
2018
- super.onAddFromParent(parent);
2019
- const commandFlow = this.commandManager.addCommandFlow(DeleteSelectLine.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.delete.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
2020
- commandFlow.addEventListener("finally", this.createFinally());
2021
- this.eventInput.addKeyCombination(DeleteSelectLine.commandName, this.shortcutKeys);
2022
- this.eventInput.addEventListener("codeChange", async () => {
2023
- this.eventInput.isKeyCombination(DeleteSelectLine.commandName) && await this.commandManager.start(DeleteSelectLine.commandName, [...this.default.selectLines]);
2024
- });
2025
- this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
1526
+ onAddFromParent(e) {
1527
+ super.onAddFromParent(e), this.commandManager.addCommandFlow(W.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.delete.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this)).addEventListener("finally", this.createFinally()), this.eventInput.addKeyCombination(W.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => {
1528
+ this.eventInput.isKeyCombination(W.commandName) && await this.commandManager.start(W.commandName, [...this.default.selectLines]);
1529
+ }), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
2026
1530
  }
2027
1531
  /**
2028
1532
  * 进入命令约束
2029
1533
  */
2030
- constraint(next, selectLines) {
2031
- if (!Array.isArray(selectLines)) {
2032
- ElMessage({ message: "请选择线段", type: "warning" });
2033
- this.cancel();
2034
- } else {
2035
- next(selectLines);
2036
- }
1534
+ constraint(e, t) {
1535
+ Array.isArray(t) ? e(t) : (k({ message: "请选择线段", type: "warning" }), this.cancel());
2037
1536
  }
2038
1537
  /** 开始
2039
1538
  * @param next
2040
1539
  */
2041
- delete(next, selectLines) {
2042
- selectLines.forEach((line2) => this.renderManager.removeLine(line2));
2043
- ElMessage({ message: "删除成功", type: "success" });
2044
- next(selectLines);
1540
+ delete(e, t) {
1541
+ t.forEach((n) => this.renderManager.removeLine(n)), k({ message: "删除成功", type: "success" }), e(t);
2045
1542
  }
2046
1543
  /** 回滚操作
2047
1544
  * @param data
2048
1545
  */
2049
- rollback(lines) {
2050
- this.renderManager.addLines(lines);
2051
- this.renderManager.draw();
2052
- return lines;
1546
+ rollback(e) {
1547
+ return this.renderManager.addLines(e), this.renderManager.draw(), e;
2053
1548
  }
2054
1549
  /** 撤回回滚
2055
1550
  * @param lines
2056
1551
  * @returns
2057
1552
  */
2058
- revokeRollback(lines) {
2059
- lines.forEach((line2) => this.renderManager.removeLine(line2));
2060
- return lines;
1553
+ revokeRollback(e) {
1554
+ return e.forEach((t) => this.renderManager.removeLine(t)), e;
2061
1555
  }
2062
1556
  }
2063
- class ConnectionLine extends CommandFlowComponent {
1557
+ class U extends T {
2064
1558
  static name = "ConnectionLine";
2065
1559
  shortcutKeys = ["Shift", "L"];
2066
1560
  static commandName = "connectionLine";
2067
- onAddFromParent(parent) {
2068
- super.onAddFromParent(parent);
2069
- const commandFlow = this.commandManager.addCommandFlow(ConnectionLine.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.connection.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
2070
- commandFlow.addEventListener("finally", this.createFinally());
2071
- commandFlow.addEventListener("completed", (e) => this.completed(e.data));
2072
- this.eventInput.addKeyCombination(ConnectionLine.commandName, this.shortcutKeys);
2073
- this.eventInput.addEventListener("codeChange", async () => {
2074
- this.eventInput.isKeyCombination(ConnectionLine.commandName) && await this.commandManager.start(ConnectionLine.commandName, [...this.default.selectLines]);
2075
- });
2076
- this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
1561
+ onAddFromParent(e) {
1562
+ super.onAddFromParent(e);
1563
+ const t = this.commandManager.addCommandFlow(U.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.connection.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
1564
+ t.addEventListener("finally", this.createFinally()), t.addEventListener("completed", (n) => this.completed(n.data)), this.eventInput.addKeyCombination(U.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => {
1565
+ this.eventInput.isKeyCombination(U.commandName) && await this.commandManager.start(U.commandName, [...this.default.selectLines]);
1566
+ }), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
2077
1567
  }
2078
1568
  /**
2079
1569
  * 进入命令约束
2080
1570
  */
2081
- constraint(next, selectLines) {
2082
- if (!Array.isArray(selectLines)) {
2083
- ElMessage({ message: "进入命令失败", type: "warning" });
2084
- this.cancel();
2085
- } else if (selectLines.length !== 2) {
2086
- ElMessage({ message: "请选择2条线段", type: "warning" });
2087
- this.cancel();
2088
- } else {
2089
- next(selectLines);
2090
- }
1571
+ constraint(e, t) {
1572
+ Array.isArray(t) ? t.length !== 2 ? (k({ message: "请选择2条线段", type: "warning" }), this.cancel()) : e(t) : (k({ message: "进入命令失败", type: "warning" }), this.cancel());
2091
1573
  }
2092
1574
  /** 连接
2093
1575
  * @param next
2094
1576
  */
2095
- connection(next, selectLines) {
2096
- let start, end, diatance = Infinity;
2097
- for (let i = 0; i < 2; i++)
2098
- for (let j = 0; j < 2; j++) {
2099
- const point1 = selectLines[0].points[i];
2100
- const point2 = selectLines[1].points[j];
2101
- const d = point1.distance(point2);
2102
- if (d < diatance) {
2103
- start = point1;
2104
- end = point2;
2105
- diatance = d;
2106
- }
1577
+ connection(e, t) {
1578
+ let n, o, s = 1 / 0;
1579
+ for (let a = 0; a < 2; a++)
1580
+ for (let i = 0; i < 2; i++) {
1581
+ const d = t[0].points[a], l = t[1].points[i], c = d.distance(l);
1582
+ c < s && (n = d, o = l, s = c);
2107
1583
  }
2108
- if (start && end) {
2109
- const line2 = new LineSegment(start.clone(), end.clone());
2110
- next(line2);
2111
- ElMessage({ message: "连接成功", type: "success" });
1584
+ if (n && o) {
1585
+ const a = new ne(n.clone(), o.clone());
1586
+ e(a), k({ message: "连接成功", type: "success" });
2112
1587
  } else this.cancel();
2113
1588
  }
2114
1589
  /** 成功
2115
1590
  * @param next
2116
1591
  * @param selectLines
2117
1592
  */
2118
- completed(line2) {
2119
- this.renderManager.addLine(line2);
2120
- this.renderManager.draw();
1593
+ completed(e) {
1594
+ this.renderManager.addLine(e), this.renderManager.draw();
2121
1595
  }
2122
1596
  /** 回滚操作
2123
1597
  * @param data
2124
1598
  */
2125
- rollback(line2) {
2126
- this.renderManager.removeLine(line2);
2127
- return line2;
1599
+ rollback(e) {
1600
+ return this.renderManager.removeLine(e), e;
2128
1601
  }
2129
1602
  /** 撤回回滚
2130
1603
  * @param lines
2131
1604
  * @returns
2132
1605
  */
2133
- revokeRollback(line2) {
2134
- this.completed(line2);
2135
- return line2;
1606
+ revokeRollback(e) {
1607
+ return this.completed(e), e;
2136
1608
  }
2137
1609
  }
2138
- class IntersectionConnectionLine extends CommandFlowComponent {
1610
+ class Q extends T {
2139
1611
  static name = "IntersectionConnectionLine";
2140
1612
  shortcutKeys = ["control", "Shift", "L"];
2141
1613
  static commandName = "intersectionConnectionLine";
2142
- onAddFromParent(parent) {
2143
- super.onAddFromParent(parent);
2144
- const commandFlow = this.commandManager.addCommandFlow(IntersectionConnectionLine.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.connection.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
2145
- commandFlow.addEventListener("finally", this.createFinally());
2146
- commandFlow.addEventListener("completed", (e) => this.completed(e.data));
2147
- this.eventInput.addKeyCombination(IntersectionConnectionLine.commandName, this.shortcutKeys);
2148
- this.eventInput.addEventListener("codeChange", async () => {
2149
- this.eventInput.isKeyCombination(IntersectionConnectionLine.commandName) && await this.commandManager.start(IntersectionConnectionLine.commandName, [...this.default.selectLines]);
2150
- });
2151
- this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
1614
+ onAddFromParent(e) {
1615
+ super.onAddFromParent(e);
1616
+ const t = this.commandManager.addCommandFlow(Q.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.connection.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
1617
+ t.addEventListener("finally", this.createFinally()), t.addEventListener("completed", (n) => this.completed(n.data)), this.eventInput.addKeyCombination(Q.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => {
1618
+ this.eventInput.isKeyCombination(Q.commandName) && await this.commandManager.start(Q.commandName, [...this.default.selectLines]);
1619
+ }), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
2152
1620
  }
2153
1621
  /**
2154
1622
  * 进入命令约束
2155
1623
  */
2156
- constraint(next, selectLines) {
2157
- if (!Array.isArray(selectLines)) {
2158
- ElMessage({ message: "进入命令失败", type: "warning" });
2159
- this.cancel();
2160
- } else if (selectLines.length !== 2) {
2161
- ElMessage({ message: "请选择2条线段", type: "warning" });
2162
- this.cancel();
2163
- } else {
2164
- next(selectLines);
2165
- }
1624
+ constraint(e, t) {
1625
+ Array.isArray(t) ? t.length !== 2 ? (k({ message: "请选择2条线段", type: "warning" }), this.cancel()) : e(t) : (k({ message: "进入命令失败", type: "warning" }), this.cancel());
2166
1626
  }
2167
1627
  /** 开始
2168
1628
  * @param next
2169
1629
  */
2170
- connection(next, selectLines) {
2171
- const line1 = selectLines[0], line2 = selectLines[1], point = selectLines[0].getIntersection(selectLines[1]);
2172
- if (!point) return;
2173
- const oldLine1 = line1.points.map((p) => p.clone()), oldLine2 = line2.points.map((p) => p.clone());
2174
- if (line1.start.distance(point) < line1.end.distance(point)) {
2175
- line1.start.copy(point);
2176
- } else {
2177
- line1.end.copy(point);
2178
- }
2179
- if (line2.start.distance(point) < line2.end.distance(point)) {
2180
- line2.start.copy(point);
2181
- } else {
2182
- line2.end.copy(point);
2183
- }
2184
- const newLine1 = line1.points.map((p) => p.clone()), newLine2 = line2.points.map((p) => p.clone());
2185
- next({ line1, line2, oldLine1, oldLine2, newLine1, newLine2 });
2186
- ElMessage({ message: "连接成功", type: "success" });
1630
+ connection(e, t) {
1631
+ const n = t[0], o = t[1], s = t[0].getIntersection(t[1]);
1632
+ if (!s) return;
1633
+ const a = n.points.map((c) => c.clone()), i = o.points.map((c) => c.clone());
1634
+ n.start.distance(s) < n.end.distance(s) ? n.start.copy(s) : n.end.copy(s), o.start.distance(s) < o.end.distance(s) ? o.start.copy(s) : o.end.copy(s);
1635
+ const d = n.points.map((c) => c.clone()), l = o.points.map((c) => c.clone());
1636
+ e({ line1: n, line2: o, oldLine1: a, oldLine2: i, newLine1: d, newLine2: l }), k({ message: "连接成功", type: "success" });
2187
1637
  }
2188
1638
  /** 执行完成
2189
1639
  * @param next
2190
1640
  * @param selectLines
2191
1641
  */
2192
- completed({ line1, line2, newLine1, newLine2 }) {
2193
- this.renderManager.removeLine(line1);
2194
- this.renderManager.removeLine(line2);
2195
- line1.set(...newLine1);
2196
- line2.set(...newLine2);
2197
- this.renderManager.addLines([line1, line2]);
2198
- this.renderManager.draw();
1642
+ completed({ line1: e, line2: t, newLine1: n, newLine2: o }) {
1643
+ this.renderManager.removeLine(e), this.renderManager.removeLine(t), e.set(...n), t.set(...o), this.renderManager.addLines([e, t]), this.renderManager.draw();
2199
1644
  }
2200
1645
  /** 回滚操作
2201
1646
  * @param data
2202
1647
  */
2203
- rollback(data) {
2204
- const { line1, line2, oldLine1, oldLine2 } = data;
2205
- this.renderManager.removeLine(line1);
2206
- this.renderManager.removeLine(line2);
2207
- line1.set(...oldLine1);
2208
- line2.set(...oldLine2);
2209
- this.renderManager.addLines([line1, line2]);
2210
- this.renderManager.draw();
2211
- return data;
1648
+ rollback(e) {
1649
+ const { line1: t, line2: n, oldLine1: o, oldLine2: s } = e;
1650
+ return this.renderManager.removeLine(t), this.renderManager.removeLine(n), t.set(...o), n.set(...s), this.renderManager.addLines([t, n]), this.renderManager.draw(), e;
2212
1651
  }
2213
1652
  /** 撤回回滚
2214
1653
  * @param lines
2215
1654
  * @returns
2216
1655
  */
2217
- revokeRollback(data) {
2218
- this.completed(data);
2219
- return data;
1656
+ revokeRollback(e) {
1657
+ return this.completed(e), e;
2220
1658
  }
2221
1659
  }
2222
- class DeleteSelectWindow extends CommandFlowComponent {
1660
+ class Y extends T {
2223
1661
  static name = "DeleteSelectWindow";
2224
1662
  shortcutKeys = ["Q", "Delete"];
2225
1663
  static commandName = "deleteSelectWindow";
2226
- onAddFromParent(parent) {
2227
- super.onAddFromParent(parent);
2228
- const commandFlow = this.commandManager.addCommandFlow(DeleteSelectWindow.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.end.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
2229
- commandFlow.addEventListener("finally", this.createFinally());
2230
- commandFlow.addEventListener("completed", (e) => this.completed(e.data));
2231
- this.eventInput.addKeyCombination(DeleteSelectWindow.commandName, this.shortcutKeys);
2232
- this.eventInput.addEventListener("codeChange", async () => {
2233
- this.eventInput.isKeyCombination(DeleteSelectWindow.commandName) && await this.commandManager.start(DeleteSelectWindow.commandName, [...this.default.selectLines]);
2234
- });
2235
- this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
1664
+ onAddFromParent(e) {
1665
+ super.onAddFromParent(e);
1666
+ const t = this.commandManager.addCommandFlow(Y.commandName).add(this.createInterrupt()).add(this.constraint.bind(this)).add(this.end.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
1667
+ t.addEventListener("finally", this.createFinally()), t.addEventListener("completed", (n) => this.completed(n.data)), this.eventInput.addKeyCombination(Y.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => {
1668
+ this.eventInput.isKeyCombination(Y.commandName) && await this.commandManager.start(Y.commandName, [...this.default.selectLines]);
1669
+ }), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
2236
1670
  }
2237
1671
  /**
2238
1672
  * 进入命令约束
2239
1673
  */
2240
- constraint(next, selectLines) {
2241
- if (!Array.isArray(selectLines)) {
2242
- ElMessage({ message: "进入命令失败", type: "warning" });
2243
- this.cancel();
2244
- } else if (!selectLines.some((l) => l.userData.isWindow)) {
2245
- ElMessage({ message: "请选择有窗户线段", type: "warning" });
2246
- this.cancel();
2247
- } else {
2248
- next(selectLines);
2249
- }
1674
+ constraint(e, t) {
1675
+ Array.isArray(t) ? t.some((n) => n.userData.isWindow) ? e(t) : (k({ message: "请选择有窗户线段", type: "warning" }), this.cancel()) : (k({ message: "进入命令失败", type: "warning" }), this.cancel());
2250
1676
  }
2251
1677
  /** 开始
2252
1678
  * @param next
2253
1679
  */
2254
- end(next, selectLines) {
2255
- let is = false, list = [];
2256
- selectLines.forEach((line2) => {
2257
- if (!line2.userData.isWindow) return;
2258
- list.push({
2259
- line: line2,
2260
- drawDoorData: line2.userData.drawDoorData
2261
- });
2262
- is = true;
2263
- });
2264
- is && ElMessage({ message: "删除窗户成功", type: "success" });
2265
- next(list);
1680
+ end(e, t) {
1681
+ let n = !1, o = [];
1682
+ t.forEach((s) => {
1683
+ s.userData.isWindow && (o.push({
1684
+ line: s,
1685
+ drawDoorData: s.userData.drawDoorData
1686
+ }), n = !0);
1687
+ }), n && k({ message: "删除窗户成功", type: "success" }), e(o);
2266
1688
  }
2267
1689
  /**
2268
1690
  * 完成
2269
1691
  * @param list
2270
1692
  */
2271
- completed(list) {
2272
- list.forEach((item) => {
2273
- const userData = item.line.userData;
2274
- if (userData) {
2275
- delete userData.isWindow;
2276
- delete userData.drawDoorData;
2277
- }
2278
- });
2279
- this.renderManager.draw();
1693
+ completed(e) {
1694
+ e.forEach((t) => {
1695
+ const n = t.line.userData;
1696
+ n && (delete n.isWindow, delete n.drawDoorData);
1697
+ }), this.renderManager.draw();
2280
1698
  }
2281
1699
  /** 回滚操作
2282
1700
  * @param data
2283
1701
  */
2284
- rollback(list) {
2285
- list.forEach((item) => {
2286
- if (!item.line.userData) item.line.userData = {};
2287
- const userData = item.line.userData;
2288
- userData.isWindow = true;
2289
- userData.drawDoorData = item.drawDoorData;
2290
- });
2291
- this.renderManager.draw();
2292
- return list;
1702
+ rollback(e) {
1703
+ return e.forEach((t) => {
1704
+ t.line.userData || (t.line.userData = {});
1705
+ const n = t.line.userData;
1706
+ n.isWindow = !0, n.drawDoorData = t.drawDoorData;
1707
+ }), this.renderManager.draw(), e;
2293
1708
  }
2294
1709
  /** 撤回回滚
2295
1710
  * @param lines
2296
1711
  * @returns
2297
1712
  */
2298
- revokeRollback(list) {
2299
- this.completed(list);
2300
- return list;
1713
+ revokeRollback(e) {
1714
+ return this.completed(e), e;
2301
1715
  }
2302
1716
  }
2303
- class SelectAll extends CommandFlowComponent {
1717
+ class Z extends T {
2304
1718
  static name = "SelectAll";
2305
- container = new THREE.Group();
1719
+ container = new m.Group();
2306
1720
  shortcutKeys = ["control", "a"];
2307
1721
  static commandName = "selectAll";
2308
- onAddFromParent(parent) {
2309
- super.onAddFromParent(parent);
2310
- this.editor.container.add(this.container);
2311
- this.container.position.z = 1e-3;
2312
- const commandFlow = this.commandManager.addCommandFlow(SelectAll.commandName).add(this.createInterrupt()).add(this.selectAll.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
2313
- commandFlow.addEventListener("finally", this.createFinally());
2314
- commandFlow.addEventListener("completed", (e) => this.completed(e.data));
2315
- this.eventInput.addKeyCombination(SelectAll.commandName, this.shortcutKeys);
2316
- this.eventInput.addEventListener("codeChange", async () => {
2317
- this.eventInput.isKeyCombination(SelectAll.commandName) && await this.commandManager.start(SelectAll.commandName);
2318
- });
2319
- this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
1722
+ onAddFromParent(e) {
1723
+ super.onAddFromParent(e), this.editor.container.add(this.container), this.container.position.z = 1e-3;
1724
+ const t = this.commandManager.addCommandFlow(Z.commandName).add(this.createInterrupt()).add(this.selectAll.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
1725
+ t.writeOperationList = !1, t.addEventListener("finally", this.createFinally()), t.addEventListener("completed", (n) => this.completed(n.data)), this.eventInput.addKeyCombination(Z.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => {
1726
+ this.eventInput.isKeyCombination(Z.commandName) && await this.commandManager.start(Z.commandName);
1727
+ }), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
2320
1728
  }
2321
1729
  /** 开始
2322
1730
  * @param next
2323
1731
  */
2324
- selectAll(next) {
2325
- next([...this.renderManager.lines]);
1732
+ selectAll(e) {
1733
+ e([...this.renderManager.lines]);
2326
1734
  }
2327
1735
  /** 执行完成
2328
1736
  */
2329
- completed(lines) {
2330
- lines.map((line2) => this.default.addSelectLine(line2));
1737
+ completed(e) {
1738
+ e.map((t) => this.default.addSelectLine(t));
2331
1739
  }
2332
1740
  /** 回滚操作
2333
1741
  * @param lines
2334
1742
  */
2335
- rollback(lines) {
2336
- lines.map((line2) => this.default.removeSelectLine(line2));
2337
- return lines;
1743
+ rollback(e) {
1744
+ return e.map((t) => this.default.removeSelectLine(t)), e;
2338
1745
  }
2339
1746
  /** 撤回回滚
2340
1747
  * @param lines
2341
1748
  * @returns
2342
1749
  */
2343
- revokeRollback(lines) {
2344
- this.completed(lines);
2345
- return lines;
1750
+ revokeRollback(e) {
1751
+ return this.completed(e), e;
2346
1752
  }
2347
1753
  }
2348
- const _hoisted_1 = {
1754
+ const $n = {
2349
1755
  key: 0,
2350
1756
  class: "mt-[5px] text-[#ccc] text-[11px] absolute left-[10px] bottom-[10px] rounded-[8px] min-w-[150px] bg-black/15 p-[10px]"
2351
- };
2352
- const _hoisted_2 = { class: "text-start max-w-[150px]" };
2353
- const _hoisted_3 = { class: "inline-block ml-[10px] text-[var(--color-primary)]" };
2354
- const _hoisted_4 = {
1757
+ }, Hn = { class: "text-start max-w-[150px]" }, qn = { class: "inline-block ml-[10px] text-[var(--color-primary)]" }, Wn = {
2355
1758
  key: 0,
2356
1759
  class: "p-[5px] max-w-[200px]"
2357
- };
2358
- const _hoisted_5 = { class: "text-[14px] flex flex-col" };
2359
- const _hoisted_6 = ["onClick"];
2360
- const _hoisted_7 = { class: "flex flex-row items-center" };
2361
- const _hoisted_8 = { class: "flex justify-center items-center size-[20px] bg-[#f0f0f0] rounded-[2px] mr-[10px]" };
2362
- const _hoisted_9 = ["src"];
2363
- const _hoisted_10 = { class: "text-wrap" };
2364
- const _hoisted_11 = {
1760
+ }, Un = { class: "text-[14px] flex flex-col" }, Qn = ["onClick"], Yn = { class: "flex flex-row items-center" }, Zn = { class: "flex justify-center items-center size-[20px] bg-[#f0f0f0] rounded-[2px] mr-[10px]" }, Xn = ["src"], Jn = { class: "text-wrap" }, eo = {
2365
1761
  key: 1,
2366
1762
  class: "text-[#999]"
2367
- };
2368
- const _hoisted_12 = {
1763
+ }, to = {
2369
1764
  style: { "--el-color-primary": "var(--primary-color)" },
2370
1765
  class: "flex flex-row items-center justify-between gap-[10px] mt-[10px] text-[10px]"
2371
- };
2372
- const _hoisted_13 = {
1766
+ }, no = {
2373
1767
  key: 0,
2374
1768
  class: "flex flex-row items-center flex-wrap justify-between gap-[10px] mt-[10px] text-[10px]"
2375
- };
2376
- const _hoisted_14 = { class: "flex-wrap border-t-1 border-t-[#eee] mt-[5px] pt-[5px] flex items-center gap-[10px]" };
2377
- const _hoisted_15 = ["onClick", "title"];
2378
- const _hoisted_16 = ["src"];
2379
- const _sfc_main = /* @__PURE__ */ defineComponent({
1769
+ }, oo = { class: "flex-wrap border-t-1 border-t-[#eee] mt-[5px] pt-[5px] flex items-center gap-[10px]" }, so = ["onClick", "title"], ao = ["src"], ro = /* @__PURE__ */ oe({
2380
1770
  __name: "EditorTool",
2381
1771
  props: {
2382
1772
  dxfSystem: {},
2383
1773
  permission: {}
2384
1774
  },
2385
- setup(__props) {
2386
- function setEditorToolPosition(left, top, rect = elRef.value.getBoundingClientRect(), toolBarRect = toolBarRef.value.getBoundingClientRect()) {
2387
- const minX = 0, maxX = rect.width - toolBarRect.width, minY = 0, maxY = rect.height - toolBarRect.height;
2388
- left = Math.max(minX, Math.min(left, maxX));
2389
- top = Math.max(minY, Math.min(top, maxY));
2390
- toolBarPosition.value = { left, top };
1775
+ setup(r) {
1776
+ function e(g, u, p = h.value.getBoundingClientRect(), G = w.value.getBoundingClientRect()) {
1777
+ const re = p.width - G.width, ie = 0, xe = p.height - G.height;
1778
+ g = Math.max(0, Math.min(g, re)), u = Math.max(ie, Math.min(u, xe)), R.value = { left: g, top: u };
2391
1779
  }
2392
- function startCurrentCommandItem(item) {
2393
- if (currentCommand.value === item.command) return;
2394
- editor.commandManager.start(item.command);
1780
+ function t(g) {
1781
+ C.value === g.command || C.value !== "default" || D.commandManager.start(g.command);
2395
1782
  }
2396
- function setLines(lines) {
2397
- if (lines) {
2398
- localStorage.setItem("lines", JSON.stringify(lines));
1783
+ function n(g) {
1784
+ if (g) {
1785
+ localStorage.setItem("lines", JSON.stringify(g));
2399
1786
  try {
2400
- dxfSystem.Dxf.set(lines);
2401
- dxfSystem.Dxf.lineOffset();
2402
- } catch (error) {
2403
- console.log(error);
1787
+ b.Dxf.set(g), b.Dxf.lineOffset();
1788
+ } catch (u) {
1789
+ console.log(u);
2404
1790
  }
2405
1791
  }
2406
1792
  }
2407
- async function selectLocalFile() {
2408
- const data = await SelectLocalFile.json();
2409
- if (Array.isArray(data)) {
2410
- localStorage.removeItem("orbitControls");
2411
- setLines(data);
2412
- }
1793
+ async function o() {
1794
+ const g = await Et.json();
1795
+ Array.isArray(g) && (localStorage.removeItem("orbitControls"), n(g));
2413
1796
  }
2414
- function dragMoveHelper({ offsetX, offsetY }) {
2415
- domEventRegister.mouseMoveEventProxylock = true;
2416
- const cusor = document.body.style.cursor;
1797
+ function s({ offsetX: g, offsetY: u }) {
1798
+ P.mouseMoveEventProxylock = !0;
1799
+ const p = document.body.style.cursor;
2417
1800
  document.body.style.cursor = "move";
2418
- const move = (e) => {
2419
- const rect = elRef.value.getBoundingClientRect(), toolBarRect = toolBarRef.value.getBoundingClientRect();
2420
- setEditorToolPosition(
2421
- e.pageX - rect.left - offsetX,
2422
- e.pageY - rect.top - offsetY,
2423
- rect,
2424
- toolBarRect
2425
- );
2426
- e.stopPropagation();
2427
- document.body.style.cursor = "move";
2428
- };
2429
- const end = () => {
2430
- document.body.removeEventListener("mousemove", move);
2431
- document.removeEventListener("mouseup", end);
2432
- document.body.style.cursor = cusor;
2433
- domEventRegister.mouseMoveEventProxylock = false;
1801
+ const G = (re) => {
1802
+ const ie = h.value.getBoundingClientRect(), xe = w.value.getBoundingClientRect();
1803
+ e(
1804
+ re.pageX - ie.left - g,
1805
+ re.pageY - ie.top - u,
1806
+ ie,
1807
+ xe
1808
+ ), re.stopPropagation(), document.body.style.cursor = "move";
1809
+ }, be = () => {
1810
+ document.body.removeEventListener("mousemove", G), document.removeEventListener("mouseup", be), document.body.style.cursor = p, P.mouseMoveEventProxylock = !1;
2434
1811
  };
2435
- document.body.addEventListener("mousemove", move);
2436
- document.addEventListener("mouseup", end);
1812
+ document.body.addEventListener("mousemove", G), document.addEventListener("mouseup", be);
2437
1813
  }
2438
- const props = __props;
2439
- const originalLineVisible = ref(true), dxfVisible = ref(true), whiteModelVisible = ref(true), isLook = ref(false), elRef = ref(), toolBarRef = ref(), toolBarExpand = ref(true), currentCommand = ref(""), dxfSystem = toRaw(props.dxfSystem), domEventRegister = dxfSystem.findComponentByType(DomEventRegister), editor = dxfSystem.findComponentByType(Editor$1), defaultComponent = dxfSystem.findComponentByType(Default), whiteModel = dxfSystem.findComponentByType(WhiteModel), rollbackCount = ref(0), revokeRollbackCount = ref(0), toolBarPosition = ref({ left: 10, top: 10 }), images = /* @__PURE__ */ Object.assign({ "./assets/images/connection.svg": __vite_glob_0_0, "./assets/images/deleteSelectLine.svg": __vite_glob_0_1, "./assets/images/deleteSelectWindow.svg": __vite_glob_0_2, "./assets/images/door.svg": __vite_glob_0_3, "./assets/images/intersectionConnection.svg": __vite_glob_0_4, "./assets/images/line.svg": __vite_glob_0_5, "./assets/images/mergeLine.svg": __vite_glob_0_6, "./assets/images/revokeRollback.svg": __vite_glob_0_7, "./assets/images/rollback.svg": __vite_glob_0_8, "./assets/images/selectAll.svg": __vite_glob_0_9, "./assets/images/selectPoint.svg": __vite_glob_0_10, "./assets/images/verticalCorrection.svg": __vite_glob_0_11, "./assets/images/window.svg": __vite_glob_0_12 }), showShortcutKey = ref(false), selectLineCount = ref(0), hasWindowLine = ref(false), resizeObserver = new ResizeObserver(() => setEditorToolPosition(toolBarPosition.value.left, toolBarPosition.value.top)), shortcutKeys = [
2440
- { "name": "开启绘制线段命令", "shortcut": "Ctrl + L" },
2441
- { "name": "开启绘制门线命令", "shortcut": "Ctrl + M" },
2442
- { "name": "开启绘制窗户线命令", "shortcut": "Ctrl + Q" },
2443
- { "name": "开启点修改命令", "shortcut": "Ctrl + P" },
2444
- { "name": "线段方向移动线段点(点修改命令下)", "shortcut": "Shift + 移动" },
2445
- { "name": "删除线段", "shortcut": "选中 + Delete" },
2446
- { "name": "删除窗户线", "shortcut": "选中 + Q + Delete" },
2447
- { "name": "选中", "shortcut": "鼠标左键" },
2448
- { "name": "多选", "shortcut": "鼠标左键 + Ctrl" },
2449
- { "name": "取消选中", "shortcut": "鼠标左键 + Alt" },
2450
- { "name": "框选", "shortcut": "鼠标左键 + 移动" },
2451
- { "name": "线段同方向合并", "shortcut": "Ctrl + G" },
2452
- { "name": "线段连接", "shortcut": "选中 + Shift + L" },
2453
- { "name": "线段交点连接", "shortcut": "选中 + Ctrl + Shift + L" },
2454
- { "name": "命令确认", "shortcut": "Enter" },
2455
- { "name": "取消命令", "shortcut": "Esc" },
2456
- { "name": "回滚操作", "shortcut": "Ctrl + Z" },
2457
- { "name": "取消回滚操作", "shortcut": "Ctrl + Y" }
2458
- ], commandList = [
1814
+ const a = r, i = E(!0), d = E(!0), l = E(!0), c = E(!1), h = E(), w = E(), f = E(!0), C = E(""), b = Pt(a.dxfSystem), P = b.findComponentByType(Mt), D = b.findComponentByType(ot), j = b.findComponentByType(ke), se = b.findComponentByType(Lt), ue = E(0), X = E(0), R = E({ left: 10, top: 10 }), L = /* @__PURE__ */ Object.assign({ "./assets/images/connection.svg": fn, "./assets/images/deleteSelectLine.svg": yn, "./assets/images/deleteSelectWindow.svg": bn, "./assets/images/door.svg": Cn, "./assets/images/intersectionConnection.svg": En, "./assets/images/line.svg": _n, "./assets/images/mergeLine.svg": kn, "./assets/images/revokeRollback.svg": In, "./assets/images/rollback.svg": Nn, "./assets/images/selectAll.svg": Rn, "./assets/images/selectPoint.svg": Bn, "./assets/images/verticalCorrection.svg": Kn, "./assets/images/window.svg": Vn }), H = E(!1), y = E(0), we = E(!1), ae = new ResizeObserver(() => e(R.value.left, R.value.top)), st = [
1815
+ { name: "开启绘制线段命令", shortcut: "Ctrl + L" },
1816
+ { name: "开启绘制门线命令", shortcut: "Ctrl + M" },
1817
+ { name: "开启绘制窗户线命令", shortcut: "Ctrl + Q" },
1818
+ { name: "开启点修改命令", shortcut: "Ctrl + P" },
1819
+ { name: "线段方向移动线段点(点修改命令下)", shortcut: "Shift + 移动" },
1820
+ { name: "删除线段", shortcut: "选中 + Delete" },
1821
+ { name: "删除窗户线", shortcut: "选中 + Q + Delete" },
1822
+ { name: "选中", shortcut: "鼠标左键" },
1823
+ { name: "多选", shortcut: "鼠标左键 + Ctrl" },
1824
+ { name: "取消选中", shortcut: "鼠标左键 + Alt" },
1825
+ { name: "框选", shortcut: "鼠标左键 + 移动" },
1826
+ { name: "线段同方向合并", shortcut: "Ctrl + G" },
1827
+ { name: "线段连接", shortcut: "选中 + Shift + L" },
1828
+ { name: "线段交点连接", shortcut: "选中 + Ctrl + Shift + L" },
1829
+ { name: "垂直修正", shortcut: "Ctrl + C 或 Ctrl + Shift + C" },
1830
+ { name: "命令确认", shortcut: "Enter" },
1831
+ { name: "取消命令", shortcut: "Esc" },
1832
+ { name: "回滚操作", shortcut: "Ctrl + Z" },
1833
+ { name: "取消回滚操作", shortcut: "Ctrl + Y" }
1834
+ ], at = [
2459
1835
  {
2460
1836
  command: "default",
2461
1837
  name: "默认",
2462
- show: false,
1838
+ show: !1,
2463
1839
  shortcut: ""
2464
1840
  },
2465
1841
  {
2466
1842
  command: "draw-line",
2467
1843
  name: "绘制线段",
2468
- src: images["./assets/images/line.svg"].default,
2469
- show: true,
1844
+ src: L["./assets/images/line.svg"].default,
1845
+ show: !0,
2470
1846
  shortcut: "Ctrl + L"
2471
1847
  },
2472
1848
  {
2473
1849
  command: "draw-door-line",
2474
1850
  name: "绘制门线",
2475
- show: true,
2476
- src: images["./assets/images/door.svg"].default,
1851
+ show: !0,
1852
+ src: L["./assets/images/door.svg"].default,
2477
1853
  shortcut: "Ctrl + M"
2478
1854
  },
2479
1855
  {
2480
1856
  command: "draw-window-line",
2481
1857
  name: "绘制窗户线",
2482
- show: true,
2483
- src: images["./assets/images/window.svg"].default,
1858
+ show: !0,
1859
+ src: L["./assets/images/window.svg"].default,
2484
1860
  shortcut: "Ctrl + Q"
2485
1861
  },
2486
1862
  {
2487
1863
  command: "point",
2488
1864
  name: "点修改",
2489
- show: true,
2490
- src: images["./assets/images/selectPoint.svg"].default,
1865
+ show: !0,
1866
+ src: L["./assets/images/selectPoint.svg"].default,
2491
1867
  shortcut: "Ctrl + P"
2492
1868
  }
2493
- ], otherCommandList = [
1869
+ ], rt = [
2494
1870
  {
2495
1871
  command: "",
2496
1872
  name: "操作回滚",
2497
- src: images["./assets/images/rollback.svg"].default,
2498
- show: computed(() => rollbackCount.value !== 0),
1873
+ src: L["./assets/images/rollback.svg"].default,
1874
+ show: _(() => ue.value !== 0),
2499
1875
  shortcut: "Ctrl + Z",
2500
1876
  action() {
2501
- editor.commandManager.rollback();
1877
+ D.commandManager.rollback();
2502
1878
  }
2503
1879
  },
2504
1880
  {
2505
1881
  command: "",
2506
1882
  name: "撤销操作回滚",
2507
- src: images["./assets/images/revokeRollback.svg"].default,
2508
- show: computed(() => revokeRollbackCount.value !== 0),
1883
+ src: L["./assets/images/revokeRollback.svg"].default,
1884
+ show: _(() => X.value !== 0),
2509
1885
  shortcut: "Ctrl + Y",
2510
1886
  class: "rotateY-[180deg]",
2511
1887
  action() {
2512
- editor.commandManager.revokeRollback();
1888
+ D.commandManager.revokeRollback();
2513
1889
  }
2514
1890
  },
2515
1891
  {
2516
- command: MergeLine.commandName,
1892
+ command: q.commandName,
2517
1893
  name: "合并",
2518
- src: images["./assets/images/mergeLine.svg"].default,
2519
- show: computed(() => selectLineCount.value === 2),
1894
+ src: L["./assets/images/mergeLine.svg"].default,
1895
+ show: _(() => y.value === 2),
2520
1896
  shortcut: "Ctrl + G"
2521
1897
  },
2522
1898
  {
2523
- command: ConnectionLine.commandName,
1899
+ command: U.commandName,
2524
1900
  name: "两点连接",
2525
- show: computed(() => selectLineCount.value === 2),
2526
- src: images["./assets/images/connection.svg"].default,
1901
+ show: _(() => y.value === 2),
1902
+ src: L["./assets/images/connection.svg"].default,
2527
1903
  shortcut: "Shift + L"
2528
1904
  },
2529
1905
  {
2530
- command: IntersectionConnectionLine.commandName,
1906
+ command: Q.commandName,
2531
1907
  name: "延长线交点连接",
2532
- show: computed(() => selectLineCount.value === 2),
2533
- src: images["./assets/images/intersectionConnection.svg"].default,
1908
+ show: _(() => y.value === 2),
1909
+ src: L["./assets/images/intersectionConnection.svg"].default,
2534
1910
  shortcut: "Ctrl + Shift + L"
2535
1911
  },
2536
1912
  {
2537
- command: VerticalCorrection.commandName,
1913
+ command: ee.commandName,
2538
1914
  name: "线段垂直纠正",
2539
- show: computed(() => selectLineCount.value === 1),
2540
- src: images["./assets/images/verticalCorrection.svg"].default,
2541
- shortcut: "Ctrl + C"
1915
+ show: _(() => y.value === 1),
1916
+ src: L["./assets/images/verticalCorrection.svg"].default,
1917
+ shortcut: "Ctrl + C 或 Ctrl + Shift + C"
2542
1918
  },
2543
1919
  {
2544
- command: SelectAll.commandName,
1920
+ command: Z.commandName,
2545
1921
  name: "全选",
2546
- show: computed(() => selectLineCount.value !== editor.renderManager.lines.length),
2547
- src: images["./assets/images/selectAll.svg"].default,
1922
+ show: _(() => y.value !== D.renderManager.lines.length),
1923
+ src: L["./assets/images/selectAll.svg"].default,
2548
1924
  shortcut: "Ctrl + A"
2549
1925
  },
2550
1926
  {
2551
- command: DeleteSelectWindow.commandName,
1927
+ command: Y.commandName,
2552
1928
  name: "清除窗户",
2553
- show: computed(() => hasWindowLine.value),
2554
- src: images["./assets/images/deleteSelectWindow.svg"].default,
1929
+ show: _(() => we.value),
1930
+ src: L["./assets/images/deleteSelectWindow.svg"].default,
2555
1931
  shortcut: "Q + Delete"
2556
1932
  },
2557
1933
  {
2558
- command: DeleteSelectLine.commandName,
1934
+ command: W.commandName,
2559
1935
  name: "删除",
2560
- show: computed(() => selectLineCount.value > 0),
2561
- src: images["./assets/images/deleteSelectLine.svg"].default,
1936
+ show: _(() => y.value > 0),
1937
+ src: L["./assets/images/deleteSelectLine.svg"].default,
2562
1938
  shortcut: "Delete"
2563
1939
  }
2564
1940
  ];
2565
- watch(toolBarPosition, () => localStorage.setItem("editorToolPosition", JSON.stringify(toolBarPosition.value)));
2566
- watch(showShortcutKey, () => localStorage.setItem("showShortcutKey", showShortcutKey.value + ""));
2567
- watch(toolBarExpand, () => {
2568
- localStorage.setItem("toolBarExpand", toolBarExpand.value + "");
2569
- if (toolBarExpand.value) {
2570
- nextTick(() => setEditorToolPosition(toolBarPosition.value.left, toolBarPosition.value.top));
2571
- }
2572
- });
2573
- watch(originalLineVisible, () => dxfSystem.Variable.set("originalLineVisible", originalLineVisible.value));
2574
- watch(dxfVisible, () => dxfSystem.Variable.set("dxfVisible", dxfVisible.value));
2575
- watch(whiteModelVisible, () => dxfSystem.Variable.set("whiteModelVisible", whiteModelVisible.value));
2576
- dxfSystem.Variable.addEventListener("isLook", (e) => isLook.value = e.value);
2577
- dxfSystem.Variable.addEventListener("originalLineVisible", (e) => originalLineVisible.value = e.value);
2578
- dxfSystem.Variable.addEventListener("dxfVisible", (e) => dxfVisible.value = e.value);
2579
- dxfSystem.Variable.addEventListener("whiteModelVisible", (e) => whiteModelVisible.value = e.value);
2580
- const startedEventCancel = editor.commandManager.addEventListener("started", (e) => {
2581
- currentCommand.value = e.name;
1941
+ V(R, () => localStorage.setItem("editorToolPosition", JSON.stringify(R.value))), V(H, () => localStorage.setItem("showShortcutKey", H.value + "")), V(f, () => {
1942
+ localStorage.setItem("toolBarExpand", f.value + ""), f.value && ve(() => e(R.value.left, R.value.top));
1943
+ }), V(i, () => b.Variable.set("originalLineVisible", i.value)), V(d, () => b.Variable.set("dxfVisible", d.value)), V(l, () => b.Variable.set("whiteModelVisible", l.value)), b.Variable.addEventListener("isLook", (g) => c.value = g.value), b.Variable.addEventListener("originalLineVisible", (g) => i.value = g.value), b.Variable.addEventListener("dxfVisible", (g) => d.value = g.value), b.Variable.addEventListener("whiteModelVisible", (g) => l.value = g.value);
1944
+ const it = D.commandManager.addEventListener("started", (g) => {
1945
+ C.value = g.name;
2582
1946
  });
2583
- if (localStorage.getItem("showShortcutKey")) {
2584
- showShortcutKey.value = localStorage.getItem("showShortcutKey") === "true";
2585
- }
2586
- if (localStorage.getItem("toolBarExpand")) {
2587
- toolBarExpand.value = localStorage.getItem("toolBarExpand") === "true";
2588
- }
2589
- onMounted(() => {
2590
- toolBarRef.value.style.display = "none";
2591
- setTimeout(() => {
2592
- toolBarRef.value.style.display = "block";
2593
- if (localStorage.getItem("editorToolPosition")) {
2594
- const { left, top } = JSON.parse(localStorage.getItem("editorToolPosition") ?? "{}");
2595
- setEditorToolPosition(left, top);
2596
- nextTick(() => resizeObserver.observe(elRef.value));
2597
- } else {
2598
- nextTick(() => resizeObserver.observe(elRef.value));
2599
- }
2600
- }, 100);
2601
- defaultComponent.addEventListener("selectLineChange", () => {
2602
- selectLineCount.value = defaultComponent.selectLines.length;
2603
- hasWindowLine.value = defaultComponent.selectLines.some((l) => l.userData.isWindow);
2604
- });
2605
- ["rollback", "completed", "revokeRollback"].forEach((key) => {
2606
- editor.commandManager.addEventListener(key, () => {
1947
+ return localStorage.getItem("showShortcutKey") && (H.value = localStorage.getItem("showShortcutKey") === "true"), localStorage.getItem("toolBarExpand") && (f.value = localStorage.getItem("toolBarExpand") === "true"), Ze(() => {
1948
+ w.value.style.display = "none", setTimeout(() => {
1949
+ if (w.value.style.display = "block", localStorage.getItem("editorToolPosition")) {
1950
+ const { left: g, top: u } = JSON.parse(localStorage.getItem("editorToolPosition") ?? "{}");
1951
+ e(g, u), ve(() => ae.observe(h.value));
1952
+ } else
1953
+ ve(() => ae.observe(h.value));
1954
+ }, 100), j.addEventListener("selectLineChange", () => {
1955
+ y.value = j.selectLines.length, we.value = j.selectLines.some((g) => g.userData.isWindow);
1956
+ }), ["rollback", "completed", "revokeRollback"].forEach((g) => {
1957
+ D.commandManager.addEventListener(g, () => {
2607
1958
  setTimeout(() => {
2608
- rollbackCount.value = editor.commandManager.operationList.length;
2609
- revokeRollbackCount.value = editor.commandManager.rollbackList.length;
1959
+ ue.value = D.commandManager.operationList.length, X.value = D.commandManager.rollbackList.length;
2610
1960
  });
2611
1961
  });
2612
1962
  });
2613
- });
2614
- onUnmounted(() => {
2615
- domEventRegister.mouseMoveEventProxylock = false;
2616
- startedEventCancel();
2617
- resizeObserver.disconnect();
2618
- });
2619
- return (_ctx, _cache) => {
2620
- return openBlock(), createElementBlock("div", {
2621
- ref_key: "elRef",
2622
- ref: elRef,
2623
- class: "editorTool pointer-events-none overflow-hidden absolute left-0 top-0 w-full h-full z-[20] flex flex-row justify-between p-[5px] box-border select-none pointer-events-[all]"
1963
+ }), It(() => {
1964
+ P.mouseMoveEventProxylock = !1, it(), ae.disconnect();
1965
+ }), (g, u) => (M(), S("div", {
1966
+ ref_key: "elRef",
1967
+ ref: h,
1968
+ class: "editorTool pointer-events-none overflow-hidden absolute left-0 top-0 w-full h-full z-[20] flex flex-row justify-between p-[5px] box-border select-none pointer-events-[all]"
1969
+ }, [
1970
+ z(ge, null, {
1971
+ default: F(() => [
1972
+ H.value ? (M(), S("div", $n, [
1973
+ (M(), S(ce, null, Me(st, (p) => x("div", {
1974
+ class: "p-[4px_0px] flex justify-between text-right border-b-1 border-b-[rgba(255,255,255,0.1)] last-of-type:border-b-0",
1975
+ key: p.name
1976
+ }, [
1977
+ x("p", Hn, J(p.name), 1),
1978
+ x("span", qn, J(p.shortcut), 1)
1979
+ ])), 64))
1980
+ ])) : $("", !0)
1981
+ ]),
1982
+ _: 1
1983
+ }),
1984
+ x("div", {
1985
+ ref_key: "toolBarRef",
1986
+ ref: w,
1987
+ style: De({ left: R.value.left + "px", top: R.value.top + "px" }),
1988
+ class: O(["overflow-hidden pointer-events-auto w-fit max-w-[260px] transition-[border-radius] text-[#333] absolute z-[11] bg-white select-none", { "rounded-[8px] ": f.value }]),
1989
+ onMousedown: u[8] || (u[8] = (p) => p.stopPropagation())
2624
1990
  }, [
2625
- createVNode(Transition, null, {
2626
- default: withCtx(() => [
2627
- showShortcutKey.value ? (openBlock(), createElementBlock("div", _hoisted_1, [
2628
- (openBlock(), createElementBlock(Fragment, null, renderList(shortcutKeys, (item) => {
2629
- return createElementVNode("div", {
2630
- class: "p-[4px_0px] flex justify-between text-right border-b-1 border-b-[rgba(255,255,255,0.1)] last-of-type:border-b-0",
2631
- key: item.name
2632
- }, [
2633
- createElementVNode("p", _hoisted_2, toDisplayString(item.name), 1),
2634
- createElementVNode("span", _hoisted_3, toDisplayString(item.shortcut), 1)
2635
- ]);
2636
- }), 64))
2637
- ])) : createCommentVNode("", true)
2638
- ]),
2639
- _: 1
2640
- }),
2641
- createElementVNode("div", {
2642
- ref_key: "toolBarRef",
2643
- ref: toolBarRef,
2644
- style: normalizeStyle({ left: toolBarPosition.value.left + "px", top: toolBarPosition.value.top + "px" }),
2645
- class: normalizeClass(["overflow-hidden pointer-events-auto w-fit max-w-[260px] transition-[border-radius] text-[#333] absolute z-[11] bg-white select-none", { "rounded-[8px] ": toolBarExpand.value }]),
2646
- onMousedown: _cache[8] || (_cache[8] = (e) => e.stopPropagation())
1991
+ x("div", {
1992
+ onMousedown: s,
1993
+ class: O([{ "border-b-[#eee] border-b-1": f.value }, "flex flex-row justify-between header text-[14px] font-bold p-[10px 0px]"])
2647
1994
  }, [
2648
- createElementVNode("div", {
2649
- onMousedown: dragMoveHelper,
2650
- class: normalizeClass([{ "border-b-[#eee] border-b-1": toolBarExpand.value }, "flex flex-row justify-between header text-[14px] font-bold p-[10px 0px]"])
1995
+ u[10] || (u[10] = St('<div class="flex flex-row" data-v-fb4f87a4><div class="p-[2px_5px] flex items-center pointer-events-none" data-v-fb4f87a4><svg fill="#aaa" width="20" height="20" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" data-v-fb4f87a4><path d="M341.333333 298.666667a85.333333 85.333333 0 1 0 0-170.666667 85.333333 85.333333 0 0 0 0 170.666667z m0 298.666666a85.333333 85.333333 0 1 0 0-170.666666 85.333333 85.333333 0 0 0 0 170.666666z m85.333334 213.333334a85.333333 85.333333 0 1 1-170.666667 0 85.333333 85.333333 0 0 1 170.666667 0z m256-512a85.333333 85.333333 0 1 0 0-170.666667 85.333333 85.333333 0 0 0 0 170.666667z m85.333333 213.333333a85.333333 85.333333 0 1 1-170.666667 0 85.333333 85.333333 0 0 1 170.666667 0z m-85.333333 384a85.333333 85.333333 0 1 0 0-170.666667 85.333333 85.333333 0 0 0 0 170.666667z" data-v-fb4f87a4></path></svg></div><h5 class="flex text-nowrap text-[12px] items-center pointer-events-none" data-v-fb4f87a4>绘制工具</h5></div>', 1)),
1996
+ x("div", {
1997
+ onMousedown: u[0] || (u[0] = (p) => p.stopPropagation()),
1998
+ onClick: u[1] || (u[1] = (p) => f.value = !f.value),
1999
+ class: "cursor-pointer flex items-center p-[0px_5px]"
2651
2000
  }, [
2652
- _cache[10] || (_cache[10] = createStaticVNode('<div class="flex flex-row" data-v-953dfd98><div class="p-[2px_5px] flex items-center pointer-events-none" data-v-953dfd98><svg fill="#aaa" width="20" height="20" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" data-v-953dfd98><path d="M341.333333 298.666667a85.333333 85.333333 0 1 0 0-170.666667 85.333333 85.333333 0 0 0 0 170.666667z m0 298.666666a85.333333 85.333333 0 1 0 0-170.666666 85.333333 85.333333 0 0 0 0 170.666666z m85.333334 213.333334a85.333333 85.333333 0 1 1-170.666667 0 85.333333 85.333333 0 0 1 170.666667 0z m256-512a85.333333 85.333333 0 1 0 0-170.666667 85.333333 85.333333 0 0 0 0 170.666667z m85.333333 213.333333a85.333333 85.333333 0 1 1-170.666667 0 85.333333 85.333333 0 0 1 170.666667 0z m-85.333333 384a85.333333 85.333333 0 1 0 0-170.666667 85.333333 85.333333 0 0 0 0 170.666667z" data-v-953dfd98></path></svg></div><h5 class="flex text-nowrap text-[12px] items-center pointer-events-none" data-v-953dfd98>绘制工具</h5></div>', 1)),
2653
- createElementVNode("div", {
2654
- onMousedown: _cache[0] || (_cache[0] = (e) => e.stopPropagation()),
2655
- onClick: _cache[1] || (_cache[1] = ($event) => toolBarExpand.value = !toolBarExpand.value),
2656
- class: "cursor-pointer flex items-center p-[0px_5px]"
2001
+ (M(), S("svg", {
2002
+ fill: "#666",
2003
+ class: O([{ "rotate-90": f.value }, "transition-all"]),
2004
+ viewBox: "0 0 1024 1024",
2005
+ version: "1.1",
2006
+ xmlns: "http://www.w3.org/2000/svg",
2007
+ width: "12",
2008
+ height: "12"
2009
+ }, u[9] || (u[9] = [
2010
+ x("path", { d: "M315.050667 938.666667a60.757333 60.757333 0 0 0 41.813333-16.298667L750.933333 551.338667a53.418667 53.418667 0 0 0 0-78.677334L356.864 101.632a61.696 61.696 0 0 0-83.541333 0 53.418667 53.418667 0 0 0-0.256 78.677333L625.408 512 273.066667 843.690667a53.418667 53.418667 0 0 0 0 78.677333 60.757333 60.757333 0 0 0 41.984 16.298667z" }, null, -1)
2011
+ ]), 2))
2012
+ ], 32)
2013
+ ], 34),
2014
+ f.value ? (M(), S("div", Wn, [
2015
+ x("ul", Un, [
2016
+ (M(), S(ce, null, Me(at, (p) => (M(), S(ce, {
2017
+ key: p.command
2657
2018
  }, [
2658
- (openBlock(), createElementBlock("svg", {
2659
- fill: "#666",
2660
- class: normalizeClass([{ "rotate-90": toolBarExpand.value }, "transition-all"]),
2661
- viewBox: "0 0 1024 1024",
2662
- version: "1.1",
2663
- xmlns: "http://www.w3.org/2000/svg",
2664
- width: "12",
2665
- height: "12"
2666
- }, _cache[9] || (_cache[9] = [
2667
- createElementVNode("path", { d: "M315.050667 938.666667a60.757333 60.757333 0 0 0 41.813333-16.298667L750.933333 551.338667a53.418667 53.418667 0 0 0 0-78.677334L356.864 101.632a61.696 61.696 0 0 0-83.541333 0 53.418667 53.418667 0 0 0-0.256 78.677333L625.408 512 273.066667 843.690667a53.418667 53.418667 0 0 0 0 78.677333 60.757333 60.757333 0 0 0 41.984 16.298667z" }, null, -1)
2668
- ]), 2))
2669
- ], 32)
2670
- ], 34),
2671
- toolBarExpand.value ? (openBlock(), createElementBlock("div", _hoisted_4, [
2672
- createElementVNode("ul", _hoisted_5, [
2673
- (openBlock(), createElementBlock(Fragment, null, renderList(commandList, (item) => {
2674
- return openBlock(), createElementBlock(Fragment, {
2675
- key: item.command
2676
- }, [
2677
- item.show ? (openBlock(), createElementBlock("li", {
2678
- key: 0,
2679
- onClick: ($event) => startCurrentCommandItem(item),
2680
- class: normalizeClass([{ "!bg-[var(--primary-color)] text-[#fff]": currentCommand.value === item.command }, "gap-[10px] text-[12px] hover:bg-[#ddd] transition-all rounded-[6px] p-[5px] flex flex-row items-center justify-between cursor-pointer"])
2019
+ p.show ? (M(), S("li", {
2020
+ key: 0,
2021
+ onClick: (G) => t(p),
2022
+ class: O([{
2023
+ "!bg-[var(--primary-color)] text-[#fff]": C.value === p.command,
2024
+ "!cursor-no-drop": C.value !== p.command && C.value !== "default"
2025
+ }, "gap-[10px] text-[12px] hover:bg-[#ddd] transition-all rounded-[6px] p-[5px] flex flex-row items-center justify-between cursor-pointer"])
2026
+ }, [
2027
+ x("div", Yn, [
2028
+ x("div", Zn, [
2029
+ x("img", {
2030
+ class: "size-[14px]",
2031
+ src: p.src,
2032
+ alt: "",
2033
+ srcset: ""
2034
+ }, null, 8, Xn)
2035
+ ]),
2036
+ x("span", Jn, J(p.name), 1)
2037
+ ]),
2038
+ C.value === p.command ? (M(), S("div", {
2039
+ key: 0,
2040
+ title: "取消命令(Esc)",
2041
+ class: "active:scale-[0.7] transition-all",
2042
+ onClick: u[2] || (u[2] = (G) => (v(D).cancelCommand(), G.stopPropagation()))
2043
+ }, u[11] || (u[11] = [
2044
+ x("svg", {
2045
+ fill: "#fff",
2046
+ width: "16",
2047
+ height: "16",
2048
+ viewBox: "0 0 1024 1024",
2049
+ version: "1.1",
2050
+ xmlns: "http://www.w3.org/2000/svg"
2681
2051
  }, [
2682
- createElementVNode("div", _hoisted_7, [
2683
- createElementVNode("div", _hoisted_8, [
2684
- createElementVNode("img", {
2685
- class: "size-[14px]",
2686
- src: item.src,
2687
- alt: "",
2688
- srcset: ""
2689
- }, null, 8, _hoisted_9)
2690
- ]),
2691
- createElementVNode("span", _hoisted_10, toDisplayString(item.name), 1)
2692
- ]),
2693
- currentCommand.value === item.command ? (openBlock(), createElementBlock("div", {
2694
- key: 0,
2695
- title: "取消命令(Esc)",
2696
- class: "active:scale-[0.7] transition-all",
2697
- onClick: _cache[2] || (_cache[2] = (e) => (unref(editor).cancelCommand(), e.stopPropagation()))
2698
- }, _cache[11] || (_cache[11] = [
2699
- createElementVNode("svg", {
2700
- fill: "#fff",
2701
- width: "16",
2702
- height: "16",
2703
- viewBox: "0 0 1024 1024",
2704
- version: "1.1",
2705
- xmlns: "http://www.w3.org/2000/svg"
2706
- }, [
2707
- createElementVNode("path", { d: "M511.104 0C228.821333 0 0 228.821333 0 511.104c0 282.282667 228.821333 511.104 511.104 511.104 282.282667 0 511.104-228.842667 511.104-511.104C1022.208 228.821333 793.386667 0 511.104 0zM511.104 898.496c-213.973333 0-387.434667-173.44-387.434667-387.413333 0-213.952 173.44-387.413333 387.434667-387.413333 213.952 0 387.392 173.44 387.392 387.413333C898.496 725.056 725.056 898.496 511.104 898.496z" }),
2708
- createElementVNode("path", { d: "M236.437333 463.914667l549.333333 0 0 96.874667-549.333333 0 0-96.874667Z" })
2709
- ], -1)
2710
- ]))) : item.shortcut ? (openBlock(), createElementBlock("div", _hoisted_11, toDisplayString(item.shortcut), 1)) : createCommentVNode("", true)
2711
- ], 10, _hoisted_6)) : createCommentVNode("", true)
2712
- ], 64);
2713
- }), 64))
2714
- ]),
2715
- createElementVNode("div", _hoisted_12, [
2716
- createVNode(unref(ElCheckbox), {
2717
- size: "small",
2718
- modelValue: showShortcutKey.value,
2719
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => showShortcutKey.value = $event),
2720
- label: "快捷键提示"
2721
- }, null, 8, ["modelValue"]),
2722
- createVNode(unref(ElCheckbox), {
2723
- size: "small",
2724
- modelValue: dxfVisible.value,
2725
- "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => dxfVisible.value = $event),
2726
- label: "dxf"
2727
- }, null, 8, ["modelValue"])
2728
- ]),
2729
- _ctx.permission === "admin" ? (openBlock(), createElementBlock("div", _hoisted_13, [
2730
- createVNode(unref(ElButton), {
2731
- style: { "padding": "5px", "font-size": "10px" },
2732
- size: "small",
2733
- type: "success",
2734
- onClick: selectLocalFile
2735
- }, {
2736
- default: withCtx(() => _cache[12] || (_cache[12] = [
2737
- createTextVNode(" 选择文件 ", -1)
2738
- ])),
2739
- _: 1,
2740
- __: [12]
2741
- }),
2742
- createVNode(unref(ElButton), {
2743
- style: { "padding": "5px", "font-size": "10px" },
2744
- size: "small",
2745
- type: "primary",
2746
- onClick: _cache[5] || (_cache[5] = ($event) => console.log(unref(dxfSystem).Dxf.originalData))
2747
- }, {
2748
- default: withCtx(() => _cache[13] || (_cache[13] = [
2749
- createTextVNode(" 打印Json ", -1)
2750
- ])),
2751
- _: 1,
2752
- __: [13]
2753
- }),
2754
- createVNode(unref(ElButton), {
2755
- style: { "padding": "5px", "font-size": "10px" },
2756
- size: "small",
2757
- type: "primary",
2758
- onClick: _cache[6] || (_cache[6] = ($event) => unref(dxfSystem).Dxf.download("test.dxf"))
2759
- }, {
2760
- default: withCtx(() => _cache[14] || (_cache[14] = [
2761
- createTextVNode(" 下载DXF ", -1)
2762
- ])),
2763
- _: 1,
2764
- __: [14]
2765
- }),
2766
- createVNode(unref(ElButton), {
2767
- style: { "padding": "5px", "font-size": "10px" },
2768
- size: "small",
2769
- type: "primary",
2770
- onClick: _cache[7] || (_cache[7] = ($event) => unref(whiteModel).downloadGltf("test.glb", true))
2771
- }, {
2772
- default: withCtx(() => _cache[15] || (_cache[15] = [
2773
- createTextVNode(" 下载白膜 ", -1)
2774
- ])),
2775
- _: 1,
2776
- __: [15]
2777
- })
2778
- ])) : createCommentVNode("", true),
2779
- createVNode(Transition, null, {
2780
- default: withCtx(() => [
2781
- createElementVNode("div", _hoisted_14, [
2782
- createVNode(TransitionGroup, null, {
2783
- default: withCtx(() => [
2784
- (openBlock(), createElementBlock(Fragment, null, renderList(otherCommandList, (item) => {
2785
- return createElementVNode("div", {
2786
- onClick: ($event) => item.show.value && (item.action ? item.action() : unref(editor).commandManager.start(item.command, [...unref(defaultComponent).selectLines])),
2787
- title: `${item.name}(${item.shortcut})`,
2788
- class: normalizeClass(["size-[20px] flex justify-center items-center relative overflow-hidden active:scale-[0.8] border-1 border-[#ccc] rounded-[4px] transition-all cursor-pointer", { "opacity-30 bg-[#ccc] !cursor-no-drop active:!scale-[1]": !item.show.value, [item.class ?? ""]: true }]),
2789
- key: item.command
2790
- }, [
2791
- createElementVNode("img", {
2792
- class: "size-[14px]",
2793
- src: item.src
2794
- }, null, 8, _hoisted_16)
2795
- ], 10, _hoisted_15);
2796
- }), 64))
2797
- ]),
2798
- _: 1
2799
- })
2800
- ])
2801
- ]),
2802
- _: 1
2052
+ x("path", { d: "M511.104 0C228.821333 0 0 228.821333 0 511.104c0 282.282667 228.821333 511.104 511.104 511.104 282.282667 0 511.104-228.842667 511.104-511.104C1022.208 228.821333 793.386667 0 511.104 0zM511.104 898.496c-213.973333 0-387.434667-173.44-387.434667-387.413333 0-213.952 173.44-387.413333 387.434667-387.413333 213.952 0 387.392 173.44 387.392 387.413333C898.496 725.056 725.056 898.496 511.104 898.496z" }),
2053
+ x("path", { d: "M236.437333 463.914667l549.333333 0 0 96.874667-549.333333 0 0-96.874667Z" })
2054
+ ], -1)
2055
+ ]))) : p.shortcut ? (M(), S("div", eo, J(p.shortcut), 1)) : $("", !0)
2056
+ ], 10, Qn)) : $("", !0)
2057
+ ], 64))), 64))
2058
+ ]),
2059
+ x("div", to, [
2060
+ z(v(Oe), {
2061
+ size: "small",
2062
+ modelValue: H.value,
2063
+ "onUpdate:modelValue": u[3] || (u[3] = (p) => H.value = p),
2064
+ label: "快捷键提示"
2065
+ }, null, 8, ["modelValue"]),
2066
+ z(v(Oe), {
2067
+ size: "small",
2068
+ modelValue: d.value,
2069
+ "onUpdate:modelValue": u[4] || (u[4] = (p) => d.value = p),
2070
+ label: "dxf"
2071
+ }, null, 8, ["modelValue"])
2072
+ ]),
2073
+ g.permission === "admin" ? (M(), S("div", no, [
2074
+ z(v(pe), {
2075
+ style: { padding: "5px", "font-size": "10px" },
2076
+ size: "small",
2077
+ type: "success",
2078
+ onClick: o
2079
+ }, {
2080
+ default: F(() => u[12] || (u[12] = [
2081
+ le(" 选择文件 ", -1)
2082
+ ])),
2083
+ _: 1,
2084
+ __: [12]
2085
+ }),
2086
+ z(v(pe), {
2087
+ style: { padding: "5px", "font-size": "10px" },
2088
+ size: "small",
2089
+ type: "primary",
2090
+ onClick: u[5] || (u[5] = (p) => console.log(v(b).Dxf.originalData))
2091
+ }, {
2092
+ default: F(() => u[13] || (u[13] = [
2093
+ le(" 打印Json ", -1)
2094
+ ])),
2095
+ _: 1,
2096
+ __: [13]
2097
+ }),
2098
+ z(v(pe), {
2099
+ style: { padding: "5px", "font-size": "10px" },
2100
+ size: "small",
2101
+ type: "primary",
2102
+ onClick: u[6] || (u[6] = (p) => v(b).Dxf.download("test.dxf"))
2103
+ }, {
2104
+ default: F(() => u[14] || (u[14] = [
2105
+ le(" 下载DXF ", -1)
2106
+ ])),
2107
+ _: 1,
2108
+ __: [14]
2109
+ }),
2110
+ z(v(pe), {
2111
+ style: { padding: "5px", "font-size": "10px" },
2112
+ size: "small",
2113
+ type: "primary",
2114
+ onClick: u[7] || (u[7] = (p) => v(se).downloadGltf("test.glb", !0))
2115
+ }, {
2116
+ default: F(() => u[15] || (u[15] = [
2117
+ le(" 下载白膜 ", -1)
2118
+ ])),
2119
+ _: 1,
2120
+ __: [15]
2803
2121
  })
2804
- ])) : createCommentVNode("", true)
2805
- ], 38)
2806
- ], 512);
2807
- };
2808
- }
2809
- });
2810
- const _export_sfc = (sfc, props) => {
2811
- const target = sfc.__vccOpts || sfc;
2812
- for (const [key, val] of props) {
2813
- target[key] = val;
2814
- }
2815
- return target;
2816
- };
2817
- const EditorTool = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-953dfd98"]]);
2818
- let Editor$1 = class Editor extends Component {
2122
+ ])) : $("", !0),
2123
+ z(ge, null, {
2124
+ default: F(() => [
2125
+ x("div", oo, [
2126
+ z(Nt, null, {
2127
+ default: F(() => [
2128
+ (M(), S(ce, null, Me(rt, (p) => x("div", {
2129
+ onClick: (G) => p.show.value && C.value === "default" && (p.action ? p.action() : v(D).commandManager.start(p.command, [...v(j).selectLines])),
2130
+ title: `${p.name}(${p.shortcut})`,
2131
+ class: O(["size-[20px] flex justify-center items-center relative overflow-hidden active:scale-[0.8] border-1 border-[#ccc] rounded-[4px] transition-all cursor-pointer", {
2132
+ "opacity-30 bg-[#ccc] !cursor-no-drop active:!scale-[1]": !p.show.value || C.value !== "default",
2133
+ [p.class ?? ""]: !0
2134
+ }]),
2135
+ key: p.command
2136
+ }, [
2137
+ x("img", {
2138
+ class: "size-[14px]",
2139
+ src: p.src
2140
+ }, null, 8, ao)
2141
+ ], 10, so)), 64))
2142
+ ]),
2143
+ _: 1
2144
+ })
2145
+ ])
2146
+ ]),
2147
+ _: 1
2148
+ })
2149
+ ])) : $("", !0)
2150
+ ], 38)
2151
+ ], 512));
2152
+ }
2153
+ }), io = (r, e) => {
2154
+ const t = r.__vccOpts || r;
2155
+ for (const [n, o] of e)
2156
+ t[n] = o;
2157
+ return t;
2158
+ }, lo = /* @__PURE__ */ io(ro, [["__scopeId", "data-v-fb4f87a4"]]);
2159
+ let ot = class extends ye {
2819
2160
  static name = "Editor";
2820
- container = new THREE.Group();
2161
+ container = new m.Group();
2821
2162
  get renderer() {
2822
2163
  return this.parent?.findComponentByName("Renderer");
2823
2164
  }
@@ -2839,32 +2180,23 @@ let Editor$1 = class Editor extends Component {
2839
2180
  get domContainer() {
2840
2181
  return this.parent?.findComponentByName("DomContainer");
2841
2182
  }
2842
- commandManager = new CommandManager();
2843
- plane = new THREE.Mesh(new THREE.PlaneGeometry(2e3, 2e3, 2, 2));
2183
+ commandManager = new pn();
2184
+ plane = new m.Mesh(new m.PlaneGeometry(2e3, 2e3, 2, 2));
2844
2185
  app;
2845
2186
  domElement = document.createElement("div");
2846
2187
  viewPermission;
2847
- constructor(viewPermission) {
2848
- super();
2849
- this.viewPermission = viewPermission;
2188
+ constructor(e) {
2189
+ super(), this.viewPermission = e;
2850
2190
  }
2851
2191
  onAddFromParent() {
2852
2192
  setTimeout(() => this.openEdit(), 10);
2853
- const grid = new THREE.GridHelper(200, 100, 6710886, 4473924);
2854
- grid.rotation.x = Math.PI * 0.5;
2855
- grid.position.z = -0.01;
2856
- this.container.add(grid);
2857
- this.container.add(this.plane);
2858
- this.plane.visible = false;
2859
- const cancelEvent = this.addEventListener("update", () => {
2860
- if (this.domContainer.domElement.parentElement) {
2861
- this.domContainer.domElement.parentElement.appendChild(this.domElement);
2862
- cancelEvent();
2863
- }
2193
+ const e = new m.GridHelper(200, 100, 6710886, 4473924);
2194
+ e.rotation.x = Math.PI * 0.5, e.position.z = -0.01, this.container.add(e), this.container.add(this.plane), this.plane.visible = !1;
2195
+ const t = this.addEventListener("update", () => {
2196
+ this.domContainer.domElement.parentElement && (this.domContainer.domElement.parentElement.appendChild(this.domElement), t());
2864
2197
  });
2865
2198
  setTimeout(() => {
2866
- this.app = createApp(EditorTool, { dxfSystem: this.parent, permission: this.viewPermission });
2867
- this.app.mount(this.domElement);
2199
+ this.app = Ot(lo, { dxfSystem: this.parent, permission: this.viewPermission }), this.app.mount(this.domElement);
2868
2200
  });
2869
2201
  }
2870
2202
  /**
@@ -2875,199 +2207,113 @@ let Editor$1 = class Editor extends Component {
2875
2207
  type: "cancelCommand"
2876
2208
  });
2877
2209
  }
2878
- coords = new THREE.Vector2();
2879
- pointerPosition = new THREE.Vector2();
2210
+ coords = new m.Vector2();
2211
+ pointerPosition = new m.Vector2();
2880
2212
  _exitEditCallBack;
2881
2213
  /**
2882
2214
  * 打开编辑器
2883
2215
  */
2884
2216
  openEdit() {
2885
- const renderer = this.renderer, domEventRegister = this.domEventRegister, dxf = this.dxf, orbitControls = renderer.orbitControls, camera = renderer.camera, center = dxf.box.center, cameraPosition = renderer.camera.position.clone(), target = orbitControls?.target?.clone(), size = new THREE.Vector2(), raycaster = new THREE.Raycaster(), coords = this.coords, pointerPosition = this.pointerPosition;
2886
- this.container.position.z = dxf.originalZAverage;
2887
- renderer.scene.add(this.container);
2888
- if (orbitControls) {
2889
- camera.position.set(center.x, center.y, 15);
2890
- orbitControls.target.set(center.x, center.y, 0);
2891
- orbitControls.enableRotate = false;
2892
- }
2893
- const mousemoveFun = () => {
2894
- renderer.renderer.getSize(size);
2895
- const x = domEventRegister.pointer.x / size.x * 2 - 1;
2896
- const y = -(domEventRegister.pointer.y / size.y * 2 - 1);
2897
- coords.set(x, y);
2898
- raycaster.setFromCamera(coords, renderer.camera.children.length ? renderer.camera.children[0] : renderer.camera);
2899
- const intersections = raycaster.intersectObject(this.plane);
2900
- if (intersections.length) {
2901
- pointerPosition.copy(intersections[0].point);
2902
- this.dispatchEvent({
2903
- type: "pointerPositionChange",
2904
- position: pointerPosition
2905
- });
2906
- }
2217
+ const e = this.renderer, t = this.domEventRegister, n = this.dxf, o = e.orbitControls, s = e.camera, a = n.box.center, i = e.camera.position.clone(), d = o?.target?.clone(), l = new m.Vector2(), c = new m.Raycaster(), h = this.coords, w = this.pointerPosition;
2218
+ this.container.position.z = n.originalZAverage, e.scene.add(this.container), o && (s.position.set(a.x, a.y, 15), o.target.set(a.x, a.y, 0), o.enableRotate = !1);
2219
+ const f = () => {
2220
+ e.renderer.getSize(l);
2221
+ const C = t.pointer.x / l.x * 2 - 1, b = -(t.pointer.y / l.y * 2 - 1);
2222
+ h.set(C, b), c.setFromCamera(h, e.camera.children.length ? e.camera.children[0] : e.camera);
2223
+ const P = c.intersectObject(this.plane);
2224
+ P.length && (w.copy(P[0].point), this.dispatchEvent({
2225
+ type: "pointerPositionChange",
2226
+ position: w
2227
+ }));
2907
2228
  };
2908
- domEventRegister.addEventListener("mousemove", mousemoveFun);
2909
- this.commandManager.disabled = false;
2910
- this.commandManager.start("default");
2911
- this._exitEditCallBack = () => {
2912
- domEventRegister.removeEventListener("mousemove", mousemoveFun);
2913
- if (orbitControls) {
2914
- camera.position.copy(cameraPosition);
2915
- orbitControls.enableRotate = true;
2916
- orbitControls.target.copy(target);
2917
- }
2229
+ t.addEventListener("mousemove", f), this.commandManager.disabled = !1, this.commandManager.start("default"), this._exitEditCallBack = () => {
2230
+ t.removeEventListener("mousemove", f), o && (s.position.copy(i), o.enableRotate = !0, o.target.copy(d));
2918
2231
  };
2919
2232
  }
2920
2233
  /**
2921
2234
  * 退出编辑
2922
2235
  */
2923
2236
  exitEdit() {
2924
- if (typeof this._exitEditCallBack === "function") {
2925
- this._exitEditCallBack();
2926
- this._exitEditCallBack = void 0;
2927
- this.commandManager.disabled = true;
2928
- }
2237
+ typeof this._exitEditCallBack == "function" && (this._exitEditCallBack(), this._exitEditCallBack = void 0, this.commandManager.disabled = !0);
2929
2238
  }
2930
2239
  destroy() {
2931
- super.destroy();
2932
- this.exitEdit();
2933
- this.renderer.scene.remove(this.container);
2934
- this.domElement.remove();
2935
- this.app?.unmount();
2240
+ super.destroy(), this.exitEdit(), this.renderer.scene.remove(this.container), this.domElement.remove(), this.app?.unmount();
2936
2241
  }
2937
2242
  };
2938
- class PointDrag extends CommandFlowComponent {
2243
+ class co extends T {
2939
2244
  static name = "PointDrag";
2940
- container = new THREE.Group();
2245
+ container = new m.Group();
2941
2246
  interruptKeys = ["escape"];
2942
2247
  shortcutKeys = ["control", "p"];
2943
2248
  commandName = "point";
2944
- onAddFromParent(parent) {
2945
- super.onAddFromParent(parent);
2946
- this.editor.container.add(this.container);
2947
- this.container.position.z = 1e-3;
2948
- const commandFlow = this.commandManager.addCommandFlow(this.commandName).add(this.createInterrupt()).add(this.createCursor("crosshair")).add(this.selectPoint.bind(this)).add(this.drag.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
2949
- commandFlow.addEventListener("finally", this.createFinally());
2950
- commandFlow.addEventListener("completed", (e) => this.completed(e.data));
2951
- this.eventInput.addKeyCombination(this.commandName, this.shortcutKeys);
2952
- this.eventInput.addEventListener("codeChange", async () => this.eventInput.isKeyCombination(this.commandName) && await this.commandManager.start(this.commandName));
2953
- this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
2249
+ onAddFromParent(e) {
2250
+ super.onAddFromParent(e), this.editor.container.add(this.container), this.container.position.z = 1e-3;
2251
+ const t = this.commandManager.addCommandFlow(this.commandName).add(this.createInterrupt()).add(this.createCursor("crosshair")).add(this.selectPoint.bind(this)).add(this.drag.bind(this)).addRollback(this.rollback.bind(this)).addRevokeRollback(this.revokeRollback.bind(this));
2252
+ t.addEventListener("finally", this.createFinally()), t.addEventListener("completed", (n) => this.completed(n.data)), this.eventInput.addKeyCombination(this.commandName, this.shortcutKeys), this.eventInput.addEventListener("codeChange", async () => this.eventInput.isKeyCombination(this.commandName) && await this.commandManager.start(this.commandName)), this.eventInput.addCancelDefaultBehavior(() => this.eventInput.isOnlyKeyDowns(this.shortcutKeys));
2954
2253
  }
2955
2254
  /** 选择开始点
2956
2255
  * @param next
2957
2256
  */
2958
- selectPoint(next) {
2959
- let currentPoint = null, circle = new THREE.Mesh(new THREE.SphereGeometry(0.05), new THREE.MeshBasicMaterial({ color: 16711935 })), currentLine = null;
2257
+ selectPoint(e) {
2258
+ let t = null, n = new m.Mesh(new m.SphereGeometry(0.05), new m.MeshBasicMaterial({ color: 16711935 })), o = null;
2960
2259
  this.addEventRecord("selectPointStart").add(this.editor.addEventListener("pointerPositionChange", () => {
2961
- const { point, line: line2, find, mode } = this.editor.renderManager.adsorption();
2962
- if (find && mode === "point") {
2963
- this.domElement.style.cursor = "none";
2964
- circle.position.copy(point);
2965
- currentLine = line2;
2966
- currentPoint = point.clone();
2967
- this.container.add(circle);
2968
- } else {
2969
- this.domElement.style.cursor = "no-drop";
2970
- currentPoint = null;
2971
- circle.removeFromParent();
2972
- }
2260
+ const { point: s, line: a, find: i, mode: d } = this.editor.renderManager.adsorption();
2261
+ i && d === "point" ? (this.domElement.style.cursor = "none", n.position.copy(s), o = a, t = s.clone(), this.container.add(n)) : (this.domElement.style.cursor = "no-drop", t = null, n.removeFromParent());
2973
2262
  })).add(this.eventInput.addEventListener("codeChange", () => {
2974
- if (this.eventInput.isKeyDown("mouse_0") && currentPoint) {
2975
- this.canceEventRecord("selectPointStart");
2976
- circle.material.color.set(65280);
2977
- next({ point: currentPoint, line: currentLine });
2978
- }
2979
- }));
2980
- this.addEventRecord("clear").add(() => circle.removeFromParent());
2263
+ this.eventInput.isKeyDown("mouse_0") && t && (this.canceEventRecord("selectPointStart"), n.material.color.set(65280), e({ point: t, line: o }));
2264
+ })), this.addEventRecord("clear").add(() => n.removeFromParent());
2981
2265
  }
2982
2266
  /** 拖拽点
2983
2267
  * @description 拖拽点到指定位置
2984
2268
  * @param next
2985
2269
  * @param param1
2986
2270
  */
2987
- drag(next, { point, line: line2 }) {
2271
+ drag(e, { point: t, line: n }) {
2988
2272
  this.domElement.style.cursor = "crosshair";
2989
- const mode = line2.start.equal(Point.from(point)) ? "start" : "end", start = mode == "start" ? new THREE.Vector3(line2.end.x, line2.end.y, 0) : new THREE.Vector3(line2.start.x, line2.start.y, 0), end = point.clone(), lines = new Lines([start, end], 16711935), circle = new THREE.Mesh(new THREE.SphereGeometry(0.03), new THREE.MeshBasicMaterial({ color: 16711935 }));
2990
- this.container.add(lines);
2991
- this.addEventRecord("clear").add(this.editor.addEventListener("pointerPositionChange", () => {
2992
- let { point: point2, find } = this.editor.renderManager.adsorption(), cursor = "none";
2993
- if (point2) {
2994
- this.dispatchEvent({ type: "pointerMove", point: point2 });
2995
- if (this.eventInput.isKeyDown("shift")) {
2996
- const p = line2.projectPoint(Point.from(point2), false);
2997
- point2.set(p?.x ?? point2.x, p?.y ?? point2.y, 0);
2998
- find = true;
2999
- cursor = "crosshair";
3000
- }
3001
- if (find) {
3002
- circle.position.copy(point2);
3003
- this.container.add(circle);
3004
- } else {
3005
- circle.removeFromParent();
3006
- cursor = "crosshair";
2273
+ const o = n.start.equal(A.from(t)) ? "start" : "end", s = o == "start" ? new m.Vector3(n.end.x, n.end.y, 0) : new m.Vector3(n.start.x, n.start.y, 0), a = t.clone(), i = new he([s, a], 16711935), d = new m.Mesh(new m.SphereGeometry(0.03), new m.MeshBasicMaterial({ color: 16711935 }));
2274
+ this.container.add(i), this.addEventRecord("clear").add(this.editor.addEventListener("pointerPositionChange", () => {
2275
+ let { point: l, find: c } = this.editor.renderManager.adsorption(), h = "none";
2276
+ if (l) {
2277
+ if (this.dispatchEvent({ type: "pointerMove", point: l }), this.eventInput.isKeyDown("shift")) {
2278
+ const w = n.projectPoint(A.from(l), !1);
2279
+ l.set(w?.x ?? l.x, w?.y ?? l.y, 0), c = !0, h = "crosshair";
3007
2280
  }
3008
- end.copy(point2);
3009
- lines.setPoint(start, end);
3010
- this.domElement.style.cursor = cursor;
2281
+ c ? (d.position.copy(l), this.container.add(d)) : (d.removeFromParent(), h = "crosshair"), a.copy(l), i.setPoint(s, a), this.domElement.style.cursor = h;
3011
2282
  }
3012
2283
  })).add(this.eventInput.addEventListener("codeChange", () => {
3013
- if (this.eventInput.isKeyDown("mouse_0")) {
3014
- this.canceEventRecord("selectPointStart");
3015
- next({ point: end, oldPoint: mode === "end" ? line2.end.clone() : line2.start.clone(), line: line2, mode });
3016
- }
3017
- })).add(() => circle.removeFromParent()).add(() => lines.removeFromParent());
2284
+ this.eventInput.isKeyDown("mouse_0") && (this.canceEventRecord("selectPointStart"), e({ point: a, oldPoint: o === "end" ? n.end.clone() : n.start.clone(), line: n, mode: o }));
2285
+ })).add(() => d.removeFromParent()).add(() => i.removeFromParent());
3018
2286
  }
3019
2287
  /** 执行完成
3020
2288
  */
3021
- completed(data) {
3022
- const { line: line2, point, mode } = data;
3023
- this.renderManager.removeLine(line2);
3024
- if (mode === "end") line2.end.set(point.x, point.y);
3025
- else if (mode === "start") line2.start.set(point.x, point.y);
3026
- this.renderManager.addLine(line2);
3027
- this.renderManager.draw();
2289
+ completed(e) {
2290
+ const { line: t, point: n, mode: o } = e;
2291
+ this.renderManager.removeLine(t), o === "end" ? t.end.set(n.x, n.y) : o === "start" && t.start.set(n.x, n.y), this.renderManager.addLine(t), this.renderManager.draw();
3028
2292
  }
3029
2293
  /** 回滚操作
3030
2294
  * @param data
3031
2295
  */
3032
- rollback(data) {
3033
- const { line: line2, oldPoint, mode } = data;
3034
- if (mode === "end") line2.end.set(oldPoint.x, oldPoint.y);
3035
- else if (mode === "start") line2.start.set(oldPoint.x, oldPoint.y);
3036
- this.renderManager.addLine(line2);
3037
- this.renderManager.draw();
3038
- return data;
2296
+ rollback(e) {
2297
+ const { line: t, oldPoint: n, mode: o } = e;
2298
+ return o === "end" ? t.end.set(n.x, n.y) : o === "start" && t.start.set(n.x, n.y), this.renderManager.addLine(t), this.renderManager.draw(), e;
3039
2299
  }
3040
2300
  /** 撤回回滚
3041
2301
  * @param lines
3042
2302
  * @returns
3043
2303
  */
3044
- revokeRollback(data) {
3045
- this.completed(data);
3046
- return data;
2304
+ revokeRollback(e) {
2305
+ return this.completed(e), e;
3047
2306
  }
3048
2307
  }
3049
- function Editor_(dxfSystem, option = {}) {
3050
- dxfSystem.addComponent(new Editor$1(option.viewPermission));
3051
- dxfSystem.addComponent(new RenderManager());
3052
- dxfSystem.addComponent(new Default());
3053
- dxfSystem.addComponent(new DrawLine());
3054
- dxfSystem.addComponent(new DrawDoorLine());
3055
- dxfSystem.addComponent(new DrawWindow());
3056
- dxfSystem.addComponent(new PointDrag());
3057
- dxfSystem.addComponent(new DeleteSelectLine());
3058
- dxfSystem.addComponent(new MergeLine());
3059
- dxfSystem.addComponent(new VerticalCorrection());
3060
- dxfSystem.addComponent(new ConnectionLine());
3061
- dxfSystem.addComponent(new IntersectionConnectionLine());
3062
- dxfSystem.addComponent(new DeleteSelectWindow());
3063
- dxfSystem.addComponent(new SelectAll());
2308
+ function Ge(r, e = {}) {
2309
+ r.addComponent(new ot(e.viewPermission)), r.addComponent(new An()), r.addComponent(new ke()), r.addComponent(new hn()), r.addComponent(new jn()), r.addComponent(new Gn()), r.addComponent(new co()), r.addComponent(new W()), r.addComponent(new q()), r.addComponent(new ee()), r.addComponent(new U()), r.addComponent(new Q()), r.addComponent(new Y()), r.addComponent(new Z());
3064
2310
  }
3065
- const Editor2 = Object.assign(Editor_, {
3066
- create(option = {}) {
3067
- return (dxfSystem) => Editor_(dxfSystem, option);
2311
+ const yo = Object.assign(Ge, {
2312
+ create(r = {}) {
2313
+ return (e) => Ge(e, r);
3068
2314
  }
3069
2315
  });
3070
2316
  export {
3071
- Editor2 as Editor,
3072
- Editor_
2317
+ yo as Editor,
2318
+ Ge as Editor_
3073
2319
  };