@jnrs/lingshu-smart 3.1.9 → 3.1.11

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.
@@ -1,6 +1,6 @@
1
- import { Text as at, Box as $t, Canvas as re, Pen as ne } from "leafer";
2
- var oe = /* @__PURE__ */ ((t) => (t.UNDO = "Undo", t.REDO = "Redo", t))(oe || {}), ie = /* @__PURE__ */ ((t) => (t.TRANSPORT = "搬运设备", t.MACHINE = "机床", t.CLEANING = "清洗机", t.STATION = "装载站", t.STORAGE = "库", t.OTHER = "其他", t))(ie || {}), ae = /* @__PURE__ */ ((t) => (t.SINGLE_JOINT_ROBOT = "SingleJointRobot", t.DOUBLE_JOINT_ROBOT = "DoubleJointRobot", t.RGV = "Rgv", t.MACHINE_TOOL = "MachineTool", t.MARKING_MACHINE = "MarkingMachine", t.CLEANING_MACHINE = "CleaningMachine", t.LOADING_STATION = "LoadingStation", t.SHUTTLE_STATION = "ShuttleStation", t.MATERIAL_TRACK = "MaterialTrack", t.RAIL = "Rail", t.RESOURCE_STORE = "ResourceStore", t.PALLET = "Pallet", t.RESOURCE_OPERATION_WINDOW = "ResourceOperationWindow", t))(ae || {}), p = /* @__PURE__ */ ((t) => (t.MACHINE_TOOL = "machine_tool", t.LOADING_STATION = "loading_station", t.SHUTTLE_STATION = "shuttle_station", t.MATERIAL_TRACK = "material_track", t.MARKING_MACHINE = "marking_machine", t.CLEANING_MACHINE = "cleaning_machine", t.SINGLE_JOINT_ROBOT = "single_joint_robot", t.DOUBLE_JOINT_ROBOT = "double_joint_robot", t.RGV = "rgv", t.RESOURCE_STORE = "resource_store", t.PALLET = "pallet", t.RESOURCE_OPERATION_WINDOW = "resource_operation_window", t))(p || {}), tt = /* @__PURE__ */ ((t) => (t.STATION_SLOT = "StationSlot", t.RESOURCE = "Resource", t))(tt || {}), $ = /* @__PURE__ */ ((t) => (t.WORKPIECE = "workpiece", t.TOOL = "tool", t.AUXILIARY = "auxiliary", t))($ || {}), se = /* @__PURE__ */ ((t) => (t.WORKPIECE_PALLET = "workpiece_pallet", t.TOOL_PALLET = "tool_pallet", t.AUXILIARY_PALLET = "auxiliary_pallet", t))(se || {}), ce = /* @__PURE__ */ ((t) => (t.DeviceInit = "device_init", t.DeviceCommand = "device_command", t.ResourceCommand = "resource_command", t.AlarmPush = "alarm_push", t.RuntimeStatusPush = "runtime_status_push", t.SceneReset = "scene_reset", t.CommandAck = "command_ack", t))(ce || {}), ue = /* @__PURE__ */ ((t) => (t.Add = "add", t.BatchAdd = "batch_add", t.Transfer = "transfer", t.Remove = "remove", t.BatchRemove = "batch_remove", t))(ue || {});
3
- const le = {
1
+ import { Text as at, Box as $t, Canvas as oe, Pen as ie } from "leafer";
2
+ var ae = /* @__PURE__ */ ((t) => (t.UNDO = "Undo", t.REDO = "Redo", t))(ae || {}), se = /* @__PURE__ */ ((t) => (t.TRANSPORT = "搬运设备", t.MACHINE = "机床", t.CLEANING = "清洗机", t.STATION = "装载站", t.STORAGE = "库", t.OTHER = "其他", t))(se || {}), ce = /* @__PURE__ */ ((t) => (t.SINGLE_JOINT_ROBOT = "SingleJointRobot", t.DOUBLE_JOINT_ROBOT = "DoubleJointRobot", t.RGV = "Rgv", t.MACHINE_TOOL = "MachineTool", t.MARKING_MACHINE = "MarkingMachine", t.CLEANING_MACHINE = "CleaningMachine", t.LOADING_STATION = "LoadingStation", t.SHUTTLE_STATION = "ShuttleStation", t.MATERIAL_TRACK = "MaterialTrack", t.RAIL = "Rail", t.RESOURCE_STORE = "ResourceStore", t.PALLET = "Pallet", t.RESOURCE_OPERATION_WINDOW = "ResourceOperationWindow", t))(ce || {}), p = /* @__PURE__ */ ((t) => (t.MACHINE_TOOL = "machine_tool", t.LOADING_STATION = "loading_station", t.SHUTTLE_STATION = "shuttle_station", t.MATERIAL_TRACK = "material_track", t.MARKING_MACHINE = "marking_machine", t.CLEANING_MACHINE = "cleaning_machine", t.SINGLE_JOINT_ROBOT = "single_joint_robot", t.DOUBLE_JOINT_ROBOT = "double_joint_robot", t.RGV = "rgv", t.RESOURCE_STORE = "resource_store", t.PALLET = "pallet", t.RESOURCE_OPERATION_WINDOW = "resource_operation_window", t))(p || {}), tt = /* @__PURE__ */ ((t) => (t.STATION_SLOT = "StationSlot", t.RESOURCE = "Resource", t))(tt || {}), $ = /* @__PURE__ */ ((t) => (t.WORKPIECE = "workpiece", t.TOOL = "tool", t.AUXILIARY = "auxiliary", t))($ || {}), ue = /* @__PURE__ */ ((t) => (t.WORKPIECE_PALLET = "workpiece_pallet", t.TOOL_PALLET = "tool_pallet", t.AUXILIARY_PALLET = "auxiliary_pallet", t))(ue || {}), le = /* @__PURE__ */ ((t) => (t.DeviceInit = "device_init", t.DeviceCommand = "device_command", t.ResourceCommand = "resource_command", t.AlarmPush = "alarm_push", t.RuntimeStatusPush = "runtime_status_push", t.SceneReset = "scene_reset", t.CommandAck = "command_ack", t))(le || {}), fe = /* @__PURE__ */ ((t) => (t.Add = "add", t.BatchAdd = "batch_add", t.Transfer = "transfer", t.Remove = "remove", t.BatchRemove = "batch_remove", t))(fe || {});
3
+ const he = {
4
4
  [p.MACHINE_TOOL]: "MachineTool",
5
5
  [p.LOADING_STATION]: "LoadingStation",
6
6
  [p.SHUTTLE_STATION]: "ShuttleStation",
@@ -13,8 +13,8 @@ const le = {
13
13
  [p.RESOURCE_STORE]: "ResourceStore",
14
14
  [p.PALLET]: "Pallet",
15
15
  [p.RESOURCE_OPERATION_WINDOW]: "ResourceOperationWindow"
16
- }, ii = Object.fromEntries(
17
- Object.entries(le).map(([t, e]) => [e, t])
16
+ }, ci = Object.fromEntries(
17
+ Object.entries(he).map(([t, e]) => [e, t])
18
18
  ), st = {
19
19
  none: 0,
20
20
  error: 1,
@@ -22,7 +22,7 @@ const le = {
22
22
  info: 3,
23
23
  log: 4,
24
24
  operating: 5
25
- }, fe = {
25
+ }, de = {
26
26
  log: "LOG",
27
27
  info: "INFO",
28
28
  warn: "WARN",
@@ -30,10 +30,10 @@ const le = {
30
30
  operating: "OPERATING"
31
31
  };
32
32
  let E = "warn";
33
- function ai(t) {
33
+ function ui(t) {
34
34
  E = t;
35
35
  }
36
- function si() {
36
+ function li() {
37
37
  return E;
38
38
  }
39
39
  const ct = {
@@ -43,10 +43,10 @@ const ct = {
43
43
  error: "background: #FF3300; color: #fff; padding: 2px 5px; border-radius: 3px; font-weight: bold; font-size: 11px",
44
44
  operating: "background: #009866; color: #fff; padding: 2px 5px; border-radius: 3px; font-weight: bold; font-size: 11px"
45
45
  }, ut = "color: inherit; background: transparent; padding: 0; margin-left: 4px";
46
- function he(t) {
46
+ function ge(t) {
47
47
  return E === "operating-only" ? t === "operating" || t === "error" : t === "operating" ? E === "operating" : st[t] <= st[E];
48
48
  }
49
- const de = {
49
+ const pe = {
50
50
  log: "log",
51
51
  info: "info",
52
52
  warn: "warn",
@@ -54,8 +54,8 @@ const de = {
54
54
  operating: "log"
55
55
  };
56
56
  function R(t, e, ...r) {
57
- if (!he(t)) return;
58
- const n = fe[t], i = de[t];
57
+ if (!ge(t)) return;
58
+ const n = de[t], i = pe[t];
59
59
  e ? r.length > 0 && typeof r[0] == "string" ? console[i](`%c${n}:${e}%c ${r[0]}`, ct[t], ut, ...r.slice(1)) : console[i](`%c${n}:${e}%c`, ct[t], ut, ...r) : console[i](...r);
60
60
  }
61
61
  function et(t = "") {
@@ -67,25 +67,25 @@ function et(t = "") {
67
67
  operating: (...e) => R("operating", t, ...e)
68
68
  };
69
69
  }
70
- const ci = et("LingshuSmart");
71
- var Lt = typeof global == "object" && global && global.Object === Object && global, ge = typeof self == "object" && self && self.Object === Object && self, b = Lt || ge || Function("return this")(), S = b.Symbol, Nt = Object.prototype, pe = Nt.hasOwnProperty, be = Nt.toString, I = S ? S.toStringTag : void 0;
72
- function _e(t) {
73
- var e = pe.call(t, I), r = t[I];
70
+ const fi = et("LingshuSmart");
71
+ var Lt = typeof global == "object" && global && global.Object === Object && global, be = typeof self == "object" && self && self.Object === Object && self, b = Lt || be || Function("return this")(), S = b.Symbol, Nt = Object.prototype, _e = Nt.hasOwnProperty, ye = Nt.toString, I = S ? S.toStringTag : void 0;
72
+ function Te(t) {
73
+ var e = _e.call(t, I), r = t[I];
74
74
  try {
75
75
  t[I] = void 0;
76
76
  var n = !0;
77
77
  } catch {
78
78
  }
79
- var i = be.call(t);
79
+ var i = ye.call(t);
80
80
  return n && (e ? t[I] = r : delete t[I]), i;
81
81
  }
82
- var ye = Object.prototype, Te = ye.toString;
83
- function we(t) {
84
- return Te.call(t);
82
+ var we = Object.prototype, Oe = we.toString;
83
+ function Ae(t) {
84
+ return Oe.call(t);
85
85
  }
86
- var Oe = "[object Null]", Ae = "[object Undefined]", lt = S ? S.toStringTag : void 0;
86
+ var me = "[object Null]", Se = "[object Undefined]", lt = S ? S.toStringTag : void 0;
87
87
  function P(t) {
88
- return t == null ? t === void 0 ? Ae : Oe : lt && lt in Object(t) ? _e(t) : we(t);
88
+ return t == null ? t === void 0 ? Se : me : lt && lt in Object(t) ? Te(t) : Ae(t);
89
89
  }
90
90
  function F(t) {
91
91
  return t != null && typeof t == "object";
@@ -95,25 +95,25 @@ function z(t) {
95
95
  var e = typeof t;
96
96
  return t != null && (e == "object" || e == "function");
97
97
  }
98
- var me = "[object AsyncFunction]", Se = "[object Function]", ve = "[object GeneratorFunction]", je = "[object Proxy]";
98
+ var ve = "[object AsyncFunction]", je = "[object Function]", xe = "[object GeneratorFunction]", Re = "[object Proxy]";
99
99
  function Pt(t) {
100
100
  if (!z(t))
101
101
  return !1;
102
102
  var e = P(t);
103
- return e == Se || e == ve || e == me || e == je;
103
+ return e == je || e == xe || e == ve || e == Re;
104
104
  }
105
105
  var K = b["__core-js_shared__"], ft = (function() {
106
106
  var t = /[^.]+$/.exec(K && K.keys && K.keys.IE_PROTO || "");
107
107
  return t ? "Symbol(src)_1." + t : "";
108
108
  })();
109
- function xe(t) {
109
+ function Ie(t) {
110
110
  return !!ft && ft in t;
111
111
  }
112
- var Re = Function.prototype, Ie = Re.toString;
112
+ var Ee = Function.prototype, Ce = Ee.toString;
113
113
  function A(t) {
114
114
  if (t != null) {
115
115
  try {
116
- return Ie.call(t);
116
+ return Ce.call(t);
117
117
  } catch {
118
118
  }
119
119
  try {
@@ -123,23 +123,23 @@ function A(t) {
123
123
  }
124
124
  return "";
125
125
  }
126
- var Ee = /[\\^$.*+?()[\]{}|]/g, Ce = /^\[object .+?Constructor\]$/, $e = Function.prototype, Le = Object.prototype, Ne = $e.toString, Pe = Le.hasOwnProperty, Fe = RegExp(
127
- "^" + Ne.call(Pe).replace(Ee, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
126
+ var $e = /[\\^$.*+?()[\]{}|]/g, Le = /^\[object .+?Constructor\]$/, Ne = Function.prototype, Pe = Object.prototype, Fe = Ne.toString, Ue = Pe.hasOwnProperty, Me = RegExp(
127
+ "^" + Fe.call(Ue).replace($e, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
128
128
  );
129
- function Ue(t) {
130
- if (!z(t) || xe(t))
129
+ function De(t) {
130
+ if (!z(t) || Ie(t))
131
131
  return !1;
132
- var e = Pt(t) ? Fe : Ce;
132
+ var e = Pt(t) ? Me : Le;
133
133
  return e.test(A(t));
134
134
  }
135
- function Me(t, e) {
135
+ function ke(t, e) {
136
136
  return t?.[e];
137
137
  }
138
138
  function m(t, e) {
139
- var r = Me(t, e);
140
- return Ue(r) ? r : void 0;
139
+ var r = ke(t, e);
140
+ return De(r) ? r : void 0;
141
141
  }
142
- var J = m(b, "WeakMap"), ht = Object.create, De = /* @__PURE__ */ (function() {
142
+ var Y = m(b, "WeakMap"), ht = Object.create, Be = /* @__PURE__ */ (function() {
143
143
  function t() {
144
144
  }
145
145
  return function(e) {
@@ -158,17 +158,17 @@ var J = m(b, "WeakMap"), ht = Object.create, De = /* @__PURE__ */ (function() {
158
158
  } catch {
159
159
  }
160
160
  })();
161
- function ke(t, e) {
161
+ function ze(t, e) {
162
162
  for (var r = -1, n = t == null ? 0 : t.length; ++r < n && e(t[r], r, t) !== !1; )
163
163
  ;
164
164
  return t;
165
165
  }
166
- var Be = 9007199254740991, ze = /^(?:0|[1-9]\d*)$/;
167
- function Ge(t, e) {
166
+ var Ge = 9007199254740991, We = /^(?:0|[1-9]\d*)$/;
167
+ function He(t, e) {
168
168
  var r = typeof t;
169
- return e = e ?? Be, !!e && (r == "number" || r != "symbol" && ze.test(t)) && t > -1 && t % 1 == 0 && t < e;
169
+ return e = e ?? Ge, !!e && (r == "number" || r != "symbol" && We.test(t)) && t > -1 && t % 1 == 0 && t < e;
170
170
  }
171
- function We(t, e, r) {
171
+ function Ve(t, e, r) {
172
172
  e == "__proto__" && dt ? dt(t, e, {
173
173
  configurable: !0,
174
174
  enumerable: !0,
@@ -179,44 +179,44 @@ function We(t, e, r) {
179
179
  function Ft(t, e) {
180
180
  return t === e || t !== t && e !== e;
181
181
  }
182
- var He = Object.prototype, Ve = He.hasOwnProperty;
183
- function Ke(t, e, r) {
182
+ var Ke = Object.prototype, Je = Ke.hasOwnProperty;
183
+ function Ye(t, e, r) {
184
184
  var n = t[e];
185
- (!(Ve.call(t, e) && Ft(n, r)) || r === void 0 && !(e in t)) && We(t, e, r);
185
+ (!(Je.call(t, e) && Ft(n, r)) || r === void 0 && !(e in t)) && Ve(t, e, r);
186
186
  }
187
- var Ye = 9007199254740991;
187
+ var Xe = 9007199254740991;
188
188
  function Ut(t) {
189
- return typeof t == "number" && t > -1 && t % 1 == 0 && t <= Ye;
189
+ return typeof t == "number" && t > -1 && t % 1 == 0 && t <= Xe;
190
190
  }
191
- function Je(t) {
191
+ function qe(t) {
192
192
  return t != null && Ut(t.length) && !Pt(t);
193
193
  }
194
- var Xe = Object.prototype;
194
+ var Ze = Object.prototype;
195
195
  function Mt(t) {
196
- var e = t && t.constructor, r = typeof e == "function" && e.prototype || Xe;
196
+ var e = t && t.constructor, r = typeof e == "function" && e.prototype || Ze;
197
197
  return t === r;
198
198
  }
199
- function qe(t, e) {
199
+ function Qe(t, e) {
200
200
  for (var r = -1, n = Array(t); ++r < t; )
201
201
  n[r] = e(r);
202
202
  return n;
203
203
  }
204
- var Ze = "[object Arguments]";
204
+ var tr = "[object Arguments]";
205
205
  function gt(t) {
206
- return F(t) && P(t) == Ze;
206
+ return F(t) && P(t) == tr;
207
207
  }
208
- var Dt = Object.prototype, Qe = Dt.hasOwnProperty, tr = Dt.propertyIsEnumerable, er = gt(/* @__PURE__ */ (function() {
208
+ var Dt = Object.prototype, er = Dt.hasOwnProperty, rr = Dt.propertyIsEnumerable, nr = gt(/* @__PURE__ */ (function() {
209
209
  return arguments;
210
210
  })()) ? gt : function(t) {
211
- return F(t) && Qe.call(t, "callee") && !tr.call(t, "callee");
211
+ return F(t) && er.call(t, "callee") && !rr.call(t, "callee");
212
212
  };
213
- function rr() {
213
+ function or() {
214
214
  return !1;
215
215
  }
216
- var kt = typeof exports == "object" && exports && !exports.nodeType && exports, pt = kt && typeof module == "object" && module && !module.nodeType && module, nr = pt && pt.exports === kt, bt = nr ? b.Buffer : void 0, or = bt ? bt.isBuffer : void 0, Bt = or || rr, ir = "[object Arguments]", ar = "[object Array]", sr = "[object Boolean]", cr = "[object Date]", ur = "[object Error]", lr = "[object Function]", fr = "[object Map]", hr = "[object Number]", dr = "[object Object]", gr = "[object RegExp]", pr = "[object Set]", br = "[object String]", _r = "[object WeakMap]", yr = "[object ArrayBuffer]", Tr = "[object DataView]", wr = "[object Float32Array]", Or = "[object Float64Array]", Ar = "[object Int8Array]", mr = "[object Int16Array]", Sr = "[object Int32Array]", vr = "[object Uint8Array]", jr = "[object Uint8ClampedArray]", xr = "[object Uint16Array]", Rr = "[object Uint32Array]", c = {};
217
- c[wr] = c[Or] = c[Ar] = c[mr] = c[Sr] = c[vr] = c[jr] = c[xr] = c[Rr] = !0;
218
- c[ir] = c[ar] = c[yr] = c[sr] = c[Tr] = c[cr] = c[ur] = c[lr] = c[fr] = c[hr] = c[dr] = c[gr] = c[pr] = c[br] = c[_r] = !1;
219
- function Ir(t) {
216
+ var kt = typeof exports == "object" && exports && !exports.nodeType && exports, pt = kt && typeof module == "object" && module && !module.nodeType && module, ir = pt && pt.exports === kt, bt = ir ? b.Buffer : void 0, ar = bt ? bt.isBuffer : void 0, Bt = ar || or, sr = "[object Arguments]", cr = "[object Array]", ur = "[object Boolean]", lr = "[object Date]", fr = "[object Error]", hr = "[object Function]", dr = "[object Map]", gr = "[object Number]", pr = "[object Object]", br = "[object RegExp]", _r = "[object Set]", yr = "[object String]", Tr = "[object WeakMap]", wr = "[object ArrayBuffer]", Or = "[object DataView]", Ar = "[object Float32Array]", mr = "[object Float64Array]", Sr = "[object Int8Array]", vr = "[object Int16Array]", jr = "[object Int32Array]", xr = "[object Uint8Array]", Rr = "[object Uint8ClampedArray]", Ir = "[object Uint16Array]", Er = "[object Uint32Array]", c = {};
217
+ c[Ar] = c[mr] = c[Sr] = c[vr] = c[jr] = c[xr] = c[Rr] = c[Ir] = c[Er] = !0;
218
+ c[sr] = c[cr] = c[wr] = c[ur] = c[Or] = c[lr] = c[fr] = c[hr] = c[dr] = c[gr] = c[pr] = c[br] = c[_r] = c[yr] = c[Tr] = !1;
219
+ function Cr(t) {
220
220
  return F(t) && Ut(t.length) && !!c[P(t)];
221
221
  }
222
222
  function nt(t) {
@@ -224,66 +224,66 @@ function nt(t) {
224
224
  return t(e);
225
225
  };
226
226
  }
227
- var zt = typeof exports == "object" && exports && !exports.nodeType && exports, C = zt && typeof module == "object" && module && !module.nodeType && module, Er = C && C.exports === zt, Y = Er && Lt.process, v = (function() {
227
+ var zt = typeof exports == "object" && exports && !exports.nodeType && exports, C = zt && typeof module == "object" && module && !module.nodeType && module, $r = C && C.exports === zt, J = $r && Lt.process, v = (function() {
228
228
  try {
229
229
  var t = C && C.require && C.require("util").types;
230
- return t || Y && Y.binding && Y.binding("util");
230
+ return t || J && J.binding && J.binding("util");
231
231
  } catch {
232
232
  }
233
- })(), _t = v && v.isTypedArray, Cr = _t ? nt(_t) : Ir, $r = Object.prototype, Lr = $r.hasOwnProperty;
234
- function Nr(t, e) {
235
- var r = rt(t), n = !r && er(t), i = !r && !n && Bt(t), o = !r && !n && !i && Cr(t), a = r || n || i || o, f = a ? qe(t.length, String) : [], l = f.length;
233
+ })(), _t = v && v.isTypedArray, Lr = _t ? nt(_t) : Cr, Nr = Object.prototype, Pr = Nr.hasOwnProperty;
234
+ function Fr(t, e) {
235
+ var r = rt(t), n = !r && nr(t), i = !r && !n && Bt(t), o = !r && !n && !i && Lr(t), a = r || n || i || o, l = a ? Qe(t.length, String) : [], f = l.length;
236
236
  for (var u in t)
237
- Lr.call(t, u) && !(a && // Safari 9 has enumerable `arguments.length` in strict mode.
237
+ Pr.call(t, u) && !(a && // Safari 9 has enumerable `arguments.length` in strict mode.
238
238
  (u == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
239
239
  i && (u == "offset" || u == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
240
240
  o && (u == "buffer" || u == "byteLength" || u == "byteOffset") || // Skip index properties.
241
- Ge(u, l))) && f.push(u);
242
- return f;
241
+ He(u, f))) && l.push(u);
242
+ return l;
243
243
  }
244
244
  function Gt(t, e) {
245
245
  return function(r) {
246
246
  return t(e(r));
247
247
  };
248
248
  }
249
- var Pr = Gt(Object.keys, Object), Fr = Object.prototype, Ur = Fr.hasOwnProperty;
250
- function Mr(t) {
249
+ var Ur = Gt(Object.keys, Object), Mr = Object.prototype, Dr = Mr.hasOwnProperty;
250
+ function kr(t) {
251
251
  if (!Mt(t))
252
- return Pr(t);
252
+ return Ur(t);
253
253
  var e = [];
254
254
  for (var r in Object(t))
255
- Ur.call(t, r) && r != "constructor" && e.push(r);
255
+ Dr.call(t, r) && r != "constructor" && e.push(r);
256
256
  return e;
257
257
  }
258
- function Dr(t) {
259
- return Je(t) ? Nr(t) : Mr(t);
258
+ function Br(t) {
259
+ return qe(t) ? Fr(t) : kr(t);
260
260
  }
261
261
  var L = m(Object, "create");
262
- function kr() {
262
+ function zr() {
263
263
  this.__data__ = L ? L(null) : {}, this.size = 0;
264
264
  }
265
- function Br(t) {
265
+ function Gr(t) {
266
266
  var e = this.has(t) && delete this.__data__[t];
267
267
  return this.size -= e ? 1 : 0, e;
268
268
  }
269
- var zr = "__lodash_hash_undefined__", Gr = Object.prototype, Wr = Gr.hasOwnProperty;
270
- function Hr(t) {
269
+ var Wr = "__lodash_hash_undefined__", Hr = Object.prototype, Vr = Hr.hasOwnProperty;
270
+ function Kr(t) {
271
271
  var e = this.__data__;
272
272
  if (L) {
273
273
  var r = e[t];
274
- return r === zr ? void 0 : r;
274
+ return r === Wr ? void 0 : r;
275
275
  }
276
- return Wr.call(e, t) ? e[t] : void 0;
276
+ return Vr.call(e, t) ? e[t] : void 0;
277
277
  }
278
- var Vr = Object.prototype, Kr = Vr.hasOwnProperty;
279
- function Yr(t) {
278
+ var Jr = Object.prototype, Yr = Jr.hasOwnProperty;
279
+ function Xr(t) {
280
280
  var e = this.__data__;
281
- return L ? e[t] !== void 0 : Kr.call(e, t);
281
+ return L ? e[t] !== void 0 : Yr.call(e, t);
282
282
  }
283
- var Jr = "__lodash_hash_undefined__";
284
- function Xr(t, e) {
283
+ var qr = "__lodash_hash_undefined__";
284
+ function Zr(t, e) {
285
285
  var r = this.__data__;
286
- return this.size += this.has(t) ? 0 : 1, r[t] = L && e === void 0 ? Jr : e, this;
286
+ return this.size += this.has(t) ? 0 : 1, r[t] = L && e === void 0 ? qr : e, this;
287
287
  }
288
288
  function O(t) {
289
289
  var e = -1, r = t == null ? 0 : t.length;
@@ -292,12 +292,12 @@ function O(t) {
292
292
  this.set(n[0], n[1]);
293
293
  }
294
294
  }
295
- O.prototype.clear = kr;
296
- O.prototype.delete = Br;
297
- O.prototype.get = Hr;
298
- O.prototype.has = Yr;
299
- O.prototype.set = Xr;
300
- function qr() {
295
+ O.prototype.clear = zr;
296
+ O.prototype.delete = Gr;
297
+ O.prototype.get = Kr;
298
+ O.prototype.has = Xr;
299
+ O.prototype.set = Zr;
300
+ function Qr() {
301
301
  this.__data__ = [], this.size = 0;
302
302
  }
303
303
  function G(t, e) {
@@ -306,22 +306,22 @@ function G(t, e) {
306
306
  return r;
307
307
  return -1;
308
308
  }
309
- var Zr = Array.prototype, Qr = Zr.splice;
310
- function tn(t) {
309
+ var tn = Array.prototype, en = tn.splice;
310
+ function rn(t) {
311
311
  var e = this.__data__, r = G(e, t);
312
312
  if (r < 0)
313
313
  return !1;
314
314
  var n = e.length - 1;
315
- return r == n ? e.pop() : Qr.call(e, r, 1), --this.size, !0;
315
+ return r == n ? e.pop() : en.call(e, r, 1), --this.size, !0;
316
316
  }
317
- function en(t) {
317
+ function nn(t) {
318
318
  var e = this.__data__, r = G(e, t);
319
319
  return r < 0 ? void 0 : e[r][1];
320
320
  }
321
- function rn(t) {
321
+ function on(t) {
322
322
  return G(this.__data__, t) > -1;
323
323
  }
324
- function nn(t, e) {
324
+ function an(t, e) {
325
325
  var r = this.__data__, n = G(r, t);
326
326
  return n < 0 ? (++this.size, r.push([t, e])) : r[n][1] = e, this;
327
327
  }
@@ -332,38 +332,38 @@ function w(t) {
332
332
  this.set(n[0], n[1]);
333
333
  }
334
334
  }
335
- w.prototype.clear = qr;
336
- w.prototype.delete = tn;
337
- w.prototype.get = en;
338
- w.prototype.has = rn;
339
- w.prototype.set = nn;
335
+ w.prototype.clear = Qr;
336
+ w.prototype.delete = rn;
337
+ w.prototype.get = nn;
338
+ w.prototype.has = on;
339
+ w.prototype.set = an;
340
340
  var N = m(b, "Map");
341
- function on() {
341
+ function sn() {
342
342
  this.size = 0, this.__data__ = {
343
343
  hash: new O(),
344
344
  map: new (N || w)(),
345
345
  string: new O()
346
346
  };
347
347
  }
348
- function an(t) {
348
+ function cn(t) {
349
349
  var e = typeof t;
350
350
  return e == "string" || e == "number" || e == "symbol" || e == "boolean" ? t !== "__proto__" : t === null;
351
351
  }
352
352
  function W(t, e) {
353
353
  var r = t.__data__;
354
- return an(e) ? r[typeof e == "string" ? "string" : "hash"] : r.map;
354
+ return cn(e) ? r[typeof e == "string" ? "string" : "hash"] : r.map;
355
355
  }
356
- function sn(t) {
356
+ function un(t) {
357
357
  var e = W(this, t).delete(t);
358
358
  return this.size -= e ? 1 : 0, e;
359
359
  }
360
- function cn(t) {
360
+ function ln(t) {
361
361
  return W(this, t).get(t);
362
362
  }
363
- function un(t) {
363
+ function fn(t) {
364
364
  return W(this, t).has(t);
365
365
  }
366
- function ln(t, e) {
366
+ function hn(t, e) {
367
367
  var r = W(this, t), n = r.size;
368
368
  return r.set(t, e), this.size += r.size == n ? 0 : 1, this;
369
369
  }
@@ -374,36 +374,36 @@ function j(t) {
374
374
  this.set(n[0], n[1]);
375
375
  }
376
376
  }
377
- j.prototype.clear = on;
378
- j.prototype.delete = sn;
379
- j.prototype.get = cn;
380
- j.prototype.has = un;
381
- j.prototype.set = ln;
382
- function fn(t, e) {
377
+ j.prototype.clear = sn;
378
+ j.prototype.delete = un;
379
+ j.prototype.get = ln;
380
+ j.prototype.has = fn;
381
+ j.prototype.set = hn;
382
+ function dn(t, e) {
383
383
  for (var r = -1, n = e.length, i = t.length; ++r < n; )
384
384
  t[i + r] = e[r];
385
385
  return t;
386
386
  }
387
- var hn = Gt(Object.getPrototypeOf, Object);
388
- function dn() {
387
+ var gn = Gt(Object.getPrototypeOf, Object);
388
+ function pn() {
389
389
  this.__data__ = new w(), this.size = 0;
390
390
  }
391
- function gn(t) {
391
+ function bn(t) {
392
392
  var e = this.__data__, r = e.delete(t);
393
393
  return this.size = e.size, r;
394
394
  }
395
- function pn(t) {
395
+ function _n(t) {
396
396
  return this.__data__.get(t);
397
397
  }
398
- function bn(t) {
398
+ function yn(t) {
399
399
  return this.__data__.has(t);
400
400
  }
401
- var _n = 200;
402
- function yn(t, e) {
401
+ var Tn = 200;
402
+ function wn(t, e) {
403
403
  var r = this.__data__;
404
404
  if (r instanceof w) {
405
405
  var n = r.__data__;
406
- if (!N || n.length < _n - 1)
406
+ if (!N || n.length < Tn - 1)
407
407
  return n.push([t, e]), this.size = ++r.size, this;
408
408
  r = this.__data__ = new j(n);
409
409
  }
@@ -413,96 +413,94 @@ function x(t) {
413
413
  var e = this.__data__ = new w(t);
414
414
  this.size = e.size;
415
415
  }
416
- x.prototype.clear = dn;
417
- x.prototype.delete = gn;
418
- x.prototype.get = pn;
419
- x.prototype.has = bn;
420
- x.prototype.set = yn;
421
- var Wt = typeof exports == "object" && exports && !exports.nodeType && exports, yt = Wt && typeof module == "object" && module && !module.nodeType && module, Tn = yt && yt.exports === Wt, Tt = Tn ? b.Buffer : void 0;
416
+ x.prototype.clear = pn;
417
+ x.prototype.delete = bn;
418
+ x.prototype.get = _n;
419
+ x.prototype.has = yn;
420
+ x.prototype.set = wn;
421
+ var Wt = typeof exports == "object" && exports && !exports.nodeType && exports, yt = Wt && typeof module == "object" && module && !module.nodeType && module, On = yt && yt.exports === Wt, Tt = On ? b.Buffer : void 0;
422
422
  Tt && Tt.allocUnsafe;
423
- function wn(t, e) {
423
+ function An(t, e) {
424
424
  return t.slice();
425
425
  }
426
- function On(t, e) {
426
+ function mn(t, e) {
427
427
  for (var r = -1, n = t == null ? 0 : t.length, i = 0, o = []; ++r < n; ) {
428
428
  var a = t[r];
429
429
  e(a, r, t) && (o[i++] = a);
430
430
  }
431
431
  return o;
432
432
  }
433
- function An() {
433
+ function Sn() {
434
434
  return [];
435
435
  }
436
- var mn = Object.prototype, Sn = mn.propertyIsEnumerable, wt = Object.getOwnPropertySymbols, vn = wt ? function(t) {
437
- return t == null ? [] : (t = Object(t), On(wt(t), function(e) {
438
- return Sn.call(t, e);
436
+ var vn = Object.prototype, jn = vn.propertyIsEnumerable, wt = Object.getOwnPropertySymbols, xn = wt ? function(t) {
437
+ return t == null ? [] : (t = Object(t), mn(wt(t), function(e) {
438
+ return jn.call(t, e);
439
439
  }));
440
- } : An;
441
- function jn(t, e, r) {
440
+ } : Sn;
441
+ function Rn(t, e, r) {
442
442
  var n = e(t);
443
- return rt(t) ? n : fn(n, r(t));
443
+ return rt(t) ? n : dn(n, r(t));
444
444
  }
445
- function xn(t) {
446
- return jn(t, Dr, vn);
445
+ function In(t) {
446
+ return Rn(t, Br, xn);
447
447
  }
448
- var X = m(b, "DataView"), q = m(b, "Promise"), Z = m(b, "Set"), Ot = "[object Map]", Rn = "[object Object]", At = "[object Promise]", mt = "[object Set]", St = "[object WeakMap]", vt = "[object DataView]", In = A(X), En = A(N), Cn = A(q), $n = A(Z), Ln = A(J), T = P;
449
- (X && T(new X(new ArrayBuffer(1))) != vt || N && T(new N()) != Ot || q && T(q.resolve()) != At || Z && T(new Z()) != mt || J && T(new J()) != St) && (T = function(t) {
450
- var e = P(t), r = e == Rn ? t.constructor : void 0, n = r ? A(r) : "";
448
+ var X = m(b, "DataView"), q = m(b, "Promise"), Z = m(b, "Set"), Ot = "[object Map]", En = "[object Object]", At = "[object Promise]", mt = "[object Set]", St = "[object WeakMap]", vt = "[object DataView]", Cn = A(X), $n = A(N), Ln = A(q), Nn = A(Z), Pn = A(Y), T = P;
449
+ (X && T(new X(new ArrayBuffer(1))) != vt || N && T(new N()) != Ot || q && T(q.resolve()) != At || Z && T(new Z()) != mt || Y && T(new Y()) != St) && (T = function(t) {
450
+ var e = P(t), r = e == En ? t.constructor : void 0, n = r ? A(r) : "";
451
451
  if (n)
452
452
  switch (n) {
453
- case In:
453
+ case Cn:
454
454
  return vt;
455
- case En:
455
+ case $n:
456
456
  return Ot;
457
- case Cn:
457
+ case Ln:
458
458
  return At;
459
- case $n:
459
+ case Nn:
460
460
  return mt;
461
- case Ln:
461
+ case Pn:
462
462
  return St;
463
463
  }
464
464
  return e;
465
465
  });
466
- var Nn = Object.prototype, Pn = Nn.hasOwnProperty;
467
- function Fn(t) {
466
+ var Fn = Object.prototype, Un = Fn.hasOwnProperty;
467
+ function Mn(t) {
468
468
  var e = t.length, r = new t.constructor(e);
469
- return e && typeof t[0] == "string" && Pn.call(t, "index") && (r.index = t.index, r.input = t.input), r;
469
+ return e && typeof t[0] == "string" && Un.call(t, "index") && (r.index = t.index, r.input = t.input), r;
470
470
  }
471
471
  var jt = b.Uint8Array;
472
472
  function ot(t) {
473
473
  var e = new t.constructor(t.byteLength);
474
474
  return new jt(e).set(new jt(t)), e;
475
475
  }
476
- function Un(t, e) {
476
+ function Dn(t, e) {
477
477
  var r = ot(t.buffer);
478
478
  return new t.constructor(r, t.byteOffset, t.byteLength);
479
479
  }
480
- var Mn = /\w*$/;
481
- function Dn(t) {
482
- var e = new t.constructor(t.source, Mn.exec(t));
480
+ var kn = /\w*$/;
481
+ function Bn(t) {
482
+ var e = new t.constructor(t.source, kn.exec(t));
483
483
  return e.lastIndex = t.lastIndex, e;
484
484
  }
485
485
  var xt = S ? S.prototype : void 0, Rt = xt ? xt.valueOf : void 0;
486
- function kn(t) {
486
+ function zn(t) {
487
487
  return Rt ? Object(Rt.call(t)) : {};
488
488
  }
489
- function Bn(t, e) {
489
+ function Gn(t, e) {
490
490
  var r = ot(t.buffer);
491
491
  return new t.constructor(r, t.byteOffset, t.length);
492
492
  }
493
- var zn = "[object Boolean]", Gn = "[object Date]", Wn = "[object Map]", Hn = "[object Number]", Vn = "[object RegExp]", Kn = "[object Set]", Yn = "[object String]", Jn = "[object Symbol]", Xn = "[object ArrayBuffer]", qn = "[object DataView]", Zn = "[object Float32Array]", Qn = "[object Float64Array]", to = "[object Int8Array]", eo = "[object Int16Array]", ro = "[object Int32Array]", no = "[object Uint8Array]", oo = "[object Uint8ClampedArray]", io = "[object Uint16Array]", ao = "[object Uint32Array]";
494
- function so(t, e, r) {
493
+ var Wn = "[object Boolean]", Hn = "[object Date]", Vn = "[object Map]", Kn = "[object Number]", Jn = "[object RegExp]", Yn = "[object Set]", Xn = "[object String]", qn = "[object Symbol]", Zn = "[object ArrayBuffer]", Qn = "[object DataView]", to = "[object Float32Array]", eo = "[object Float64Array]", ro = "[object Int8Array]", no = "[object Int16Array]", oo = "[object Int32Array]", io = "[object Uint8Array]", ao = "[object Uint8ClampedArray]", so = "[object Uint16Array]", co = "[object Uint32Array]";
494
+ function uo(t, e, r) {
495
495
  var n = t.constructor;
496
496
  switch (e) {
497
- case Xn:
497
+ case Zn:
498
498
  return ot(t);
499
- case zn:
500
- case Gn:
499
+ case Wn:
500
+ case Hn:
501
501
  return new n(+t);
502
- case qn:
503
- return Un(t);
504
- case Zn:
505
502
  case Qn:
503
+ return Dn(t);
506
504
  case to:
507
505
  case eo:
508
506
  case ro:
@@ -510,75 +508,77 @@ function so(t, e, r) {
510
508
  case oo:
511
509
  case io:
512
510
  case ao:
513
- return Bn(t);
514
- case Wn:
515
- return new n();
516
- case Hn:
517
- case Yn:
518
- return new n(t);
511
+ case so:
512
+ case co:
513
+ return Gn(t);
519
514
  case Vn:
520
- return Dn(t);
521
- case Kn:
522
515
  return new n();
516
+ case Kn:
517
+ case Xn:
518
+ return new n(t);
523
519
  case Jn:
524
- return kn(t);
520
+ return Bn(t);
521
+ case Yn:
522
+ return new n();
523
+ case qn:
524
+ return zn(t);
525
525
  }
526
526
  }
527
- function co(t) {
528
- return typeof t.constructor == "function" && !Mt(t) ? De(hn(t)) : {};
529
- }
530
- var uo = "[object Map]";
531
527
  function lo(t) {
532
- return F(t) && T(t) == uo;
528
+ return typeof t.constructor == "function" && !Mt(t) ? Be(gn(t)) : {};
533
529
  }
534
- var It = v && v.isMap, fo = It ? nt(It) : lo, ho = "[object Set]";
535
- function go(t) {
536
- return F(t) && T(t) == ho;
530
+ var fo = "[object Map]";
531
+ function ho(t) {
532
+ return F(t) && T(t) == fo;
537
533
  }
538
- var Et = v && v.isSet, po = Et ? nt(Et) : go, Ht = "[object Arguments]", bo = "[object Array]", _o = "[object Boolean]", yo = "[object Date]", To = "[object Error]", Vt = "[object Function]", wo = "[object GeneratorFunction]", Oo = "[object Map]", Ao = "[object Number]", Kt = "[object Object]", mo = "[object RegExp]", So = "[object Set]", vo = "[object String]", jo = "[object Symbol]", xo = "[object WeakMap]", Ro = "[object ArrayBuffer]", Io = "[object DataView]", Eo = "[object Float32Array]", Co = "[object Float64Array]", $o = "[object Int8Array]", Lo = "[object Int16Array]", No = "[object Int32Array]", Po = "[object Uint8Array]", Fo = "[object Uint8ClampedArray]", Uo = "[object Uint16Array]", Mo = "[object Uint32Array]", s = {};
539
- s[Ht] = s[bo] = s[Ro] = s[Io] = s[_o] = s[yo] = s[Eo] = s[Co] = s[$o] = s[Lo] = s[No] = s[Oo] = s[Ao] = s[Kt] = s[mo] = s[So] = s[vo] = s[jo] = s[Po] = s[Fo] = s[Uo] = s[Mo] = !0;
540
- s[To] = s[Vt] = s[xo] = !1;
534
+ var It = v && v.isMap, go = It ? nt(It) : ho, po = "[object Set]";
535
+ function bo(t) {
536
+ return F(t) && T(t) == po;
537
+ }
538
+ var Et = v && v.isSet, _o = Et ? nt(Et) : bo, Ht = "[object Arguments]", yo = "[object Array]", To = "[object Boolean]", wo = "[object Date]", Oo = "[object Error]", Vt = "[object Function]", Ao = "[object GeneratorFunction]", mo = "[object Map]", So = "[object Number]", Kt = "[object Object]", vo = "[object RegExp]", jo = "[object Set]", xo = "[object String]", Ro = "[object Symbol]", Io = "[object WeakMap]", Eo = "[object ArrayBuffer]", Co = "[object DataView]", $o = "[object Float32Array]", Lo = "[object Float64Array]", No = "[object Int8Array]", Po = "[object Int16Array]", Fo = "[object Int32Array]", Uo = "[object Uint8Array]", Mo = "[object Uint8ClampedArray]", Do = "[object Uint16Array]", ko = "[object Uint32Array]", s = {};
539
+ s[Ht] = s[yo] = s[Eo] = s[Co] = s[To] = s[wo] = s[$o] = s[Lo] = s[No] = s[Po] = s[Fo] = s[mo] = s[So] = s[Kt] = s[vo] = s[jo] = s[xo] = s[Ro] = s[Uo] = s[Mo] = s[Do] = s[ko] = !0;
540
+ s[Oo] = s[Vt] = s[Io] = !1;
541
541
  function D(t, e, r, n, i, o) {
542
542
  var a;
543
543
  if (a !== void 0)
544
544
  return a;
545
545
  if (!z(t))
546
546
  return t;
547
- var f = rt(t);
548
- if (f)
549
- a = Fn(t);
547
+ var l = rt(t);
548
+ if (l)
549
+ a = Mn(t);
550
550
  else {
551
- var l = T(t), u = l == Vt || l == wo;
551
+ var f = T(t), u = f == Vt || f == Ao;
552
552
  if (Bt(t))
553
- return wn(t);
554
- if (l == Kt || l == Ht || u && !i)
555
- a = u ? {} : co(t);
553
+ return An(t);
554
+ if (f == Kt || f == Ht || u && !i)
555
+ a = u ? {} : lo(t);
556
556
  else {
557
- if (!s[l])
557
+ if (!s[f])
558
558
  return i ? t : {};
559
- a = so(t, l);
559
+ a = uo(t, f);
560
560
  }
561
561
  }
562
562
  o || (o = new x());
563
563
  var d = o.get(t);
564
564
  if (d)
565
565
  return d;
566
- o.set(t, a), po(t) ? t.forEach(function(g) {
566
+ o.set(t, a), _o(t) ? t.forEach(function(g) {
567
567
  a.add(D(g, e, r, g, t, o));
568
- }) : fo(t) && t.forEach(function(g, h) {
568
+ }) : go(t) && t.forEach(function(g, h) {
569
569
  a.set(h, D(g, e, r, h, t, o));
570
570
  });
571
- var _ = xn, y = f ? void 0 : _(t);
572
- return ke(y || t, function(g, h) {
573
- y && (h = g, g = t[h]), Ke(a, h, D(g, e, r, h, t, o));
571
+ var _ = In, y = l ? void 0 : _(t);
572
+ return ze(y || t, function(g, h) {
573
+ y && (h = g, g = t[h]), Ye(a, h, D(g, e, r, h, t, o));
574
574
  }), a;
575
575
  }
576
- var Do = 1, ko = 4;
576
+ var Bo = 1, zo = 4;
577
577
  function it(t) {
578
- return D(t, Do | ko);
578
+ return D(t, Bo | zo);
579
579
  }
580
580
  const Ct = et("BaseAbs");
581
- class Bo {
581
+ class Go {
582
582
  _ui = null;
583
583
  _config;
584
584
  _initialized = !1;
@@ -640,7 +640,7 @@ class Bo {
640
640
  return this._initialized;
641
641
  }
642
642
  }
643
- class Yt extends Bo {
643
+ class Jt extends Go {
644
644
  // 设备操作(子类可重写)
645
645
  operating(e) {
646
646
  }
@@ -649,7 +649,7 @@ class Yt extends Bo {
649
649
  this.logger.operating("data=%o", e), this.operating(e);
650
650
  };
651
651
  }
652
- function Jt(t) {
652
+ function Yt(t) {
653
653
  const {
654
654
  name: e,
655
655
  width: r,
@@ -657,21 +657,21 @@ function Jt(t) {
657
657
  className: i = "CreateText",
658
658
  fill: o = "rgba(0,0,0,0.2)",
659
659
  fontSize: a,
660
- fontWeight: f = "black",
661
- hittable: l = !1
660
+ fontWeight: l = "black",
661
+ hittable: f = !1
662
662
  } = t, u = String(e);
663
663
  if (!u)
664
664
  return new at({ text: "", width: r, height: n, visible: 0 });
665
665
  const d = u.length, _ = Math.min(n * 0.8, r * 0.5), y = 12, g = r / (d * 0.6);
666
666
  let h = Math.min(_, g);
667
667
  return h < y && (h = y), new at({
668
- hittable: l,
668
+ hittable: f,
669
669
  className: i,
670
670
  text: u,
671
671
  textAlign: "center",
672
672
  verticalAlign: "middle",
673
673
  fontSize: a || h,
674
- fontWeight: f,
674
+ fontWeight: l,
675
675
  fill: o,
676
676
  width: r,
677
677
  height: n,
@@ -685,28 +685,28 @@ function Jt(t) {
685
685
  // 强制断词
686
686
  });
687
687
  }
688
- const zo = "#999999";
688
+ const Wo = "#999999";
689
689
  function Xt(t, e) {
690
- return t === $.TOOL ? { cornerRadius: e } : t === $.AUXILIARY ? { cornerRadius: 0, stroke: zo, strokeWidth: 1, showShadow: !1 } : { cornerRadius: e * 0.1 };
690
+ return t === $.TOOL ? { cornerRadius: e } : t === $.AUXILIARY ? { cornerRadius: 0, stroke: Wo, strokeWidth: 1, showShadow: !1 } : { cornerRadius: e * 0.1 };
691
691
  }
692
- const Go = "#fff", Wo = "rgba(0,0,0,0.85)", Ho = "rgba(255,255,255,0.8)", Vo = /^(#[0-9a-f]{3,8}|rgba?\(|hsla?\([a-z][-a-z0-9]*)$/i;
693
- function Ko(t) {
694
- return t ? !!(Vo.test(t) || /^[a-z][a-z-]{2,}$/i.test(t)) : !1;
692
+ const Ho = "#fff", Vo = "rgba(0,0,0,0.85)", Ko = "rgba(255,255,255,0.8)", Jo = /^(#[0-9a-f]{3,8}|rgba?\(|hsla?\([a-z][-a-z0-9]*)$/i;
693
+ function Yo(t) {
694
+ return t ? !!(Jo.test(t) || /^[a-z][a-z-]{2,}$/i.test(t)) : !1;
695
695
  }
696
696
  function qt(t) {
697
697
  if (typeof t != "string") return !1;
698
698
  const e = t.trim();
699
699
  if (!e) return !1;
700
700
  const r = e.toLowerCase();
701
- return r === "none" || r === "transparent" || r === "undefined" || r === "null" ? !1 : Ko(e);
701
+ return r === "none" || r === "transparent" || r === "undefined" || r === "null" ? !1 : Yo(e);
702
702
  }
703
- function Yo(t) {
704
- return qt(t) ? t : Go;
703
+ function Xo(t) {
704
+ return qt(t) ? t : Ho;
705
705
  }
706
- function Jo(t) {
707
- return qt(t) ? Ho : Wo;
706
+ function qo(t) {
707
+ return qt(t) ? Ko : Vo;
708
708
  }
709
- class Xo extends Yt {
709
+ class Zo extends Jt {
710
710
  constructor(e) {
711
711
  const r = {
712
712
  className: tt.RESOURCE,
@@ -723,7 +723,7 @@ class Xo extends Yt {
723
723
  super({ ...r, ...e });
724
724
  }
725
725
  createUi() {
726
- const { x: e, y: r, width: n, height: i, color: o, resourceType: a, resourceId: f, name: l, hittable: u } = this.config, d = Xt(a, n || 0);
726
+ const { x: e, y: r, width: n, height: i, color: o, resourceType: a, resourceId: l, name: f, hittable: u } = this.config, d = Xt(a, n || 0);
727
727
  return new $t({
728
728
  hittable: u,
729
729
  className: `Resource-${a}`,
@@ -731,7 +731,7 @@ class Xo extends Yt {
731
731
  y: r,
732
732
  width: n,
733
733
  height: i,
734
- fill: Yo(o),
734
+ fill: Xo(o),
735
735
  cornerRadius: d.cornerRadius,
736
736
  stroke: d.stroke,
737
737
  strokeWidth: d.strokeWidth,
@@ -740,7 +740,7 @@ class Xo extends Yt {
740
740
  opacity: 0,
741
741
  data: this.config,
742
742
  // resourceId 作为独立属性挂在 main 上,便于 AppController 全局查找匹配
743
- resourceId: f || "",
743
+ resourceId: l || "",
744
744
  animation: {
745
745
  keyframes: [{ scale: 1.2, opacity: 0 }, { scale: 0.95, opacity: 1 }, { scale: 1 }],
746
746
  duration: 0.5
@@ -753,17 +753,17 @@ class Xo extends Yt {
753
753
  duration: 0.3
754
754
  },
755
755
  children: [
756
- Jt({
757
- name: l,
756
+ Yt({
757
+ name: f,
758
758
  width: n,
759
759
  height: i,
760
- fill: Jo(o)
760
+ fill: qo(o)
761
761
  })
762
762
  ]
763
763
  });
764
764
  }
765
765
  }
766
- function qo(t) {
766
+ function Qo(t) {
767
767
  const e = {
768
768
  width: t.width * 0.1,
769
769
  // 阴影宽度为元素宽度的 10%
@@ -795,20 +795,20 @@ function qo(t) {
795
795
  color: "rgba(255,255,255,0.5)"
796
796
  }
797
797
  ]
798
- } = t, f = new re({
798
+ } = t, l = new oe({
799
799
  className: "ShadowCanvas",
800
800
  pixelRatio: devicePixelRatio,
801
801
  width: r,
802
802
  height: n,
803
803
  hittable: !1
804
- }), l = new ne();
805
- return l.setStyle({
804
+ }), f = new ie();
805
+ return f.setStyle({
806
806
  fill: "rgba(255,255,255,0)",
807
807
  shadow: o ?? void 0,
808
808
  innerShadow: a ?? void 0
809
- }), l.roundRect(0, 0, r, n, i), f.draw(l), f;
809
+ }), f.roundRect(0, 0, r, n, i), l.draw(f), l;
810
810
  }
811
- function Zo(t, e, r = "shadow") {
811
+ function ti(t, e, r = "shadow") {
812
812
  if (e.hittable && e.hitSelf && (e.clickable || e.menuClickable || e.draggable)) {
813
813
  let n = "default";
814
814
  const i = "#806EF7";
@@ -830,7 +830,7 @@ function Zo(t, e, r = "shadow") {
830
830
  });
831
831
  }
832
832
  }
833
- function ui(t, e = "rgba(66,66,66,0.9)") {
833
+ function hi(t, e = "rgba(66,66,66,0.9)") {
834
834
  t.set({
835
835
  shadow: {
836
836
  x: 2,
@@ -840,6 +840,20 @@ function ui(t, e = "rgba(66,66,66,0.9)") {
840
840
  }
841
841
  });
842
842
  }
843
+ let Zt = !0;
844
+ function di(t) {
845
+ Zt = t;
846
+ }
847
+ function gi() {
848
+ return Zt;
849
+ }
850
+ let Qt = "replace";
851
+ function pi(t) {
852
+ Qt = t;
853
+ }
854
+ function ei() {
855
+ return Qt;
856
+ }
843
857
  const k = "#BFC0C3", Q = {
844
858
  className: tt.STATION_SLOT,
845
859
  name: "",
@@ -864,7 +878,7 @@ const k = "#BFC0C3", Q = {
864
878
  maxResources: 5,
865
879
  visible: !0
866
880
  };
867
- class li extends Yt {
881
+ class bi extends Jt {
868
882
  children = [];
869
883
  // 缓存 destroyUI 后等待资源退场动画的清理任务,防止重复销毁
870
884
  pendingDestroy = null;
@@ -892,8 +906,8 @@ class li extends Yt {
892
906
  width: i,
893
907
  height: o,
894
908
  resourceType: a,
895
- hittable: f,
896
- disabled: l,
909
+ hittable: l,
910
+ disabled: f,
897
911
  visible: u,
898
912
  background: d = k,
899
913
  stroke: _ = "#999999",
@@ -901,31 +915,31 @@ class li extends Yt {
901
915
  textColor: g = "#6F7177",
902
916
  showShadow: h = !0,
903
917
  showText: H = !0,
904
- inFlow: Qt = !0,
905
- origin: te = "center",
906
- around: ee = "center"
918
+ inFlow: ee = !0,
919
+ origin: re = "center",
920
+ around: ne = "center"
907
921
  } = this.config, U = Xt(a, i || 0), M = new $t({
908
- hittable: f,
922
+ hittable: l,
909
923
  visible: u,
910
924
  className: `StationSlot-${a}`,
911
925
  x: e,
912
926
  y: r,
913
927
  width: i,
914
928
  height: o,
915
- origin: te,
916
- around: ee,
917
- disabled: l,
929
+ origin: re,
930
+ around: ne,
931
+ disabled: f,
918
932
  cornerRadius: U.cornerRadius,
919
933
  rotation: this.autoFixRotation,
920
934
  fill: d,
921
935
  hitFill: "all",
922
936
  stroke: _,
923
937
  strokeWidth: U.strokeWidth ?? y,
924
- inFlow: Qt,
938
+ inFlow: ee,
925
939
  data: this.config
926
940
  });
927
- if (Zo(M, { hittable: this.config.hittable, hitSelf: !0, clickable: !0 }, "border"), H) {
928
- const V = Jt({
941
+ if (ti(M, { hittable: this.config.hittable, hitSelf: !0, clickable: !0 }, "border"), H) {
942
+ const V = Yt({
929
943
  name: n,
930
944
  width: i,
931
945
  height: o,
@@ -934,7 +948,7 @@ class li extends Yt {
934
948
  M.add(V);
935
949
  }
936
950
  if (U.showShadow ?? h) {
937
- const V = qo({
951
+ const V = Qo({
938
952
  width: i,
939
953
  height: o,
940
954
  cornerRadius: U.cornerRadius,
@@ -981,10 +995,14 @@ class li extends Yt {
981
995
  // }
982
996
  /**
983
997
  * 添加工位资源
998
+ * 放置模式由容器配置决定(见 SlotResourceMode):replace 时先移除槽内已有资源(替换模式,
999
+ * 槽内始终最多 1 个);overlay 时并存,再按 maxResources 先进先出淘汰
984
1000
  * @param d
985
1001
  */
986
1002
  addPallet(e) {
987
- const { width: r, height: n, resourceType: i } = this.config, o = new Xo({
1003
+ const { width: r, height: n, resourceType: i } = this.config;
1004
+ ei() === "replace" && this.children.length > 0 && (this.children.splice(0).forEach((l) => this.animateOut(l)), this.syncResources());
1005
+ const o = new Zo({
988
1006
  x: this.width_05,
989
1007
  y: this.height_05,
990
1008
  width: r - 5,
@@ -1044,10 +1062,10 @@ class li extends Yt {
1044
1062
  o.destroy();
1045
1063
  continue;
1046
1064
  }
1047
- const f = window.setTimeout(() => {
1065
+ const l = window.setTimeout(() => {
1048
1066
  o.destroy();
1049
1067
  }, n);
1050
- i.push(f);
1068
+ i.push(l);
1051
1069
  }
1052
1070
  this.pendingDestroy = () => {
1053
1071
  i.forEach((o) => window.clearTimeout(o)), r.forEach((o) => o.destroy());
@@ -1117,12 +1135,12 @@ class li extends Yt {
1117
1135
  this.removeAllPallet(), this.pendingDestroy && (this.pendingDestroy(), this.pendingDestroy = null), this.ui?.destroy();
1118
1136
  }
1119
1137
  }
1120
- const Qo = /* @__PURE__ */ new Set(["index", "resourceType", "name", "className"]), Zt = Q, ti = (t) => {
1138
+ const ri = /* @__PURE__ */ new Set(["index", "resourceType", "name", "className"]), te = Q, ni = (t) => {
1121
1139
  const e = {};
1122
1140
  for (const [r, n] of Object.entries(t))
1123
- n !== void 0 && (!Qo.has(r) && Zt[r] === n || (e[r] = n));
1141
+ n !== void 0 && (!ri.has(r) && te[r] === n || (e[r] = n));
1124
1142
  return e;
1125
- }, ei = (t) => ({ ...Zt, ...t }), B = (t, e) => {
1143
+ }, oi = (t) => ({ ...te, ...t }), B = (t, e) => {
1126
1144
  if (Array.isArray(t)) {
1127
1145
  t.forEach((n) => B(n, e));
1128
1146
  return;
@@ -1130,14 +1148,14 @@ const Qo = /* @__PURE__ */ new Set(["index", "resourceType", "name", "className"
1130
1148
  if (!t || typeof t != "object") return;
1131
1149
  const r = t;
1132
1150
  Array.isArray(r.stationSlots) && (r.stationSlots = r.stationSlots.map(e)), Object.values(r).forEach((n) => B(n, e));
1133
- }, ri = (t) => {
1151
+ }, ii = (t) => {
1134
1152
  const e = it(t);
1135
- return B(e, ti), e;
1136
- }, fi = (t) => t.map(ri), ni = (t) => {
1153
+ return B(e, ni), e;
1154
+ }, _i = (t) => t.map(ii), ai = (t) => {
1137
1155
  const e = it(t);
1138
- return B(e, ei), e;
1139
- }, hi = (t) => t.map(ni);
1140
- function* di(t, e, r = !1) {
1156
+ return B(e, oi), e;
1157
+ }, yi = (t) => t.map(ai);
1158
+ function* Ti(t, e, r = !1) {
1141
1159
  let n = t;
1142
1160
  for (; ; ) {
1143
1161
  if (n > e)
@@ -1148,11 +1166,11 @@ function* di(t, e, r = !1) {
1148
1166
  yield n++;
1149
1167
  }
1150
1168
  }
1151
- const gi = (t = 0, e = 100, r = 3, n = 300, i) => i ? new Promise((o) => {
1152
- const a = t, f = e, l = r * 1e3, u = performance.now();
1169
+ const wi = (t = 0, e = 100, r = 3, n = 300, i) => i ? new Promise((o) => {
1170
+ const a = t, l = e, f = r * 1e3, u = performance.now();
1153
1171
  let d = 0;
1154
1172
  const _ = (y) => {
1155
- const g = y - u, h = Math.min(g / l, 1), H = a + (f - a) * h;
1173
+ const g = y - u, h = Math.min(g / f, 1), H = a + (l - a) * h;
1156
1174
  if (i(H.toFixed(2)), h >= 1) {
1157
1175
  cancelAnimationFrame(d), o();
1158
1176
  return;
@@ -1161,13 +1179,13 @@ const gi = (t = 0, e = 100, r = 3, n = 300, i) => i ? new Promise((o) => {
1161
1179
  };
1162
1180
  d = requestAnimationFrame(_);
1163
1181
  }) : !1;
1164
- function pi(t, e, r = 3, n) {
1182
+ function Oi(t, e, r = 3, n) {
1165
1183
  return t === void 0 || e === void 0 ? 0 : n ? e > 0 ? Number((t / e).toFixed(3)) : 0 : Number((e * t).toFixed(r));
1166
1184
  }
1167
- function bi(t, e) {
1185
+ function Ai(t, e) {
1168
1186
  return t === void 0 || e === void 0 ? 0 : e > 0 ? Number((t / e).toFixed(3)) : t;
1169
1187
  }
1170
- function _i(t, e, r, n) {
1188
+ function mi(t, e, r, n) {
1171
1189
  if (t === void 0) return NaN;
1172
1190
  let i = 0;
1173
1191
  if (n === "width") {
@@ -1182,7 +1200,7 @@ function _i(t, e, r, n) {
1182
1200
  }
1183
1201
  return Number((t * i).toFixed(r));
1184
1202
  }
1185
- function yi(t, e, r, n) {
1203
+ function Si(t, e, r, n) {
1186
1204
  if (t === void 0) return NaN;
1187
1205
  let i = 0;
1188
1206
  if (n === "width") {
@@ -1198,38 +1216,41 @@ function yi(t, e, r, n) {
1198
1216
  return Number(i.toFixed(r));
1199
1217
  }
1200
1218
  export {
1201
- Zo as A,
1202
- Bo as B,
1203
- ui as C,
1204
- le as D,
1205
- oe as E,
1206
- Yt as F,
1207
- qo as G,
1208
- Q as H,
1209
- ii as M,
1210
- ue as R,
1211
- li as S,
1212
- ie as a,
1213
- ae as b,
1219
+ ti as A,
1220
+ Go as B,
1221
+ hi as C,
1222
+ he as D,
1223
+ ae as E,
1224
+ Jt as F,
1225
+ gi as G,
1226
+ Qo as H,
1227
+ di as I,
1228
+ pi as J,
1229
+ Q as K,
1230
+ ci as M,
1231
+ fe as R,
1232
+ bi as S,
1233
+ se as a,
1234
+ ce as b,
1214
1235
  p as c,
1215
1236
  tt as d,
1216
1237
  $ as e,
1217
- se as f,
1218
- ce as g,
1219
- bi as h,
1220
- _i as i,
1221
- yi as j,
1222
- si as k,
1223
- gi as l,
1238
+ ue as f,
1239
+ le as g,
1240
+ Ai as h,
1241
+ mi as i,
1242
+ Si as j,
1243
+ li as k,
1244
+ wi as l,
1224
1245
  et as m,
1225
- di as n,
1226
- ci as o,
1227
- ri as p,
1228
- fi as q,
1229
- ni as r,
1230
- ai as s,
1231
- pi as t,
1232
- hi as u,
1246
+ Ti as n,
1247
+ fi as o,
1248
+ ii as p,
1249
+ _i as q,
1250
+ ai as r,
1251
+ ui as s,
1252
+ Oi as t,
1253
+ yi as u,
1233
1254
  F as v,
1234
1255
  P as w,
1235
1256
  z as x,