@linkurious/ogma-annotations-react 1.1.22 → 1.1.24

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/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import Ir, { createContext as jr, useContext as Kr, useReducer as Zr, useState as Nt, useEffect as rr } from "react";
1
+ import $r, { createContext as jr, useContext as Kr, useReducer as Zr, useState as Nt, useEffect as nr } from "react";
2
2
  import { useOgma as Qr } from "@linkurious/ogma-react";
3
3
  var Pe = { exports: {} }, he = {};
4
4
  /**
@@ -14,15 +14,15 @@ var fr;
14
14
  function tn() {
15
15
  if (fr) return he;
16
16
  fr = 1;
17
- var u = Ir, e = Symbol.for("react.element"), s = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, a = u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, c = { key: !0, ref: !0, __self: !0, __source: !0 };
18
- function f(g, d, v) {
19
- var y, A = {}, _ = null, S = null;
20
- v !== void 0 && (_ = "" + v), d.key !== void 0 && (_ = "" + d.key), d.ref !== void 0 && (S = d.ref);
21
- for (y in d) n.call(d, y) && !c.hasOwnProperty(y) && (A[y] = d[y]);
22
- if (g && g.defaultProps) for (y in d = g.defaultProps, d) A[y] === void 0 && (A[y] = d[y]);
23
- return { $$typeof: e, type: g, key: _, ref: S, props: A, _owner: a.current };
24
- }
25
- return he.Fragment = s, he.jsx = f, he.jsxs = f, he;
17
+ var u = $r, e = Symbol.for("react.element"), o = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, l = u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, h = { key: !0, ref: !0, __self: !0, __source: !0 };
18
+ function d(g, f, v) {
19
+ var y, A = {}, k = null, S = null;
20
+ v !== void 0 && (k = "" + v), f.key !== void 0 && (k = "" + f.key), f.ref !== void 0 && (S = f.ref);
21
+ for (y in f) n.call(f, y) && !h.hasOwnProperty(y) && (A[y] = f[y]);
22
+ if (g && g.defaultProps) for (y in f = g.defaultProps, f) A[y] === void 0 && (A[y] = f[y]);
23
+ return { $$typeof: e, type: g, key: k, ref: S, props: A, _owner: l.current };
24
+ }
25
+ return he.Fragment = o, he.jsx = d, he.jsxs = d, he;
26
26
  }
27
27
  var ce = {};
28
28
  /**
@@ -37,46 +37,46 @@ var ce = {};
37
37
  var gr;
38
38
  function en() {
39
39
  return gr || (gr = 1, process.env.NODE_ENV !== "production" && function() {
40
- var u = Ir, e = Symbol.for("react.element"), s = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), c = Symbol.for("react.profiler"), f = Symbol.for("react.provider"), g = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), v = Symbol.for("react.suspense"), y = Symbol.for("react.suspense_list"), A = Symbol.for("react.memo"), _ = Symbol.for("react.lazy"), S = Symbol.for("react.offscreen"), R = Symbol.iterator, C = "@@iterator";
40
+ var u = $r, e = Symbol.for("react.element"), o = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), l = Symbol.for("react.strict_mode"), h = Symbol.for("react.profiler"), d = Symbol.for("react.provider"), g = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), v = Symbol.for("react.suspense"), y = Symbol.for("react.suspense_list"), A = Symbol.for("react.memo"), k = Symbol.for("react.lazy"), S = Symbol.for("react.offscreen"), R = Symbol.iterator, C = "@@iterator";
41
41
  function L(t) {
42
42
  if (t === null || typeof t != "object")
43
43
  return null;
44
- var o = R && t[R] || t[C];
45
- return typeof o == "function" ? o : null;
44
+ var s = R && t[R] || t[C];
45
+ return typeof s == "function" ? s : null;
46
46
  }
47
- var I = u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
48
- function k(t) {
47
+ var $ = u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
48
+ function _(t) {
49
49
  {
50
- for (var o = arguments.length, h = new Array(o > 1 ? o - 1 : 0), p = 1; p < o; p++)
51
- h[p - 1] = arguments[p];
52
- z("error", t, h);
50
+ for (var s = arguments.length, c = new Array(s > 1 ? s - 1 : 0), p = 1; p < s; p++)
51
+ c[p - 1] = arguments[p];
52
+ z("error", t, c);
53
53
  }
54
54
  }
55
- function z(t, o, h) {
55
+ function z(t, s, c) {
56
56
  {
57
- var p = I.ReactDebugCurrentFrame, m = p.getStackAddendum();
58
- m !== "" && (o += "%s", h = h.concat([m]));
59
- var w = h.map(function(b) {
57
+ var p = $.ReactDebugCurrentFrame, m = p.getStackAddendum();
58
+ m !== "" && (s += "%s", c = c.concat([m]));
59
+ var w = c.map(function(b) {
60
60
  return String(b);
61
61
  });
62
- w.unshift("Warning: " + o), Function.prototype.apply.call(console[t], console, w);
62
+ w.unshift("Warning: " + s), Function.prototype.apply.call(console[t], console, w);
63
63
  }
64
64
  }
65
65
  var B = !1, tt = !1, rt = !1, Yt = !1, Vt = !1, ge;
66
66
  ge = Symbol.for("react.module.reference");
67
67
  function Dt(t) {
68
- return !!(typeof t == "string" || typeof t == "function" || t === n || t === c || Vt || t === a || t === v || t === y || Yt || t === S || B || tt || rt || typeof t == "object" && t !== null && (t.$$typeof === _ || t.$$typeof === A || t.$$typeof === f || t.$$typeof === g || t.$$typeof === d || // This needs to include all possible module reference object
68
+ return !!(typeof t == "string" || typeof t == "function" || t === n || t === h || Vt || t === l || t === v || t === y || Yt || t === S || B || tt || rt || typeof t == "object" && t !== null && (t.$$typeof === k || t.$$typeof === A || t.$$typeof === d || t.$$typeof === g || t.$$typeof === f || // This needs to include all possible module reference object
69
69
  // types supported by any Flight configuration anywhere since
70
70
  // we don't know which Flight build this will end up being used
71
71
  // with.
72
72
  t.$$typeof === ge || t.getModuleId !== void 0));
73
73
  }
74
- function Pt(t, o, h) {
74
+ function Pt(t, s, c) {
75
75
  var p = t.displayName;
76
76
  if (p)
77
77
  return p;
78
- var m = o.displayName || o.name || "";
79
- return m !== "" ? h + "(" + m + ")" : h;
78
+ var m = s.displayName || s.name || "";
79
+ return m !== "" ? c + "(" + m + ")" : c;
80
80
  }
81
81
  function pe(t) {
82
82
  return t.displayName || "Context";
@@ -84,18 +84,18 @@ function en() {
84
84
  function it(t) {
85
85
  if (t == null)
86
86
  return null;
87
- if (typeof t.tag == "number" && k("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof t == "function")
87
+ if (typeof t.tag == "number" && _("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof t == "function")
88
88
  return t.displayName || t.name || null;
89
89
  if (typeof t == "string")
90
90
  return t;
91
91
  switch (t) {
92
92
  case n:
93
93
  return "Fragment";
94
- case s:
94
+ case o:
95
95
  return "Portal";
96
- case c:
96
+ case h:
97
97
  return "Profiler";
98
- case a:
98
+ case l:
99
99
  return "StrictMode";
100
100
  case v:
101
101
  return "Suspense";
@@ -105,17 +105,17 @@ function en() {
105
105
  if (typeof t == "object")
106
106
  switch (t.$$typeof) {
107
107
  case g:
108
- var o = t;
109
- return pe(o) + ".Consumer";
110
- case f:
111
- var h = t;
112
- return pe(h._context) + ".Provider";
108
+ var s = t;
109
+ return pe(s) + ".Consumer";
113
110
  case d:
111
+ var c = t;
112
+ return pe(c._context) + ".Provider";
113
+ case f:
114
114
  return Pt(t, t.render, "ForwardRef");
115
115
  case A:
116
116
  var p = t.displayName || null;
117
117
  return p !== null ? p : it(t.type) || "Memo";
118
- case _: {
118
+ case k: {
119
119
  var m = t, w = m._payload, b = m._init;
120
120
  try {
121
121
  return it(b(w));
@@ -153,7 +153,7 @@ function en() {
153
153
  lt++;
154
154
  }
155
155
  }
156
- function He() {
156
+ function Be() {
157
157
  {
158
158
  if (lt--, lt === 0) {
159
159
  var t = {
@@ -185,11 +185,11 @@ function en() {
185
185
  })
186
186
  });
187
187
  }
188
- lt < 0 && k("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
188
+ lt < 0 && _("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
189
189
  }
190
190
  }
191
- var Gt = I.ReactCurrentDispatcher, Jt;
192
- function $t(t, o, h) {
191
+ var Gt = $.ReactCurrentDispatcher, Jt;
192
+ function It(t, s, c) {
193
193
  {
194
194
  if (Jt === void 0)
195
195
  try {
@@ -204,16 +204,16 @@ function en() {
204
204
  }
205
205
  var Kt = !1, _t;
206
206
  {
207
- var Be = typeof WeakMap == "function" ? WeakMap : Map;
208
- _t = new Be();
207
+ var qe = typeof WeakMap == "function" ? WeakMap : Map;
208
+ _t = new qe();
209
209
  }
210
- function Zt(t, o) {
210
+ function Zt(t, s) {
211
211
  if (!t || Kt)
212
212
  return "";
213
213
  {
214
- var h = _t.get(t);
215
- if (h !== void 0)
216
- return h;
214
+ var c = _t.get(t);
215
+ if (c !== void 0)
216
+ return c;
217
217
  }
218
218
  var p;
219
219
  Kt = !0;
@@ -222,7 +222,7 @@ function en() {
222
222
  var w;
223
223
  w = Gt.current, Gt.current = null, be();
224
224
  try {
225
- if (o) {
225
+ if (s) {
226
226
  var b = function() {
227
227
  throw Error();
228
228
  };
@@ -273,56 +273,56 @@ function en() {
273
273
  }
274
274
  }
275
275
  } finally {
276
- Kt = !1, Gt.current = w, He(), Error.prepareStackTrace = m;
276
+ Kt = !1, Gt.current = w, Be(), Error.prepareStackTrace = m;
277
277
  }
278
- var W = t ? t.displayName || t.name : "", F = W ? $t(W) : "";
278
+ var W = t ? t.displayName || t.name : "", F = W ? It(W) : "";
279
279
  return typeof t == "function" && _t.set(t, F), F;
280
280
  }
281
- function qe(t, o, h) {
281
+ function We(t, s, c) {
282
282
  return Zt(t, !1);
283
283
  }
284
- function We(t) {
285
- var o = t.prototype;
286
- return !!(o && o.isReactComponent);
284
+ function Ue(t) {
285
+ var s = t.prototype;
286
+ return !!(s && s.isReactComponent);
287
287
  }
288
- function It(t, o, h) {
288
+ function $t(t, s, c) {
289
289
  if (t == null)
290
290
  return "";
291
291
  if (typeof t == "function")
292
- return Zt(t, We(t));
292
+ return Zt(t, Ue(t));
293
293
  if (typeof t == "string")
294
- return $t(t);
294
+ return It(t);
295
295
  switch (t) {
296
296
  case v:
297
- return $t("Suspense");
297
+ return It("Suspense");
298
298
  case y:
299
- return $t("SuspenseList");
299
+ return It("SuspenseList");
300
300
  }
301
301
  if (typeof t == "object")
302
302
  switch (t.$$typeof) {
303
- case d:
304
- return qe(t.render);
303
+ case f:
304
+ return We(t.render);
305
305
  case A:
306
- return It(t.type, o, h);
307
- case _: {
306
+ return $t(t.type, s, c);
307
+ case k: {
308
308
  var p = t, m = p._payload, w = p._init;
309
309
  try {
310
- return It(w(m), o, h);
310
+ return $t(w(m), s, c);
311
311
  } catch {
312
312
  }
313
313
  }
314
314
  }
315
315
  return "";
316
316
  }
317
- var bt = Object.prototype.hasOwnProperty, we = {}, xe = I.ReactDebugCurrentFrame;
317
+ var bt = Object.prototype.hasOwnProperty, we = {}, xe = $.ReactDebugCurrentFrame;
318
318
  function jt(t) {
319
319
  if (t) {
320
- var o = t._owner, h = It(t.type, t._source, o ? o.type : null);
321
- xe.setExtraStackFrame(h);
320
+ var s = t._owner, c = $t(t.type, t._source, s ? s.type : null);
321
+ xe.setExtraStackFrame(c);
322
322
  } else
323
323
  xe.setExtraStackFrame(null);
324
324
  }
325
- function Ue(t, o, h, p, m) {
325
+ function Ye(t, s, c, p, m) {
326
326
  {
327
327
  var w = Function.call.bind(bt);
328
328
  for (var b in t)
@@ -330,28 +330,28 @@ function en() {
330
330
  var E = void 0;
331
331
  try {
332
332
  if (typeof t[b] != "function") {
333
- var D = Error((p || "React class") + ": " + h + " type `" + b + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof t[b] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
333
+ var D = Error((p || "React class") + ": " + c + " type `" + b + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof t[b] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
334
334
  throw D.name = "Invariant Violation", D;
335
335
  }
336
- E = t[b](o, b, p, h, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
336
+ E = t[b](s, b, p, c, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
337
337
  } catch (T) {
338
338
  E = T;
339
339
  }
340
- E && !(E instanceof Error) && (jt(m), k("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", p || "React class", h, b, typeof E), jt(null)), E instanceof Error && !(E.message in we) && (we[E.message] = !0, jt(m), k("Failed %s type: %s", h, E.message), jt(null));
340
+ E && !(E instanceof Error) && (jt(m), _("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", p || "React class", c, b, typeof E), jt(null)), E instanceof Error && !(E.message in we) && (we[E.message] = !0, jt(m), _("Failed %s type: %s", c, E.message), jt(null));
341
341
  }
342
342
  }
343
343
  }
344
- var Ye = Array.isArray;
344
+ var Ve = Array.isArray;
345
345
  function Qt(t) {
346
- return Ye(t);
346
+ return Ve(t);
347
347
  }
348
348
  function q(t) {
349
349
  {
350
- var o = typeof Symbol == "function" && Symbol.toStringTag, h = o && t[Symbol.toStringTag] || t.constructor.name || "Object";
351
- return h;
350
+ var s = typeof Symbol == "function" && Symbol.toStringTag, c = s && t[Symbol.toStringTag] || t.constructor.name || "Object";
351
+ return c;
352
352
  }
353
353
  }
354
- function Ve(t) {
354
+ function Xe(t) {
355
355
  try {
356
356
  return Ee(t), !1;
357
357
  } catch {
@@ -362,64 +362,64 @@ function en() {
362
362
  return "" + t;
363
363
  }
364
364
  function te(t) {
365
- if (Ve(t))
366
- return k("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", q(t)), Ee(t);
365
+ if (Xe(t))
366
+ return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", q(t)), Ee(t);
367
367
  }
368
- var ct = I.ReactCurrentOwner, Ae = {
368
+ var ct = $.ReactCurrentOwner, Ae = {
369
369
  key: !0,
370
370
  ref: !0,
371
371
  __self: !0,
372
372
  __source: !0
373
373
  }, Ft, ke;
374
- function Xe(t) {
374
+ function Ge(t) {
375
375
  if (bt.call(t, "ref")) {
376
- var o = Object.getOwnPropertyDescriptor(t, "ref").get;
377
- if (o && o.isReactWarning)
376
+ var s = Object.getOwnPropertyDescriptor(t, "ref").get;
377
+ if (s && s.isReactWarning)
378
378
  return !1;
379
379
  }
380
380
  return t.ref !== void 0;
381
381
  }
382
382
  function ee(t) {
383
383
  if (bt.call(t, "key")) {
384
- var o = Object.getOwnPropertyDescriptor(t, "key").get;
385
- if (o && o.isReactWarning)
384
+ var s = Object.getOwnPropertyDescriptor(t, "key").get;
385
+ if (s && s.isReactWarning)
386
386
  return !1;
387
387
  }
388
388
  return t.key !== void 0;
389
389
  }
390
- function Ge(t, o) {
390
+ function Je(t, s) {
391
391
  typeof t.ref == "string" && ct.current;
392
392
  }
393
- function Je(t, o) {
393
+ function Ke(t, s) {
394
394
  {
395
- var h = function() {
396
- Ft || (Ft = !0, k("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", o));
395
+ var c = function() {
396
+ Ft || (Ft = !0, _("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", s));
397
397
  };
398
- h.isReactWarning = !0, Object.defineProperty(t, "key", {
399
- get: h,
398
+ c.isReactWarning = !0, Object.defineProperty(t, "key", {
399
+ get: c,
400
400
  configurable: !0
401
401
  });
402
402
  }
403
403
  }
404
- function Ke(t, o) {
404
+ function Ze(t, s) {
405
405
  {
406
- var h = function() {
407
- ke || (ke = !0, k("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", o));
406
+ var c = function() {
407
+ ke || (ke = !0, _("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", s));
408
408
  };
409
- h.isReactWarning = !0, Object.defineProperty(t, "ref", {
410
- get: h,
409
+ c.isReactWarning = !0, Object.defineProperty(t, "ref", {
410
+ get: c,
411
411
  configurable: !0
412
412
  });
413
413
  }
414
414
  }
415
- var re = function(t, o, h, p, m, w, b) {
415
+ var re = function(t, s, c, p, m, w, b) {
416
416
  var E = {
417
417
  // This tag allows us to uniquely identify this as a React Element
418
418
  $$typeof: e,
419
419
  // Built-in properties that belong on the element
420
420
  type: t,
421
- key: o,
422
- ref: h,
421
+ key: s,
422
+ ref: c,
423
423
  props: b,
424
424
  // Record the component responsible for creating this element.
425
425
  _owner: w
@@ -441,12 +441,12 @@ function en() {
441
441
  value: m
442
442
  }), Object.freeze && (Object.freeze(E.props), Object.freeze(E)), E;
443
443
  };
444
- function _e(t, o, h, p, m) {
444
+ function _e(t, s, c, p, m) {
445
445
  {
446
446
  var w, b = {}, E = null, D = null;
447
- h !== void 0 && (te(h), E = "" + h), ee(o) && (te(o.key), E = "" + o.key), Xe(o) && (D = o.ref, Ge(o, m));
448
- for (w in o)
449
- bt.call(o, w) && !Ae.hasOwnProperty(w) && (b[w] = o[w]);
447
+ c !== void 0 && (te(c), E = "" + c), ee(s) && (te(s.key), E = "" + s.key), Ge(s) && (D = s.ref, Je(s, m));
448
+ for (w in s)
449
+ bt.call(s, w) && !Ae.hasOwnProperty(w) && (b[w] = s[w]);
450
450
  if (t && t.defaultProps) {
451
451
  var T = t.defaultProps;
452
452
  for (w in T)
@@ -454,16 +454,16 @@ function en() {
454
454
  }
455
455
  if (E || D) {
456
456
  var O = typeof t == "function" ? t.displayName || t.name || "Unknown" : t;
457
- E && Je(b, O), D && Ke(b, O);
457
+ E && Ke(b, O), D && Ze(b, O);
458
458
  }
459
459
  return re(t, E, D, m, p, ct.current, b);
460
460
  }
461
461
  }
462
- var dt = I.ReactCurrentOwner, Se = I.ReactDebugCurrentFrame;
462
+ var dt = $.ReactCurrentOwner, Se = $.ReactDebugCurrentFrame;
463
463
  function wt(t) {
464
464
  if (t) {
465
- var o = t._owner, h = It(t.type, t._source, o ? o.type : null);
466
- Se.setExtraStackFrame(h);
465
+ var s = t._owner, c = $t(t.type, t._source, s ? s.type : null);
466
+ Se.setExtraStackFrame(c);
467
467
  } else
468
468
  Se.setExtraStackFrame(null);
469
469
  }
@@ -490,37 +490,37 @@ Check the render method of \`` + t + "`.";
490
490
  var Ce = {};
491
491
  function Te(t) {
492
492
  {
493
- var o = xt();
494
- if (!o) {
495
- var h = typeof t == "string" ? t : t.displayName || t.name;
496
- h && (o = `
493
+ var s = xt();
494
+ if (!s) {
495
+ var c = typeof t == "string" ? t : t.displayName || t.name;
496
+ c && (s = `
497
497
 
498
- Check the top-level render call using <` + h + ">.");
498
+ Check the top-level render call using <` + c + ">.");
499
499
  }
500
- return o;
500
+ return s;
501
501
  }
502
502
  }
503
- function ie(t, o) {
503
+ function ie(t, s) {
504
504
  {
505
505
  if (!t._store || t._store.validated || t.key != null)
506
506
  return;
507
507
  t._store.validated = !0;
508
- var h = Te(o);
509
- if (Ce[h])
508
+ var c = Te(s);
509
+ if (Ce[c])
510
510
  return;
511
- Ce[h] = !0;
511
+ Ce[c] = !0;
512
512
  var p = "";
513
- t && t._owner && t._owner !== dt.current && (p = " It was passed a child from " + it(t._owner.type) + "."), wt(t), k('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', h, p), wt(null);
513
+ t && t._owner && t._owner !== dt.current && (p = " It was passed a child from " + it(t._owner.type) + "."), wt(t), _('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', c, p), wt(null);
514
514
  }
515
515
  }
516
- function Re(t, o) {
516
+ function Re(t, s) {
517
517
  {
518
518
  if (typeof t != "object")
519
519
  return;
520
520
  if (Qt(t))
521
- for (var h = 0; h < t.length; h++) {
522
- var p = t[h];
523
- G(p) && ie(p, o);
521
+ for (var c = 0; c < t.length; c++) {
522
+ var p = t[c];
523
+ G(p) && ie(p, s);
524
524
  }
525
525
  else if (G(t))
526
526
  t._store && (t._store.validated = !0);
@@ -528,49 +528,49 @@ Check the top-level render call using <` + h + ">.");
528
528
  var m = L(t);
529
529
  if (typeof m == "function" && m !== t.entries)
530
530
  for (var w = m.call(t), b; !(b = w.next()).done; )
531
- G(b.value) && ie(b.value, o);
531
+ G(b.value) && ie(b.value, s);
532
532
  }
533
533
  }
534
534
  }
535
- function se(t) {
535
+ function oe(t) {
536
536
  {
537
- var o = t.type;
538
- if (o == null || typeof o == "string")
537
+ var s = t.type;
538
+ if (s == null || typeof s == "string")
539
539
  return;
540
- var h;
541
- if (typeof o == "function")
542
- h = o.propTypes;
543
- else if (typeof o == "object" && (o.$$typeof === d || // Note: Memo only checks outer props here.
540
+ var c;
541
+ if (typeof s == "function")
542
+ c = s.propTypes;
543
+ else if (typeof s == "object" && (s.$$typeof === f || // Note: Memo only checks outer props here.
544
544
  // Inner props are checked in the reconciler.
545
- o.$$typeof === A))
546
- h = o.propTypes;
545
+ s.$$typeof === A))
546
+ c = s.propTypes;
547
547
  else
548
548
  return;
549
- if (h) {
550
- var p = it(o);
551
- Ue(h, t.props, "prop", p, t);
552
- } else if (o.PropTypes !== void 0 && !St) {
549
+ if (c) {
550
+ var p = it(s);
551
+ Ye(c, t.props, "prop", p, t);
552
+ } else if (s.PropTypes !== void 0 && !St) {
553
553
  St = !0;
554
- var m = it(o);
555
- k("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", m || "Unknown");
554
+ var m = it(s);
555
+ _("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", m || "Unknown");
556
556
  }
557
- typeof o.getDefaultProps == "function" && !o.getDefaultProps.isReactClassApproved && k("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
557
+ typeof s.getDefaultProps == "function" && !s.getDefaultProps.isReactClassApproved && _("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
558
558
  }
559
559
  }
560
- function Ze(t) {
560
+ function Qe(t) {
561
561
  {
562
- for (var o = Object.keys(t.props), h = 0; h < o.length; h++) {
563
- var p = o[h];
562
+ for (var s = Object.keys(t.props), c = 0; c < s.length; c++) {
563
+ var p = s[c];
564
564
  if (p !== "children" && p !== "key") {
565
- wt(t), k("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", p), wt(null);
565
+ wt(t), _("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", p), wt(null);
566
566
  break;
567
567
  }
568
568
  }
569
- t.ref !== null && (wt(t), k("Invalid attribute `ref` supplied to `React.Fragment`."), wt(null));
569
+ t.ref !== null && (wt(t), _("Invalid attribute `ref` supplied to `React.Fragment`."), wt(null));
570
570
  }
571
571
  }
572
- var oe = {};
573
- function ae(t, o, h, p, m, w) {
572
+ var se = {};
573
+ function ae(t, s, c, p, m, w) {
574
574
  {
575
575
  var b = Dt(t);
576
576
  if (!b) {
@@ -579,13 +579,13 @@ Check the top-level render call using <` + h + ">.");
579
579
  var D = ne();
580
580
  D ? E += D : E += xt();
581
581
  var T;
582
- t === null ? T = "null" : Qt(t) ? T = "array" : t !== void 0 && t.$$typeof === e ? (T = "<" + (it(t.type) || "Unknown") + " />", E = " Did you accidentally export a JSX literal instead of a component?") : T = typeof t, k("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", T, E);
582
+ t === null ? T = "null" : Qt(t) ? T = "array" : t !== void 0 && t.$$typeof === e ? (T = "<" + (it(t.type) || "Unknown") + " />", E = " Did you accidentally export a JSX literal instead of a component?") : T = typeof t, _("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", T, E);
583
583
  }
584
- var O = _e(t, o, h, m, w);
584
+ var O = _e(t, s, c, m, w);
585
585
  if (O == null)
586
586
  return O;
587
587
  if (b) {
588
- var j = o.children;
588
+ var j = s.children;
589
589
  if (j !== void 0)
590
590
  if (p)
591
591
  if (Qt(j)) {
@@ -593,43 +593,43 @@ Check the top-level render call using <` + h + ">.");
593
593
  Re(j[W], t);
594
594
  Object.freeze && Object.freeze(j);
595
595
  } else
596
- k("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
596
+ _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
597
597
  else
598
598
  Re(j, t);
599
599
  }
600
- if (bt.call(o, "key")) {
601
- var F = it(t), P = Object.keys(o).filter(function(J) {
600
+ if (bt.call(s, "key")) {
601
+ var F = it(t), P = Object.keys(s).filter(function(J) {
602
602
  return J !== "key";
603
603
  }), H = P.length > 0 ? "{key: someKey, " + P.join(": ..., ") + ": ...}" : "{key: someKey}";
604
- if (!oe[F + H]) {
604
+ if (!se[F + H]) {
605
605
  var N = P.length > 0 ? "{" + P.join(": ..., ") + ": ...}" : "{}";
606
- k(`A props object containing a "key" prop is being spread into JSX:
606
+ _(`A props object containing a "key" prop is being spread into JSX:
607
607
  let props = %s;
608
608
  <%s {...props} />
609
609
  React keys must be passed directly to JSX without using spread:
610
610
  let props = %s;
611
- <%s key={someKey} {...props} />`, H, F, N, F), oe[F + H] = !0;
611
+ <%s key={someKey} {...props} />`, H, F, N, F), se[F + H] = !0;
612
612
  }
613
613
  }
614
- return t === n ? Ze(O) : se(O), O;
614
+ return t === n ? Qe(O) : oe(O), O;
615
615
  }
616
616
  }
617
- function Qe(t, o, h) {
618
- return ae(t, o, h, !0);
617
+ function tr(t, s, c) {
618
+ return ae(t, s, c, !0);
619
619
  }
620
- function r(t, o, h) {
621
- return ae(t, o, h, !1);
620
+ function r(t, s, c) {
621
+ return ae(t, s, c, !1);
622
622
  }
623
- var i = r, l = Qe;
624
- ce.Fragment = n, ce.jsx = i, ce.jsxs = l;
623
+ var i = r, a = tr;
624
+ ce.Fragment = n, ce.jsx = i, ce.jsxs = a;
625
625
  }()), ce;
626
626
  }
627
627
  var pr;
628
628
  function rn() {
629
629
  return pr || (pr = 1, process.env.NODE_ENV === "production" ? Pe.exports = tn() : Pe.exports = en()), Pe.exports;
630
630
  }
631
- var nn = rn(), sn = Object.defineProperty, on = (u, e, s) => e in u ? sn(u, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : u[e] = s, x = (u, e, s) => on(u, typeof e != "symbol" ? e + "" : e, s);
632
- let Ne = (u = 21) => crypto.getRandomValues(new Uint8Array(u)).reduce((e, s) => (s &= 63, s < 36 ? e += s.toString(36) : s < 62 ? e += (s - 26).toString(36).toUpperCase() : s > 62 ? e += "-" : e += "_", e), "");
631
+ var nn = rn(), on = Object.defineProperty, sn = (u, e, o) => e in u ? on(u, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : u[e] = o, x = (u, e, o) => sn(u, typeof e != "symbol" ? e + "" : e, o);
632
+ let He = (u = 21) => crypto.getRandomValues(new Uint8Array(u)).reduce((e, o) => (o &= 63, o < 36 ? e += o.toString(36) : o < 62 ? e += (o - 26).toString(36).toUpperCase() : o > 62 ? e += "-" : e += "_", e), "");
633
633
  const fe = {
634
634
  strokeType: "plain",
635
635
  strokeColor: "#202020",
@@ -662,21 +662,21 @@ const fe = {
662
662
  // tail: 'arrow-plain',
663
663
  // start: { x: 0, y: 0 },
664
664
  // end: { x: 100, y: 100 }
665
- }, an = (u = 0, e = 0, s = 0, n = 0, a = { ...fe }) => ({
666
- id: Ne(),
665
+ }, an = (u = 0, e = 0, o = 0, n = 0, l = { ...fe }) => ({
666
+ id: He(),
667
667
  type: "Feature",
668
668
  properties: {
669
669
  type: "arrow",
670
670
  style: {
671
671
  ...fe,
672
- ...a
672
+ ...l
673
673
  }
674
674
  },
675
675
  geometry: {
676
676
  type: "LineString",
677
677
  coordinates: [
678
678
  [u, e],
679
- [s, n]
679
+ [o, n]
680
680
  ]
681
681
  }
682
682
  }), ln = "http://www.w3.org/2000/svg";
@@ -698,90 +698,76 @@ function vt(u) {
698
698
  return { x: e[0], y: e[1] };
699
699
  }
700
700
  function un(u) {
701
- const [e, s] = u.geometry.coordinates[0][0], [n, a] = u.geometry.coordinates[0][2];
702
- u.geometry.bbox = [e, s, n, a];
701
+ const [e, o] = u.geometry.coordinates[0][0], [n, l] = u.geometry.coordinates[0][2];
702
+ u.geometry.bbox = [e, o, n, l];
703
703
  }
704
- function hn(u, e, s, n, a) {
705
- u.geometry.bbox = [e, s, e + n, s + a], u.geometry.coordinates = [
704
+ function hn(u, e, o, n, l) {
705
+ u.geometry.bbox = [e, o, e + n, o + l], u.geometry.coordinates = [
706
706
  [
707
- [e, s],
708
- [e + n, s],
709
- [e + n, s + a],
710
- [e, s + a],
711
- [e, s]
707
+ [e, o],
708
+ [e + n, o],
709
+ [e + n, o + l],
710
+ [e, o + l],
711
+ [e, o]
712
712
  ]
713
713
  ];
714
714
  }
715
715
  function de(u) {
716
- const [e, s] = u.geometry.coordinates[0];
717
- return { x: e, y: s };
716
+ const [e, o] = u.geometry.coordinates[0];
717
+ return { x: e, y: o };
718
718
  }
719
719
  function Le(u, e) {
720
- const [s, n] = u.geometry.coordinates[e === "start" ? 0 : 1];
721
- return { x: s, y: n };
720
+ const [o, n] = u.geometry.coordinates[e === "start" ? 0 : 1];
721
+ return { x: o, y: n };
722
722
  }
723
723
  function je(u) {
724
- const [e, s] = u.geometry.coordinates[1];
725
- return { x: e, y: s };
724
+ const [e, o] = u.geometry.coordinates[1];
725
+ return { x: e, y: o };
726
726
  }
727
- function Mr(u, e, s) {
728
- u.geometry.coordinates[0] = [e, s];
727
+ function Mr(u, e, o) {
728
+ u.geometry.coordinates[0] = [e, o];
729
729
  }
730
- function zr(u, e, s) {
731
- u.geometry.coordinates[1] = [e, s];
730
+ function zr(u, e, o) {
731
+ u.geometry.coordinates[1] = [e, o];
732
732
  }
733
733
  function Fe(u) {
734
734
  return { start: de(u), end: je(u) };
735
735
  }
736
- function Ht(u, e, s, n) {
737
- e === "start" ? Mr(u, s, n) : zr(u, s, n);
736
+ function Ht(u, e, o, n) {
737
+ e === "start" ? Mr(u, o, n) : zr(u, o, n);
738
738
  }
739
739
  const Nr = (u) => parseInt(u.getAttribute("data-handle-id") || "-1");
740
740
  function cn(u) {
741
741
  return Array.isArray(u) && u.length === 2 && u.every(isFinite);
742
742
  }
743
- function dn(u, e, s, n) {
744
- for (let a = 0; a < u.coordinates.length; a++) {
745
- const c = u.coordinates[a];
746
- if (cn(c))
747
- c[0] = s + (c[0] - s) * e, c[1] = n + (c[1] - n) * e;
743
+ function dn(u, e, o, n) {
744
+ for (let l = 0; l < u.coordinates.length; l++) {
745
+ const h = u.coordinates[l];
746
+ if (cn(h))
747
+ h[0] = o + (h[0] - o) * e, h[1] = n + (h[1] - n) * e;
748
748
  else
749
- for (let f = 0; f < c.length; f++) {
750
- const g = c[f];
751
- g[0] = s + (g[0] - s) * e, g[1] = n + (g[1] - n) * e;
749
+ for (let d = 0; d < h.length; d++) {
750
+ const g = h[d];
751
+ g[0] = o + (g[0] - o) * e, g[1] = n + (g[1] - n) * e;
752
752
  }
753
753
  }
754
754
  return u;
755
755
  }
756
- function $e(u, e, s) {
756
+ function Ie(u, e, o) {
757
757
  const n = Math.atan2(u.y - e.y, u.x - e.x);
758
758
  return {
759
- x: e.x + s * Math.cos(n),
760
- y: e.y + s * Math.sin(n)
759
+ x: e.x + o * Math.cos(n),
760
+ y: e.y + o * Math.sin(n)
761
761
  };
762
762
  }
763
- function or(u, e) {
763
+ function Me(u, e) {
764
764
  if (!e) return { x: u.clientX, y: u.clientY };
765
- const s = e.getBoundingClientRect();
765
+ const o = e.getBoundingClientRect();
766
766
  return {
767
- x: u.clientX - s.left - e.clientLeft,
768
- y: u.clientY - s.top - e.clientTop
767
+ x: u.clientX - o.left - e.clientLeft,
768
+ y: u.clientY - o.top - e.clientTop
769
769
  };
770
770
  }
771
- function fn(u, e) {
772
- return u.startsWith("#") ? pn(u, e) : u.startsWith("rgb") ? yn(u, e) : u;
773
- }
774
- function gn(u) {
775
- return u.length === 4 ? u.split("").map((e) => e + e).join("") : u;
776
- }
777
- function pn(u, e) {
778
- const [s, n, a] = gn(u).match(/\w\w/g).map((c) => parseInt(c, 16));
779
- return `rgba(${s}, ${n}, ${a}, ${e})`;
780
- }
781
- function yn(u, e) {
782
- const [s, n, a] = u.match(/\d+/g).map((c) => parseInt(c, 10));
783
- return `rgba(${s}, ${n}, ${a}, ${e})`;
784
- }
785
771
  const Ot = (u, e) => ({
786
772
  x: u.x - e.x,
787
773
  y: u.y - e.y
@@ -800,101 +786,107 @@ const Ot = (u, e) => ({
800
786
  }), qr = (u, e) => ({
801
787
  x: u.x * e,
802
788
  y: u.y * e
803
- }), Ie = (u, e) => ({
789
+ }), $e = (u, e) => ({
804
790
  x: u.x * e.x,
805
791
  y: u.y * e.y
806
- }), ot = (u, e) => {
807
- const s = Math.sin(e), n = Math.cos(e);
792
+ }), st = (u, e) => {
793
+ const o = Math.sin(e), n = Math.cos(e);
808
794
  return {
809
- x: u.x * n - u.y * s,
810
- y: u.x * s + u.y * n
795
+ x: u.x * n - u.y * o,
796
+ y: u.x * o + u.y * n
811
797
  };
812
- }, vn = (u, e) => ({
798
+ }, fn = (u, e) => ({
813
799
  x: u.x / e,
814
800
  y: u.y / e
815
- }), vr = (u, e) => u.x * e.x + u.y * e.y, mn = 0.5;
816
- function Wr(u, e = 5, s = 30) {
801
+ }), vr = (u, e) => u.x * e.x + u.y * e.y, gn = 0.5;
802
+ function Wr(u, e = 5, o = 30) {
817
803
  var n;
818
- const { start: a, end: c } = Fe(u), f = Ot(c, a), g = u.properties.style && u.properties.style.strokeWidth ? (n = u.properties.style) == null ? void 0 : n.strokeWidth : 0;
819
- return Math.min(s, Math.max(3 * g, qt(f) * 0.01, e));
804
+ const { start: l, end: h } = Fe(u), d = Ot(h, l), g = u.properties.style && u.properties.style.strokeWidth ? (n = u.properties.style) == null ? void 0 : n.strokeWidth : 0;
805
+ return Math.min(o, Math.max(3 * g, qt(d) * 0.01, e));
820
806
  }
821
- function mr(u, e, s, n) {
822
- const a = qr(Hr(Br(e)), n);
823
- if (!s || s !== "arrow" && s !== "arrow-plain") return "";
824
- const c = Bt(u, ot(a, Math.PI / 10)), f = Bt(u, ot(a, -Math.PI / 10)), g = `${u.x} ${u.y}`;
825
- return `M ${c.x} ${c.y} L ${g} ${f.x} ${f.y} ${s === "arrow" ? "" : `${c.x} ${c.y}`}`;
807
+ function mr(u, e, o, n) {
808
+ const l = qr(Hr(Br(e)), n);
809
+ if (!o || o !== "arrow" && o !== "arrow-plain") return "";
810
+ const h = Bt(u, st(l, Math.PI / 10)), d = Bt(u, st(l, -Math.PI / 10)), g = `${u.x} ${u.y}`;
811
+ return `M ${h.x} ${h.y} L ${g} ${d.x} ${d.y} ${o === "arrow" ? "" : `${h.x} ${h.y}`}`;
826
812
  }
827
- function bn(u, e, s, n, a) {
828
- const { start: c, end: f } = Fe(u), {
813
+ function pn(u, e, o, n, l) {
814
+ const { start: h, end: d } = Fe(u), {
829
815
  tail: g,
830
- head: d,
816
+ head: f,
831
817
  strokeColor: v,
832
818
  strokeWidth: y = 0
833
- } = u.properties.style || s, A = Ot(f, c), _ = Wr(u, n, a), S = Rt("g"), R = Rt("path");
819
+ } = u.properties.style || o, A = Ot(d, h), k = Wr(u, n, l), S = Rt("g"), R = Rt("path");
834
820
  S.setAttribute("data-annotation", `${u.id}`), S.setAttribute("data-annotation-type", "arrow");
835
- const C = d === "arrow-plain" || g === "arrow", L = v || "none";
821
+ const C = f === "arrow-plain" || g === "arrow", L = v || "none";
836
822
  R.setAttribute("stroke", L), R.setAttribute("stroke-width", `${y}`), R.setAttribute("fill", C ? v || "" : "none"), R.setAttribute("stroke-linecap", "round"), R.setAttribute("stroke-linejoin", "round");
837
- const I = mr(c, Hr(A), g, _), k = mr(f, A, d, _), z = I + `M ${c.x} ${c.y} ${f.x} ${f.y}` + k;
838
- R.setAttribute("d", z), S.appendChild(R), br(S, c, L, g, y), br(S, f, L, d, y), e.appendChild(S);
823
+ const $ = mr(h, Hr(A), g, k), _ = mr(d, A, f, k), z = $ + `M ${h.x} ${h.y} ${d.x} ${d.y}` + _;
824
+ R.setAttribute("d", z), S.appendChild(R), br(S, h, L, g, y), br(S, d, L, f, y), e.appendChild(S);
839
825
  }
840
- function br(u, e, s, n, a) {
841
- n === "halo-dot" && wr(u, e, wn(s), a * 4), (n === "dot" || n === "halo-dot") && wr(u, e, s, a * 2);
826
+ function br(u, e, o, n, l) {
827
+ n === "halo-dot" && wr(
828
+ u,
829
+ e,
830
+ yn(o),
831
+ gn,
832
+ l * 4
833
+ ), (n === "dot" || n === "halo-dot") && wr(u, e, o, 1, l * 2);
842
834
  }
843
- function wn(u) {
844
- return u === "none" ? "none" : fn(u, mn);
835
+ function yn(u) {
836
+ return u === "none" ? "none" : u;
845
837
  }
846
- function wr(u, e, s, n) {
847
- const a = Rt("circle");
848
- a.setAttribute("cx", `${e.x}`), a.setAttribute("cy", `${e.y}`), a.setAttribute("r", `${n}`), a.setAttribute("fill", s), u.appendChild(a);
838
+ function wr(u, e, o, n, l) {
839
+ const h = Rt("circle");
840
+ h.setAttribute("cx", `${e.x}`), h.setAttribute("cy", `${e.y}`), h.setAttribute("r", `${l}`), h.setAttribute("fill-opacity", `${n}`), h.setAttribute("fill", o), u.appendChild(h);
849
841
  }
850
- const V = -1, Me = "dragging", ze = "dragstart", Ut = "dragend", ar = "select", lr = "unselect", xn = "hover", En = "unhover", ur = "remove", hr = "add", An = "cancelDrawing", cr = "update", kn = "link";
842
+ const V = -1, ze = "dragging", Ne = "dragstart", Ut = "dragend", ar = "select", lr = "unselect", vn = "hover", mn = "unhover", ur = "remove", hr = "add", bn = "cancelDrawing", cr = "update", wn = "link";
851
843
  function Ur(u) {
852
844
  return u && u.__esModule && Object.prototype.hasOwnProperty.call(u, "default") ? u.default : u;
853
845
  }
854
846
  var xr = { exports: {} }, Er;
855
- function _n() {
847
+ function xn() {
856
848
  return Er || (Er = 1, function(u) {
857
- var e = Object.prototype.hasOwnProperty, s = "~";
849
+ var e = Object.prototype.hasOwnProperty, o = "~";
858
850
  function n() {
859
851
  }
860
- Object.create && (n.prototype = /* @__PURE__ */ Object.create(null), new n().__proto__ || (s = !1));
861
- function a(d, v, y) {
862
- this.fn = d, this.context = v, this.once = y || !1;
852
+ Object.create && (n.prototype = /* @__PURE__ */ Object.create(null), new n().__proto__ || (o = !1));
853
+ function l(f, v, y) {
854
+ this.fn = f, this.context = v, this.once = y || !1;
863
855
  }
864
- function c(d, v, y, A, _) {
856
+ function h(f, v, y, A, k) {
865
857
  if (typeof y != "function")
866
858
  throw new TypeError("The listener must be a function");
867
- var S = new a(y, A || d, _), R = s ? s + v : v;
868
- return d._events[R] ? d._events[R].fn ? d._events[R] = [d._events[R], S] : d._events[R].push(S) : (d._events[R] = S, d._eventsCount++), d;
859
+ var S = new l(y, A || f, k), R = o ? o + v : v;
860
+ return f._events[R] ? f._events[R].fn ? f._events[R] = [f._events[R], S] : f._events[R].push(S) : (f._events[R] = S, f._eventsCount++), f;
869
861
  }
870
- function f(d, v) {
871
- --d._eventsCount === 0 ? d._events = new n() : delete d._events[v];
862
+ function d(f, v) {
863
+ --f._eventsCount === 0 ? f._events = new n() : delete f._events[v];
872
864
  }
873
865
  function g() {
874
866
  this._events = new n(), this._eventsCount = 0;
875
867
  }
876
868
  g.prototype.eventNames = function() {
877
- var d = [], v, y;
878
- if (this._eventsCount === 0) return d;
869
+ var f = [], v, y;
870
+ if (this._eventsCount === 0) return f;
879
871
  for (y in v = this._events)
880
- e.call(v, y) && d.push(s ? y.slice(1) : y);
881
- return Object.getOwnPropertySymbols ? d.concat(Object.getOwnPropertySymbols(v)) : d;
882
- }, g.prototype.listeners = function(d) {
883
- var v = s ? s + d : d, y = this._events[v];
872
+ e.call(v, y) && f.push(o ? y.slice(1) : y);
873
+ return Object.getOwnPropertySymbols ? f.concat(Object.getOwnPropertySymbols(v)) : f;
874
+ }, g.prototype.listeners = function(f) {
875
+ var v = o ? o + f : f, y = this._events[v];
884
876
  if (!y) return [];
885
877
  if (y.fn) return [y.fn];
886
- for (var A = 0, _ = y.length, S = new Array(_); A < _; A++)
878
+ for (var A = 0, k = y.length, S = new Array(k); A < k; A++)
887
879
  S[A] = y[A].fn;
888
880
  return S;
889
- }, g.prototype.listenerCount = function(d) {
890
- var v = s ? s + d : d, y = this._events[v];
881
+ }, g.prototype.listenerCount = function(f) {
882
+ var v = o ? o + f : f, y = this._events[v];
891
883
  return y ? y.fn ? 1 : y.length : 0;
892
- }, g.prototype.emit = function(d, v, y, A, _, S) {
893
- var R = s ? s + d : d;
884
+ }, g.prototype.emit = function(f, v, y, A, k, S) {
885
+ var R = o ? o + f : f;
894
886
  if (!this._events[R]) return !1;
895
- var C = this._events[R], L = arguments.length, I, k;
887
+ var C = this._events[R], L = arguments.length, $, _;
896
888
  if (C.fn) {
897
- switch (C.once && this.removeListener(d, C.fn, void 0, !0), L) {
889
+ switch (C.once && this.removeListener(f, C.fn, void 0, !0), L) {
898
890
  case 1:
899
891
  return C.fn.call(C.context), !0;
900
892
  case 2:
@@ -904,76 +896,76 @@ function _n() {
904
896
  case 4:
905
897
  return C.fn.call(C.context, v, y, A), !0;
906
898
  case 5:
907
- return C.fn.call(C.context, v, y, A, _), !0;
899
+ return C.fn.call(C.context, v, y, A, k), !0;
908
900
  case 6:
909
- return C.fn.call(C.context, v, y, A, _, S), !0;
901
+ return C.fn.call(C.context, v, y, A, k, S), !0;
910
902
  }
911
- for (k = 1, I = new Array(L - 1); k < L; k++)
912
- I[k - 1] = arguments[k];
913
- C.fn.apply(C.context, I);
903
+ for (_ = 1, $ = new Array(L - 1); _ < L; _++)
904
+ $[_ - 1] = arguments[_];
905
+ C.fn.apply(C.context, $);
914
906
  } else {
915
907
  var z = C.length, B;
916
- for (k = 0; k < z; k++)
917
- switch (C[k].once && this.removeListener(d, C[k].fn, void 0, !0), L) {
908
+ for (_ = 0; _ < z; _++)
909
+ switch (C[_].once && this.removeListener(f, C[_].fn, void 0, !0), L) {
918
910
  case 1:
919
- C[k].fn.call(C[k].context);
911
+ C[_].fn.call(C[_].context);
920
912
  break;
921
913
  case 2:
922
- C[k].fn.call(C[k].context, v);
914
+ C[_].fn.call(C[_].context, v);
923
915
  break;
924
916
  case 3:
925
- C[k].fn.call(C[k].context, v, y);
917
+ C[_].fn.call(C[_].context, v, y);
926
918
  break;
927
919
  case 4:
928
- C[k].fn.call(C[k].context, v, y, A);
920
+ C[_].fn.call(C[_].context, v, y, A);
929
921
  break;
930
922
  default:
931
- if (!I) for (B = 1, I = new Array(L - 1); B < L; B++)
932
- I[B - 1] = arguments[B];
933
- C[k].fn.apply(C[k].context, I);
923
+ if (!$) for (B = 1, $ = new Array(L - 1); B < L; B++)
924
+ $[B - 1] = arguments[B];
925
+ C[_].fn.apply(C[_].context, $);
934
926
  }
935
927
  }
936
928
  return !0;
937
- }, g.prototype.on = function(d, v, y) {
938
- return c(this, d, v, y, !1);
939
- }, g.prototype.once = function(d, v, y) {
940
- return c(this, d, v, y, !0);
941
- }, g.prototype.removeListener = function(d, v, y, A) {
942
- var _ = s ? s + d : d;
943
- if (!this._events[_]) return this;
929
+ }, g.prototype.on = function(f, v, y) {
930
+ return h(this, f, v, y, !1);
931
+ }, g.prototype.once = function(f, v, y) {
932
+ return h(this, f, v, y, !0);
933
+ }, g.prototype.removeListener = function(f, v, y, A) {
934
+ var k = o ? o + f : f;
935
+ if (!this._events[k]) return this;
944
936
  if (!v)
945
- return f(this, _), this;
946
- var S = this._events[_];
937
+ return d(this, k), this;
938
+ var S = this._events[k];
947
939
  if (S.fn)
948
- S.fn === v && (!A || S.once) && (!y || S.context === y) && f(this, _);
940
+ S.fn === v && (!A || S.once) && (!y || S.context === y) && d(this, k);
949
941
  else {
950
942
  for (var R = 0, C = [], L = S.length; R < L; R++)
951
943
  (S[R].fn !== v || A && !S[R].once || y && S[R].context !== y) && C.push(S[R]);
952
- C.length ? this._events[_] = C.length === 1 ? C[0] : C : f(this, _);
944
+ C.length ? this._events[k] = C.length === 1 ? C[0] : C : d(this, k);
953
945
  }
954
946
  return this;
955
- }, g.prototype.removeAllListeners = function(d) {
947
+ }, g.prototype.removeAllListeners = function(f) {
956
948
  var v;
957
- return d ? (v = s ? s + d : d, this._events[v] && f(this, v)) : (this._events = new n(), this._eventsCount = 0), this;
958
- }, g.prototype.off = g.prototype.removeListener, g.prototype.addListener = g.prototype.on, g.prefixed = s, g.EventEmitter = g, u.exports = g;
949
+ return f ? (v = o ? o + f : f, this._events[v] && d(this, v)) : (this._events = new n(), this._eventsCount = 0), this;
950
+ }, g.prototype.off = g.prototype.removeListener, g.prototype.addListener = g.prototype.on, g.prefixed = o, g.EventEmitter = g, u.exports = g;
959
951
  }(xr)), xr.exports;
960
952
  }
961
- var Sn = _n();
962
- const Yr = /* @__PURE__ */ Ur(Sn);
953
+ var En = xn();
954
+ const Yr = /* @__PURE__ */ Ur(En);
963
955
  class Vr extends Yr {
964
- constructor(e, s) {
956
+ constructor(e, o) {
965
957
  super(), x(this, "ogma"), x(this, "elements"), x(this, "layer"), x(this, "editor"), x(this, "selectedId", V), x(this, "hoveredId", V), x(this, "ogmaOptions"), x(this, "shouldDetect"), x(this, "isDragging"), x(this, "showeditorOnHover"), x(this, "_onKeyUp", (n) => {
966
958
  n.code === 27 && this.selectedId !== V ? this.unselect() : (n.code === 46 || n.code === 8) && this.selectedId !== V && this._canRemove() && this.remove(this.selectedId);
967
959
  }), x(this, "_onClickMouseMove", (n) => {
968
960
  if (!n.domEvent || this.isDragging || !this.shouldDetect || n.domEvent.type !== "mousemove" && n.domEvent.target && n.domEvent.target.tagName === "a")
969
961
  return;
970
- const a = this.ogma.view.screenToGraphCoordinates(n), c = this.shouldDetect || !this.shouldDetect && +this.selectedId > -1 ? this.detect(a, 0) : void 0;
971
- n.domEvent.type === "mousemove" ? c ? this.hover(c.id) : this.hoveredId !== V && this.unhover() : c ? this.select(c.id) : this.selectedId !== V && this.unselect();
962
+ const l = this.ogma.view.screenToGraphCoordinates(n), h = this.shouldDetect || !this.shouldDetect && +this.selectedId > -1 ? this.detect(l, 0) : void 0;
963
+ n.domEvent.type === "mousemove" ? h ? this.hover(h.id) : this.hoveredId !== V && this.unhover() : h ? this.select(h.id) : this.selectedId !== V && this.unselect();
972
964
  }), this.ogma = e, this.elements = [], this.shouldDetect = !0, this.isDragging = !1, this.showeditorOnHover = !0, this.ogmaOptions = e.getOptions(), e.events.on(["click", "mousemove"], this._onClickMouseMove).on("keyup", this._onKeyUp).on("frame", () => {
973
965
  this.refreshEditor(), this.refreshDrawing();
974
966
  }), this.layer = e.layers.addSVGLayer({
975
967
  draw: (n) => this.draw(n)
976
- }), this.layer.moveToTop(), this.editor = e.layers.addLayer(s), this.editor.hide();
968
+ }), this.layer.moveToTop(), this.editor = e.layers.addLayer(o), this.editor.hide();
977
969
  }
978
970
  _canRemove() {
979
971
  return !0;
@@ -984,38 +976,38 @@ class Vr extends Yr {
984
976
  * @returns the added annotation
985
977
  */
986
978
  add(e) {
987
- const s = this.getDefaultOptions(), n = Object.assign(e, {
988
- id: e.id === void 0 ? Ne() : e.id,
979
+ const o = this.getDefaultOptions(), n = Object.assign(e, {
980
+ id: e.id === void 0 ? He() : e.id,
989
981
  type: e.type,
990
982
  properties: {
991
- ...s.properties,
983
+ ...o.properties,
992
984
  ...e.properties || {},
993
985
  // styles need to be merged
994
- style: { ...s.properties.style, ...e.properties.style || {} }
986
+ style: { ...o.properties.style, ...e.properties.style || {} }
995
987
  },
996
988
  geometry: {
997
- ...s.geometry,
989
+ ...o.geometry,
998
990
  ...e.geometry
999
991
  }
1000
992
  });
1001
993
  return this.elements.push(n), this.layer.refresh(), this.emit(hr, n), n;
1002
994
  }
1003
- updateStyle(e, s) {
995
+ updateStyle(e, o) {
1004
996
  this.updateAnnotation(e, {
1005
997
  properties: {
1006
- style: s
998
+ style: o
1007
999
  }
1008
1000
  });
1009
1001
  }
1010
- updateGeometry(e, s) {
1002
+ updateGeometry(e, o) {
1011
1003
  this.updateAnnotation(e, {
1012
- geometry: s
1004
+ geometry: o
1013
1005
  });
1014
1006
  }
1015
- scale(e, s, n, a) {
1007
+ scale(e, o, n, l) {
1016
1008
  this.updateGeometry(
1017
1009
  e,
1018
- dn(e.geometry, s, n, a)
1010
+ dn(e.geometry, o, n, l)
1019
1011
  );
1020
1012
  }
1021
1013
  /**
@@ -1024,37 +1016,37 @@ class Vr extends Yr {
1024
1016
  * @param id Id of the annotation to update
1025
1017
  * @param element params of the annotation
1026
1018
  */
1027
- update(e, s) {
1019
+ update(e, o) {
1028
1020
  const n = this.getById(e);
1029
- this.updateAnnotation(n, s);
1021
+ this.updateAnnotation(n, o);
1030
1022
  }
1031
- updateAnnotation(e, s) {
1023
+ updateAnnotation(e, o) {
1032
1024
  if (!e) return;
1033
1025
  const n = e.id;
1034
- Object.keys(s).forEach((a) => {
1035
- if (a !== "id")
1036
- if (a === "properties") {
1037
- const c = s.properties || { style: {} };
1026
+ Object.keys(o).forEach((l) => {
1027
+ if (l !== "id")
1028
+ if (l === "properties") {
1029
+ const h = o.properties || { style: {} };
1038
1030
  e.properties = {
1039
1031
  ...e.properties || {},
1040
- ...c || {},
1032
+ ...h || {},
1041
1033
  style: {
1042
1034
  ...e.properties.style || {},
1043
- ...c.style || {}
1035
+ ...h.style || {}
1044
1036
  }
1045
1037
  };
1046
- } else a === "geometry" ? e.geometry = {
1038
+ } else l === "geometry" ? e.geometry = {
1047
1039
  ...e.geometry,
1048
- ...s.geometry
1049
- } : e[a] = s[a];
1040
+ ...o.geometry
1041
+ } : e[l] = o[l];
1050
1042
  }), n === this.selectedId && this.refreshEditor(), this.layer.refresh();
1051
1043
  }
1052
1044
  getById(e) {
1053
- const s = Number(e);
1045
+ const o = Number(e);
1054
1046
  for (let n = 0; n < this.elements.length; n++) {
1055
- const a = this.elements[n];
1056
- if (!(a.id !== e && a.id !== s))
1057
- return a;
1047
+ const l = this.elements[n];
1048
+ if (!(l.id !== e && l.id !== o))
1049
+ return l;
1058
1050
  }
1059
1051
  }
1060
1052
  /**
@@ -1063,12 +1055,12 @@ class Vr extends Yr {
1063
1055
  * Select element, show editor, disable Ogma dragging and fire event
1064
1056
  */
1065
1057
  select(e) {
1066
- const s = this.getById(e);
1067
- s && (this.editor.show(), this.selectedId = e, this.refreshEditor(), this.layer.refresh(), this.emit(ar, s));
1058
+ const o = this.getById(e);
1059
+ o && (this.editor.show(), this.selectedId = e, this.refreshEditor(), this.layer.refresh(), this.emit(ar, o));
1068
1060
  }
1069
1061
  hover(e) {
1070
- const s = this.getById(e);
1071
- s && (this.showeditorOnHover && this.editor.show(), this.hoveredId = e, this.refreshEditor(), this.layer.refresh(), this.emit(xn, s));
1062
+ const o = this.getById(e);
1063
+ o && (this.showeditorOnHover && this.editor.show(), this.hoveredId = e, this.refreshEditor(), this.layer.refresh(), this.emit(vn, o));
1072
1064
  }
1073
1065
  getSelectedFeature() {
1074
1066
  return this.selectedId === V ? null : this.getById(this.selectedId);
@@ -1079,7 +1071,7 @@ class Vr extends Yr {
1079
1071
  }
1080
1072
  unhover() {
1081
1073
  const e = this.getById(this.hoveredId);
1082
- return this.emit(En, e), this.hoveredId = V, this.selectedId === V && this.editor.hide(), this.layer.refresh(), this;
1074
+ return this.emit(mn, e), this.hoveredId = V, this.selectedId === V && this.editor.hide(), this.layer.refresh(), this;
1083
1075
  }
1084
1076
  /**
1085
1077
  * @method remove
@@ -1087,8 +1079,8 @@ class Vr extends Yr {
1087
1079
  * Removes annotation with the given id
1088
1080
  */
1089
1081
  remove(e) {
1090
- const s = this.getById(e);
1091
- e === this.hoveredId && this.unhover(), e === this.selectedId && this.unselect(), this.elements = this.elements.filter((n) => n.id !== e), s && this.emit(ur, s), this.layer.refresh();
1082
+ const o = this.getById(e);
1083
+ e === this.hoveredId && this.unhover(), e === this.selectedId && this.unselect(), this.elements = this.elements.filter((n) => n.id !== e), o && this.emit(ur, o), this.layer.refresh();
1092
1084
  }
1093
1085
  /**
1094
1086
  * @method disableDragging
@@ -1139,8 +1131,8 @@ class Vr extends Yr {
1139
1131
  }
1140
1132
  }
1141
1133
  const Ar = "handle-line", kr = "handle-start", _r = "handle-end";
1142
- class Cn extends Vr {
1143
- constructor(e, s = {}) {
1134
+ class An extends Vr {
1135
+ constructor(e, o = {}) {
1144
1136
  super(
1145
1137
  e,
1146
1138
  `
@@ -1151,27 +1143,27 @@ class Cn extends Vr {
1151
1143
  </div>
1152
1144
  `
1153
1145
  ), x(this, "draggedHandle", V), x(this, "start", { x: 0, y: 0 }), x(this, "end", { x: 0, y: 0 }), x(this, "arrow", { ...yr }), x(this, "startX", 0), x(this, "startY", 0), x(this, "minArrowHeight", 0), x(this, "maxArrowHeight", 0), x(this, "handles", []), x(this, "onHandleMouseDown", (n) => {
1154
- const a = this.getById(this.selectedId) || this.getById(this.hoveredId);
1155
- if (!a) return;
1156
- const { x: c, y: f } = or(n, this.ogma.getContainer());
1157
- this.startDragging(a, c, f), this.draggedHandle = Nr(n.target);
1146
+ const l = this.getById(this.selectedId) || this.getById(this.hoveredId);
1147
+ if (!l) return;
1148
+ const { x: h, y: d } = Me(n, this.ogma.getContainer());
1149
+ this.startDragging(l, h, d), this.draggedHandle = Nr(n.target);
1158
1150
  }), x(this, "onMouseUp", () => {
1159
1151
  this.draggedHandle !== -1 && (this.restoreDragging(), this.isDragging = !1, this.draggedHandle = V, this.emit(Ut, this.arrow));
1160
1152
  }), x(this, "onMouseMove", (n) => {
1161
1153
  if (!this.isDragging || this.draggedHandle === V) return;
1162
- const a = this.handles[this.draggedHandle], c = this.ogma.view.getAngle(), { x: f, y: g } = ot(
1163
- vn(
1164
- { x: n.x - this.startX, y: n.y - this.startY },
1154
+ const { x: l, y: h } = Me(n, this.ogma.getContainer()), d = this.handles[this.draggedHandle], g = this.ogma.view.getAngle(), { x: f, y: v } = st(
1155
+ fn(
1156
+ { x: l - this.startX, y: h - this.startY },
1165
1157
  this.ogma.view.getZoom()
1166
1158
  ),
1167
- c
1168
- ), d = a.id === Ar, v = a.id === kr, y = a.id === _r;
1169
- (d || v) && Mr(this.arrow, this.start.x + f, this.start.y + g), (d || y) && zr(this.arrow, this.end.x + f, this.end.y + g), this.emit(
1170
- Me,
1159
+ g
1160
+ ), y = d.id === Ar, A = d.id === kr, k = d.id === _r;
1161
+ (y || A) && Mr(this.arrow, this.start.x + f, this.start.y + v), (y || k) && zr(this.arrow, this.end.x + f, this.end.y + v), this.emit(
1162
+ ze,
1171
1163
  this.arrow,
1172
- d ? "line" : v ? "start" : "end"
1164
+ y ? "line" : A ? "start" : "end"
1173
1165
  ), this.refreshEditor(), this.layer.refresh();
1174
- }), this.minArrowHeight = s.minArrowHeight || 0, this.maxArrowHeight = s.maxArrowHeight || 1e6, this.handles = Array.prototype.slice.call(
1166
+ }), this.minArrowHeight = o.minArrowHeight || 0, this.maxArrowHeight = o.maxArrowHeight || 1e6, this.handles = Array.prototype.slice.call(
1175
1167
  this.editor.element.querySelectorAll(".arrow-handle>.handle")
1176
1168
  ), this.handles.forEach(
1177
1169
  (n) => n.addEventListener("mousedown", this.onHandleMouseDown)
@@ -1183,55 +1175,55 @@ class Cn extends Vr {
1183
1175
  * @param y
1184
1176
  * @param arrow
1185
1177
  */
1186
- startDrawing(e, s, n = an(e, s, e, s, fe)) {
1187
- var a;
1178
+ startDrawing(e, o, n = an(e, o, e, o, fe)) {
1179
+ var l;
1188
1180
  this.disableDragging(), this.add(n), this.hoveredId = n.id;
1189
- const c = this.ogma.view.graphToScreenCoordinates({ x: e, y: s }), f = ((a = this.ogma.getContainer()) == null ? void 0 : a.getBoundingClientRect()) || {
1181
+ const h = this.ogma.view.graphToScreenCoordinates({ x: e, y: o }), d = ((l = this.ogma.getContainer()) == null ? void 0 : l.getBoundingClientRect()) || {
1190
1182
  left: 0,
1191
1183
  top: 0
1192
1184
  };
1193
1185
  this.startDragging(
1194
1186
  this.getById(n.id),
1195
- c.x + (f == null ? void 0 : f.left),
1196
- c.y + f.top
1187
+ h.x + (d == null ? void 0 : d.left),
1188
+ h.y + d.top
1197
1189
  ), this.draggedHandle = 2;
1198
1190
  }
1199
1191
  cancelDrawing() {
1200
1192
  this.isDragging && (this.remove(this.arrow.id), this.emit(Ut, this.arrow), this.restoreDragging(), this.isDragging = !1, this.draggedHandle = V);
1201
1193
  }
1202
- startDragging(e, s, n) {
1203
- this.selectedId !== e.id && this.select(this.hoveredId), this.arrow = e, this.startX = s, this.startY = n, this.start = de(this.arrow), this.end = je(this.arrow), this.disableDragging(), this.emit(ze, this.arrow), this.isDragging = !0;
1194
+ startDragging(e, o, n) {
1195
+ this.selectedId !== e.id && this.select(this.hoveredId), this.arrow = e, this.startX = o, this.startY = n, this.start = de(this.arrow), this.end = je(this.arrow), this.disableDragging(), this.emit(Ne, this.arrow), this.isDragging = !0;
1204
1196
  }
1205
- detect(e, s = 0) {
1197
+ detect(e, o = 0) {
1206
1198
  return this.elements.find((n) => {
1207
- const { start: a, end: c } = Fe(n), f = Ot(e, {
1208
- x: (a.x + c.x) / 2,
1209
- y: (a.y + c.y) / 2
1210
- }), g = Ot(c, a), d = qt(g), v = Br(g), y = Wr(n);
1211
- return Math.abs(vr(v, f)) < d / 2 + s && Math.abs(vr(ot(v, Math.PI / 2), f)) < y / 2 + s;
1199
+ const { start: l, end: h } = Fe(n), d = Ot(e, {
1200
+ x: (l.x + h.x) / 2,
1201
+ y: (l.y + h.y) / 2
1202
+ }), g = Ot(h, l), f = qt(g), v = Br(g), y = Wr(n);
1203
+ return Math.abs(vr(v, d)) < f / 2 + o && Math.abs(vr(st(v, Math.PI / 2), d)) < y / 2 + o;
1212
1204
  });
1213
1205
  }
1214
1206
  refreshEditor() {
1215
1207
  if (+this.selectedId < 0 && +this.hoveredId < 0) return;
1216
- const e = this.selectedId !== V ? this.getById(this.selectedId) : this.getById(this.hoveredId), s = Fe(e), n = this.ogma.view.graphToScreenCoordinates(s.start), a = this.ogma.view.graphToScreenCoordinates(s.end), [c, f, g] = Array.prototype.slice.call(
1208
+ const e = this.selectedId !== V ? this.getById(this.selectedId) : this.getById(this.hoveredId), o = Fe(e), n = this.ogma.view.graphToScreenCoordinates(o.start), l = this.ogma.view.graphToScreenCoordinates(o.end), [h, d, g] = Array.prototype.slice.call(
1217
1209
  this.editor.element.querySelectorAll(".handle")
1218
1210
  );
1219
- f.style.transform = `translate(${n.x}px, ${n.y}px) translate(-50%, -50%)`, g.style.transform = `translate(${a.x}px, ${a.y}px) translate(-50%, -50%)`;
1220
- const d = {
1221
- x: (a.x + n.x) / 2,
1222
- y: (a.y + n.y) / 2
1223
- }, v = Ot(a, n), y = qr(v, 1 / qt(v)), A = Math.atan2(y.y, y.x);
1224
- c.style.width = `${qt(v)}px`, c.style.left = `${d.x}px`, c.style.top = `${d.y}px`, c.style.transform = `translate(-50%, -50%) rotate(${A}rad)`;
1211
+ d.style.transform = `translate(${n.x}px, ${n.y}px) translate(-50%, -50%)`, g.style.transform = `translate(${l.x}px, ${l.y}px) translate(-50%, -50%)`;
1212
+ const f = {
1213
+ x: (l.x + n.x) / 2,
1214
+ y: (l.y + n.y) / 2
1215
+ }, v = Ot(l, n), y = qr(v, 1 / qt(v)), A = Math.atan2(y.y, y.x);
1216
+ h.style.width = `${qt(v)}px`, h.style.left = `${f.x}px`, h.style.top = `${f.y}px`, h.style.transform = `translate(-50%, -50%) rotate(${A}rad)`;
1225
1217
  }
1226
1218
  getDefaultOptions() {
1227
1219
  return yr;
1228
1220
  }
1229
1221
  draw(e) {
1230
1222
  e.innerHTML = "";
1231
- const s = Rt("g"), n = this.ogma.view.getAngle();
1232
- n !== 0 && s.setAttribute("transform", `rotate(${-n * (180 / Math.PI)})`), this.elements.forEach(
1233
- (a) => bn(a, s, fe, this.minArrowHeight, this.maxArrowHeight)
1234
- ), e.appendChild(s);
1223
+ const o = Rt("g"), n = this.ogma.view.getAngle();
1224
+ n !== 0 && o.setAttribute("transform", `rotate(${-n * (180 / Math.PI)})`), this.elements.forEach(
1225
+ (l) => pn(l, o, fe, this.minArrowHeight, this.maxArrowHeight)
1226
+ ), e.appendChild(o);
1235
1227
  }
1236
1228
  refreshDrawing() {
1237
1229
  const e = this.ogma.view.getAngle();
@@ -1253,7 +1245,7 @@ const Wt = {
1253
1245
  borderRadius: 8,
1254
1246
  padding: 16,
1255
1247
  strokeType: "plain"
1256
- }, nr = {
1248
+ }, ir = {
1257
1249
  id: 0,
1258
1250
  type: "Feature",
1259
1251
  properties: {
@@ -1278,100 +1270,100 @@ const Wt = {
1278
1270
  }, Sr = {
1279
1271
  handleSize: 3.5,
1280
1272
  placeholder: "Your text..."
1281
- }, Tn = (u = 0, e = 0, s = 100, n = 50, a = "", c = { ...Wt }) => ({
1282
- id: Ne(),
1273
+ }, kn = (u = 0, e = 0, o = 100, n = 50, l = "", h = { ...Wt }) => ({
1274
+ id: He(),
1283
1275
  type: "Feature",
1284
1276
  properties: {
1285
1277
  type: "text",
1286
- content: a,
1287
- style: { ...Wt, ...c }
1278
+ content: l,
1279
+ style: { ...Wt, ...h }
1288
1280
  },
1289
1281
  geometry: {
1290
1282
  type: "Polygon",
1291
1283
  coordinates: [
1292
1284
  [
1293
1285
  [u, e],
1294
- [u + s, e],
1295
- [u + s, e + n],
1286
+ [u + o, e],
1287
+ [u + o, e + n],
1296
1288
  [u, e + n],
1297
1289
  [u, e]
1298
1290
  ]
1299
1291
  ]
1300
1292
  }
1301
1293
  });
1302
- var dr = { exports: {} }, Rn = dr.exports, Cr;
1303
- function On() {
1294
+ var dr = { exports: {} }, _n = dr.exports, Cr;
1295
+ function Sn() {
1304
1296
  return Cr || (Cr = 1, function(u, e) {
1305
- (function(s, n) {
1297
+ (function(o, n) {
1306
1298
  u.exports = n();
1307
- })(Rn, () => (() => {
1308
- var s = { d: (r, i) => {
1309
- for (var l in i) s.o(i, l) && !s.o(r, l) && Object.defineProperty(r, l, { enumerable: !0, get: i[l] });
1299
+ })(_n, () => (() => {
1300
+ var o = { d: (r, i) => {
1301
+ for (var a in i) o.o(i, a) && !o.o(r, a) && Object.defineProperty(r, a, { enumerable: !0, get: i[a] });
1310
1302
  }, o: (r, i) => Object.prototype.hasOwnProperty.call(r, i) }, n = {};
1311
- function a(r) {
1312
- return a = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(i) {
1303
+ function l(r) {
1304
+ return l = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(i) {
1313
1305
  return typeof i;
1314
1306
  } : function(i) {
1315
1307
  return i && typeof Symbol == "function" && i.constructor === Symbol && i !== Symbol.prototype ? "symbol" : typeof i;
1316
- }, a(r);
1308
+ }, l(r);
1317
1309
  }
1318
- s.d(n, { default: () => Qe });
1319
- var c = /^((?:[a-z\d-]+\s+)*)([\d.]+(%|em|px)|(?:x+-)?large|(?:x+-)?small|medium)(?:\s*\/\s*(normal|[\d.]+(%|px|em)?))?(\s.+)?$/, f = /\bsmall-caps\b/, g = /\b(?:italic|oblique)\b/, d = /\bbold(?:er)?\b/, v = 13.3333333, y = { "xx-small": 9, "x-small": 10, smaller: 13.3333, small: 13, medium: 16, large: 18, larger: 19.2, "x-large": 24, "xx-large": 32 };
1310
+ o.d(n, { default: () => tr });
1311
+ var h = /^((?:[a-z\d-]+\s+)*)([\d.]+(%|em|px)|(?:x+-)?large|(?:x+-)?small|medium)(?:\s*\/\s*(normal|[\d.]+(%|px|em)?))?(\s.+)?$/, d = /\bsmall-caps\b/, g = /\b(?:italic|oblique)\b/, f = /\bbold(?:er)?\b/, v = 13.3333333, y = { "xx-small": 9, "x-small": 10, smaller: 13.3333, small: 13, medium: 16, large: 18, larger: 19.2, "x-large": 24, "xx-large": 32 };
1320
1312
  function A(r) {
1321
- var i = "", l = this;
1322
- return l.style && l.style !== "normal" && (i += l.style), l.variant && l.variant !== "normal" && (i += (i ? " " : "") + l.variant), l.weight && l.weight !== "normal" && (i += (i ? " " : "") + l.weight), l.size && (i += (i ? " " : "") + l.size + "px", l.height !== l.size && (i += "/" + l.height + "px")), l.family && (i += (i ? " " : "") + l.family), r && (i += "::" + l.baseline), r && (i += "::" + l.color), i;
1313
+ var i = "", a = this;
1314
+ return a.style && a.style !== "normal" && (i += a.style), a.variant && a.variant !== "normal" && (i += (i ? " " : "") + a.variant), a.weight && a.weight !== "normal" && (i += (i ? " " : "") + a.weight), a.size && (i += (i ? " " : "") + a.size + "px", a.height !== a.size && (i += "/" + a.height + "px")), a.family && (i += (i ? " " : "") + a.family), r && (i += "::" + a.baseline), r && (i += "::" + a.color), i;
1323
1315
  }
1324
- var _ = { id: "", family: "sans-serif", height: 14, size: 12, variant: "", style: "", weight: "", baseline: "", color: null, toString: A, valueOf: A };
1316
+ var k = { id: "", family: "sans-serif", height: 14, size: 12, variant: "", style: "", weight: "", baseline: "", color: null, toString: A, valueOf: A };
1325
1317
  function S(r) {
1326
- var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, l = c.exec(r);
1327
- i.family = (l[6] || "").trim();
1328
- var t = y[l[2]] || parseFloat(l[2]);
1329
- l[3] === "%" ? t *= 0.16 : l[3] === "em" ? t *= 16 : l[3] === "pt" && (t *= v), i.size = t;
1330
- var o = parseFloat(l[4]);
1331
- if (o !== "normal" && o !== "inherit" && o ? l[5] && l[5] !== "em" ? l[5] === "pt" ? i.height = o * v : l[5] === "%" ? i.height = 0.01 * t : i.height = o : i.height = o * t : i.height = Math.round(t * (7 / 6)), f.test(l[1]) && (i.variant = "small-caps"), g.test(l[1]) && (i.style = "italic"), d.test(l[1])) i.weight = "bold";
1318
+ var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, a = h.exec(r);
1319
+ i.family = (a[6] || "").trim();
1320
+ var t = y[a[2]] || parseFloat(a[2]);
1321
+ a[3] === "%" ? t *= 0.16 : a[3] === "em" ? t *= 16 : a[3] === "pt" && (t *= v), i.size = t;
1322
+ var s = parseFloat(a[4]);
1323
+ if (s !== "normal" && s !== "inherit" && s ? a[5] && a[5] !== "em" ? a[5] === "pt" ? i.height = s * v : a[5] === "%" ? i.height = 0.01 * t : i.height = s : i.height = s * t : i.height = Math.round(t * (7 / 6)), d.test(a[1]) && (i.variant = "small-caps"), g.test(a[1]) && (i.style = "italic"), f.test(a[1])) i.weight = "bold";
1332
1324
  else {
1333
- var h = parseInt(/\b(\d+)\b/.exec(l[1]), 10);
1334
- h >= 100 && h !== 400 && (i.weight = h);
1325
+ var c = parseInt(/\b(\d+)\b/.exec(a[1]), 10);
1326
+ c >= 100 && c !== 400 && (i.weight = c);
1335
1327
  }
1336
1328
  return i;
1337
1329
  }
1338
1330
  function R() {
1339
- var r, i, l, t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "12px/14px sans-serif", o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, h = 14, p = 12, m = null, w = null, b = "";
1331
+ var r, i, a, t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "12px/14px sans-serif", s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, c = 14, p = 12, m = null, w = null, b = "";
1340
1332
  if (t && t.nodeType) {
1341
1333
  var E = t && (t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView), D = E.getComputedStyle(t, null);
1342
- r = D.getPropertyValue("font-family") || "", p = parseFloat(D.getPropertyValue("font-size")), h = D.getPropertyValue("line-height"), m = D.getPropertyValue("font-weight"), w = D.getPropertyValue("font-style"), b = D.getPropertyValue("font-variant") || "";
1334
+ r = D.getPropertyValue("font-family") || "", p = parseFloat(D.getPropertyValue("font-size")), c = D.getPropertyValue("line-height"), m = D.getPropertyValue("font-weight"), w = D.getPropertyValue("font-style"), b = D.getPropertyValue("font-variant") || "";
1343
1335
  } else if (typeof t == "string") {
1344
1336
  var T = S(t);
1345
- r = T.family, p = T.size, h = T.height, b = T.variant, w = T.style, m = T.weight;
1346
- } else a(t) === "object" && (r = t.family, p = t.size, h = t.height, b = t.variant, m = t.weight, w = t.style, i = t.baseline, l = t.color);
1347
- o.size && o.size < 3 && (p *= o.size), h = h !== "normal" && h ? parseFloat(h) : p * (7 / 6), o.height && o.height < 3 && (h *= o.height);
1348
- var O = Object.create(_);
1349
- return O.family = o.family || r || "sans-serif", O.height = h ?? 14, O.size = p ?? 12, O.variant = o.variant || b || "", O.style = o.style || w || "", O.weight = o.weight || m || "", O.baseline = i || 0, o.baseline != null && (O.baseline = o.baseline), O.color = o.color || l || "", O.id = A.call(O, !0), O;
1337
+ r = T.family, p = T.size, c = T.height, b = T.variant, w = T.style, m = T.weight;
1338
+ } else l(t) === "object" && (r = t.family, p = t.size, c = t.height, b = t.variant, m = t.weight, w = t.style, i = t.baseline, a = t.color);
1339
+ s.size && s.size < 3 && (p *= s.size), c = c !== "normal" && c ? parseFloat(c) : p * (7 / 6), s.height && s.height < 3 && (c *= s.height);
1340
+ var O = Object.create(k);
1341
+ return O.family = s.family || r || "sans-serif", O.height = c ?? 14, O.size = p ?? 12, O.variant = s.variant || b || "", O.style = s.style || w || "", O.weight = s.weight || m || "", O.baseline = i || 0, s.baseline != null && (O.baseline = s.baseline), O.color = s.color || a || "", O.id = A.call(O, !0), O;
1350
1342
  }
1351
1343
  const C = { "\n": 0.28, "\r": 0.28, " ": 0.28, " ": 0.28, " ": 0.28, "᠎": 0, " ": 0.5, " ": 1, " ": 0.5, " ": 1, " ": 0.33, " ": 0.25, " ": 0.16, " ": 0.56, " ": 0.28, " ": 0.2, " ": 0.15, "​": 0, " ": 0.16, " ": 0.22, " ": 1, "\uFEFF": 0 };
1352
- var L, I = function(r) {
1344
+ var L, $ = function(r) {
1353
1345
  var i = typeof OffscreenCanvas < "u" && new OffscreenCanvas(100, 100) || r && r.createElement("canvas");
1354
1346
  if (i && i.getContext) {
1355
- var l = i.getContext("2d");
1356
- if (l && typeof l.measureText == "function") return function(t, o) {
1357
- return l.font = String(o), l.measureText(t).width;
1347
+ var a = i.getContext("2d");
1348
+ if (a && typeof a.measureText == "function") return function(t, s) {
1349
+ return a.font = String(s), a.measureText(t).width;
1358
1350
  };
1359
1351
  }
1360
1352
  }(typeof document < "u" ? document : null) || (L = {}, function(r, i) {
1361
1353
  if (!L[i]) {
1362
- var l = R(i);
1363
- L[i] = l, /\bmonospace\b/.test(l.family) ? l.size *= 0.6 : (l.size *= 0.45, l.weight && (l.size *= 1.18));
1354
+ var a = R(i);
1355
+ L[i] = a, /\bmonospace\b/.test(a.family) ? a.size *= 0.6 : (a.size *= 0.45, a.weight && (a.size *= 1.18));
1364
1356
  }
1365
1357
  return r.length * L[i].size;
1366
- }), k = {}, z = { trim: !0, collapse: !0 };
1367
- function B(r, i, l) {
1368
- var t = Object.assign({}, z, l), o = String(r);
1369
- if (!o) return 0;
1370
- if (o in C) {
1371
- var h = i.id + "/" + o;
1372
- return h in k || (k[h] = I("_".concat(o, "_"), i) - I("__", i)), k[h];
1358
+ }), _ = {}, z = { trim: !0, collapse: !0 };
1359
+ function B(r, i, a) {
1360
+ var t = Object.assign({}, z, a), s = String(r);
1361
+ if (!s) return 0;
1362
+ if (s in C) {
1363
+ var c = i.id + "/" + s;
1364
+ return c in _ || (_[c] = $("_".concat(s, "_"), i) - $("__", i)), _[c];
1373
1365
  }
1374
- return t.trim && t.collapse ? t.trim ? o = o.trim() : t.collapse && (o = o.replace(/\s+/g, " ")) : o = o.replace(/\n/g, " "), I(o, i) + i.size * (r.tracking || 0);
1366
+ return t.trim && t.collapse ? t.trim ? s = s.trim() : t.collapse && (s = s.replace(/\s+/g, " ")) : s = s.replace(/\n/g, " "), $(s, i) + i.size * (r.tracking || 0);
1375
1367
  }
1376
1368
  function tt(r) {
1377
1369
  return tt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(i) {
@@ -1385,8 +1377,8 @@ function On() {
1385
1377
  r.prototype = Object.create(i && i.prototype, { constructor: { value: r, writable: !0, configurable: !0 } }), Object.defineProperty(r, "prototype", { writable: !1 }), i && Yt(r, i);
1386
1378
  }
1387
1379
  function Yt(r, i) {
1388
- return Yt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(l, t) {
1389
- return l.__proto__ = t, l;
1380
+ return Yt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(a, t) {
1381
+ return a.__proto__ = t, a;
1390
1382
  }, Yt(r, i);
1391
1383
  }
1392
1384
  function Vt(r) {
@@ -1401,20 +1393,20 @@ function On() {
1401
1393
  }
1402
1394
  }();
1403
1395
  return function() {
1404
- var l, t = Dt(r);
1396
+ var a, t = Dt(r);
1405
1397
  if (i) {
1406
- var o = Dt(this).constructor;
1407
- l = Reflect.construct(t, arguments, o);
1408
- } else l = t.apply(this, arguments);
1409
- return ge(this, l);
1398
+ var s = Dt(this).constructor;
1399
+ a = Reflect.construct(t, arguments, s);
1400
+ } else a = t.apply(this, arguments);
1401
+ return ge(this, a);
1410
1402
  };
1411
1403
  }
1412
1404
  function ge(r, i) {
1413
1405
  if (i && (tt(i) === "object" || typeof i == "function")) return i;
1414
1406
  if (i !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
1415
- return function(l) {
1416
- if (l === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1417
- return l;
1407
+ return function(a) {
1408
+ if (a === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1409
+ return a;
1418
1410
  }(r);
1419
1411
  }
1420
1412
  function Dt(r) {
@@ -1426,22 +1418,22 @@ function On() {
1426
1418
  if (!(r instanceof i)) throw new TypeError("Cannot call a class as a function");
1427
1419
  }
1428
1420
  function pe(r, i) {
1429
- for (var l = 0; l < i.length; l++) {
1430
- var t = i[l];
1431
- t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(r, (o = function(h, p) {
1432
- if (tt(h) !== "object" || h === null) return h;
1433
- var m = h[Symbol.toPrimitive];
1421
+ for (var a = 0; a < i.length; a++) {
1422
+ var t = i[a];
1423
+ t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(r, (s = function(c, p) {
1424
+ if (tt(c) !== "object" || c === null) return c;
1425
+ var m = c[Symbol.toPrimitive];
1434
1426
  if (m !== void 0) {
1435
- var w = m.call(h, p);
1427
+ var w = m.call(c, p);
1436
1428
  if (tt(w) !== "object") return w;
1437
1429
  throw new TypeError("@@toPrimitive must return a primitive value.");
1438
1430
  }
1439
- return String(h);
1440
- }(t.key, "string"), tt(o) === "symbol" ? o : String(o)), t);
1431
+ return String(c);
1432
+ }(t.key, "string"), tt(s) === "symbol" ? s : String(s)), t);
1441
1433
  }
1442
- var o;
1434
+ var s;
1443
1435
  }
1444
- function it(r, i, l) {
1436
+ function it(r, i, a) {
1445
1437
  return i && pe(r.prototype, i), Object.defineProperty(r, "prototype", { writable: !1 }), r;
1446
1438
  }
1447
1439
  var M = function() {
@@ -1458,42 +1450,42 @@ function On() {
1458
1450
  return this.value;
1459
1451
  } }]), r;
1460
1452
  }(), lt = function(r) {
1461
- rt(l, r);
1462
- var i = Vt(l);
1463
- function l() {
1464
- return Pt(this, l), i.apply(this, arguments);
1453
+ rt(a, r);
1454
+ var i = Vt(a);
1455
+ function a() {
1456
+ return Pt(this, a), i.apply(this, arguments);
1465
1457
  }
1466
- return it(l);
1458
+ return it(a);
1467
1459
  }(M), X = function(r) {
1468
- rt(l, r);
1469
- var i = Vt(l);
1470
- function l() {
1471
- return Pt(this, l), i.apply(this, arguments);
1460
+ rt(a, r);
1461
+ var i = Vt(a);
1462
+ function a() {
1463
+ return Pt(this, a), i.apply(this, arguments);
1472
1464
  }
1473
- return it(l);
1465
+ return it(a);
1474
1466
  }(M), ut = function(r) {
1475
- rt(l, r);
1476
- var i = Vt(l);
1477
- function l() {
1478
- return Pt(this, l), i.apply(this, arguments);
1467
+ rt(a, r);
1468
+ var i = Vt(a);
1469
+ function a() {
1470
+ return Pt(this, a), i.apply(this, arguments);
1479
1471
  }
1480
- return it(l);
1472
+ return it(a);
1481
1473
  }(M), Lt = /^[\n\r\t\x20\xA0\u2000-\u200B\u205F\u3000]/, ye = /^[^\n\r\t\u0020\u2000-\u200B\u205F\u3000]{2,}/, Xt = /^[\xA0\u2011\u202F\u2060\uFEFF]/, ve = /^(?:[;\xAD%?…]|,(?!\d))/, me = /^[´±°¢£¤$¥\u2212]/;
1482
1474
  function kt(r, i) {
1483
1475
  i !== !1 && (r = r.trim());
1484
- for (var l, t, o = [], h = r.charAt(0), p = 0, m = 1, w = r.length; m < w; m++) {
1485
- l = r.charAt(m), t = r.charAt(m + 1);
1486
- var b = Lt.test(h), E = Lt.test(l), D = E || b, T = void 0;
1487
- if ((me.test(l) && !Xt.test(h) || ve.test(h + t) && !Xt.test(l)) && (D = !0), h !== "-" && h !== "‐" && h !== "–" && h !== "—" || ((T = Lt.test(r.charAt(m - 2))) && !E && (D = !1), !T && ye.test(l + t) && (D = !0)), D) {
1476
+ for (var a, t, s = [], c = r.charAt(0), p = 0, m = 1, w = r.length; m < w; m++) {
1477
+ a = r.charAt(m), t = r.charAt(m + 1);
1478
+ var b = Lt.test(c), E = Lt.test(a), D = E || b, T = void 0;
1479
+ if ((me.test(a) && !Xt.test(c) || ve.test(c + t) && !Xt.test(a)) && (D = !0), c !== "-" && c !== "‐" && c !== "–" && c !== "—" || ((T = Lt.test(r.charAt(m - 2))) && !E && (D = !1), !T && ye.test(a + t) && (D = !0)), D) {
1488
1480
  var O = r.slice(p, m);
1489
- /\u00AD$/.test(O) ? (o.push(new M(O.slice(0, -1))), o.push(new ut())) : (o.push(new M(O)), o.push(new lt())), p = m;
1481
+ /\u00AD$/.test(O) ? (s.push(new M(O.slice(0, -1))), s.push(new ut())) : (s.push(new M(O)), s.push(new lt())), p = m;
1490
1482
  }
1491
- h = l;
1483
+ c = a;
1492
1484
  }
1493
- return o.push(new M(r.slice(p))), o;
1485
+ return s.push(new M(r.slice(p))), s;
1494
1486
  }
1495
1487
  const be = { nbsp: " ", iexcl: "¡", cent: "¢", pound: "£", curren: "¤", yen: "¥", brvbar: "¦", sect: "§", uml: "¨", copy: "©", ordf: "ª", laquo: "«", not: "¬", shy: "­", reg: "®", macr: "¯", deg: "°", plusmn: "±", sup2: "²", sup3: "³", acute: "´", micro: "µ", para: "¶", middot: "·", cedil: "¸", sup1: "¹", ordm: "º", raquo: "»", frac14: "¼", frac12: "½", frac34: "¾", iquest: "¿", Agrave: "À", Aacute: "Á", Acirc: "Â", Atilde: "Ã", Auml: "Ä", Aring: "Å", AElig: "Æ", Ccedil: "Ç", Egrave: "È", Eacute: "É", Ecirc: "Ê", Euml: "Ë", Igrave: "Ì", Iacute: "Í", Icirc: "Î", Iuml: "Ï", ETH: "Ð", Ntilde: "Ñ", Ograve: "Ò", Oacute: "Ó", Ocirc: "Ô", Otilde: "Õ", Ouml: "Ö", times: "×", Oslash: "Ø", Ugrave: "Ù", Uacute: "Ú", Ucirc: "Û", Uuml: "Ü", Yacute: "Ý", THORN: "Þ", szlig: "ß", agrave: "à", aacute: "á", acirc: "â", atilde: "ã", auml: "ä", aring: "å", aelig: "æ", ccedil: "ç", egrave: "è", eacute: "é", ecirc: "ê", euml: "ë", igrave: "ì", iacute: "í", icirc: "î", iuml: "ï", eth: "ð", ntilde: "ñ", ograve: "ò", oacute: "ó", ocirc: "ô", otilde: "õ", ouml: "ö", divide: "÷", oslash: "ø", ugrave: "ù", uacute: "ú", ucirc: "û", uuml: "ü", yacute: "ý", thorn: "þ", yuml: "ÿ", fnof: "ƒ", Alpha: "Α", Beta: "Β", Gamma: "Γ", Delta: "Δ", Epsilon: "Ε", Zeta: "Ζ", Eta: "Η", Theta: "Θ", Iota: "Ι", Kappa: "Κ", Lambda: "Λ", Mu: "Μ", Nu: "Ν", Xi: "Ξ", Omicron: "Ο", Pi: "Π", Rho: "Ρ", Sigma: "Σ", Tau: "Τ", Upsilon: "Υ", Phi: "Φ", Chi: "Χ", Psi: "Ψ", Omega: "Ω", alpha: "α", beta: "β", gamma: "γ", delta: "δ", epsilon: "ε", zeta: "ζ", eta: "η", theta: "θ", iota: "ι", kappa: "κ", lambda: "λ", mu: "μ", nu: "ν", xi: "ξ", omicron: "ο", pi: "π", rho: "ρ", sigmaf: "ς", sigma: "σ", tau: "τ", upsilon: "υ", phi: "φ", chi: "χ", psi: "ψ", omega: "ω", thetasym: "ϑ", upsih: "ϒ", piv: "ϖ", bull: "•", hellip: "…", prime: "′", Prime: "″", oline: "‾", frasl: "⁄", weierp: "℘", image: "ℑ", real: "ℜ", trade: "™", alefsym: "ℵ", larr: "←", uarr: "↑", rarr: "→", darr: "↓", harr: "↔", crarr: "↵", lArr: "⇐", uArr: "⇑", rArr: "⇒", dArr: "⇓", hArr: "⇔", forall: "∀", part: "∂", exist: "∃", empty: "∅", nabla: "∇", isin: "∈", notin: "∉", ni: "∋", prod: "∏", sum: "∑", minus: "−", lowast: "∗", radic: "√", prop: "∝", infin: "∞", ang: "∠", and: "⊥", or: "⊦", cap: "∩", cup: "∪", int: "∫", there4: "∴", sim: "∼", cong: "≅", asymp: "≈", ne: "≠", equiv: "≡", le: "≤", ge: "≥", sub: "⊂", sup: "⊃", nsub: "⊄", sube: "⊆", supe: "⊇", oplus: "⊕", otimes: "⊗", perp: "⊥", sdot: "⋅", lceil: "⌈", rceil: "⌉", lfloor: "⌊", rfloor: "⌋", lang: "〈", rang: "〉", loz: "◊", spades: "♠", clubs: "♣", hearts: "♥", diams: "♦", quot: '"', amp: "&", lt: "<", gt: ">", OElig: "Œ", oelig: "œ", Scaron: "Š", scaron: "š", Yuml: "Ÿ", circ: "ˆ", tilde: "˜", ensp: " ", emsp: " ", thinsp: " ", zwnj: "‌", zwj: "‍", lrm: "‎", rlm: "‏", ndash: "–", mdash: "—", lsquo: "‘", rsquo: "’", sbquo: "‚", ldquo: "“", rdquo: "”", bdquo: "„", dagger: "†", Dagger: "‡", permil: "‰", lsaquo: "‹", rsaquo: "›" };
1496
- var He = /^[\n\r\x20\u2000-\u200B\u205F\u3000]/, Gt = /^<\/([a-zA-Z0-9]+)([^>]*)>/, Jt = /^<([a-zA-Z0-9]+)((?:\s[^=\s/]+(?:\s*=\s*(?:"[^"]+"|'[^']+'|[^>\\s]+))?)+)?\s*(\/?)>(\n*)/, $t = /^<!--(.+?)-->/, Kt = /&(?:#(\d\d{2,})|#x([\da-fA-F]{2,})|([a-zA-Z][a-zA-Z1-4]{1,8}));/g, _t = { b: function(r) {
1488
+ var Be = /^[\n\r\x20\u2000-\u200B\u205F\u3000]/, Gt = /^<\/([a-zA-Z0-9]+)([^>]*)>/, Jt = /^<([a-zA-Z0-9]+)((?:\s[^=\s/]+(?:\s*=\s*(?:"[^"]+"|'[^']+'|[^>\\s]+))?)+)?\s*(\/?)>(\n*)/, It = /^<!--(.+?)-->/, Kt = /&(?:#(\d\d{2,})|#x([\da-fA-F]{2,})|([a-zA-Z][a-zA-Z1-4]{1,8}));/g, _t = { b: function(r) {
1497
1489
  r.weight = "bold";
1498
1490
  }, strong: function(r) {
1499
1491
  r.weight = "bold";
@@ -1519,35 +1511,35 @@ function On() {
1519
1511
  r.sub = !0;
1520
1512
  }, sup: function(r) {
1521
1513
  r.sup = !0;
1522
- } }, Be = { div: 1, li: 1, blockquote: 2, h1: 2, h2: 2, h3: 2, h4: 2, h5: 2, h6: 2, ul: 2, ol: 2, hr: 2, p: 2 };
1514
+ } }, qe = { div: 1, li: 1, blockquote: 2, h1: 2, h2: 2, h3: 2, h4: 2, h5: 2, h6: 2, ul: 2, ol: 2, hr: 2, p: 2 };
1523
1515
  function Zt(r) {
1524
- return r.replace(Kt, function(i, l, t, o) {
1525
- if (l || t) {
1526
- var h = l ? 10 : 16;
1527
- return String.fromCharCode(parseInt(l || t, h));
1516
+ return r.replace(Kt, function(i, a, t, s) {
1517
+ if (a || t) {
1518
+ var c = a ? 10 : 16;
1519
+ return String.fromCharCode(parseInt(a || t, c));
1528
1520
  }
1529
- return o in be ? be[o] : i;
1521
+ return s in be ? be[s] : i;
1530
1522
  });
1531
1523
  }
1532
- function qe(r) {
1524
+ function We(r) {
1533
1525
  return r && r.length > 1 && (r[0] === '"' && r[r.length - 1] === '"' || r[0] === "'" && r[r.length - 1] === "'") ? r.slice(1, -1) : r;
1534
1526
  }
1535
- var We = /^\s*([^=\s&]+)(?:\s*=\s*("[^"]+"|'[^']+'|[^>\s]+))?/;
1536
- function It(r) {
1537
- var i, l = {};
1527
+ var Ue = /^\s*([^=\s&]+)(?:\s*=\s*("[^"]+"|'[^']+'|[^>\s]+))?/;
1528
+ function $t(r) {
1529
+ var i, a = {};
1538
1530
  if (r) {
1539
1531
  do
1540
- if (i = We.exec(r)) {
1541
- var t = Zt(qe(i[2] || "")).replace(/[ \r\n\t]+/g, " ").trim();
1542
- if (l[i[1]] = t, (r = r.slice(i[0].length)).length && /^\S/.test(r[0])) throw new Error("Attribute error");
1532
+ if (i = Ue.exec(r)) {
1533
+ var t = Zt(We(i[2] || "")).replace(/[ \r\n\t]+/g, " ").trim();
1534
+ if (a[i[1]] = t, (r = r.slice(i[0].length)).length && /^\S/.test(r[0])) throw new Error("Attribute error");
1543
1535
  }
1544
1536
  while (i && r.length);
1545
1537
  if (/\S/.test(r)) throw new Error("Attribute error");
1546
1538
  }
1547
- return l;
1539
+ return a;
1548
1540
  }
1549
1541
  const bt = { copyright: "©", textcopyright: "©", dag: "†", textdagger: "†", ddag: "‡", textdaggerdbl: "‡", guillemotleft: "«", guillemotright: "»", guilsinglleft: "‹", guilsinglright: "›", ldots: "…", dots: "…", textellipsis: "…", lq: "‘", P: "¶", textparagraph: "¶", pounds: "£", textsterling: "£", quotedblbase: "„", quotesinglbase: "‚", rq: "’", S: "§", sim: "~", textasciicircum: "^", textasciitilde: "˜", texttildelow: "~", textasteriskcentered: "*", textbackslash: "'", textbar: "|", textbardbl: "╎", textbigcircle: "◯", textbraceleft: "{", textbraceright: "}", textbullet: "•", textdollar: "$", textemdash: "—", textendash: "—", texteuro: "€", eurosym: "€", euro: "€", textexclamdown: "¡", textgreater: ">", textless: "<", textordfeminine: "ª", textordmasculine: "º", textperiodcentered: "·", cdot: "·", textquestiondown: "¿", textquotedblleft: "“", textquotedblright: "”", textquoteleft: "‘", textquoteright: "’", textquotestraightbase: "‚", textquotestraightdblbase: "„", textregistered: "®", textthreequartersemdash: "-", texttrademark: "™", texttwelveudash: "-", textunderscore: "_", textvisiblespace: "␣", gets: "←", textleftarrow: "←", to: "→", textrightarrow: "→", textdegree: "°", infty: "∞", triangle: "△", triangledown: "▽", blacktriangle: "▲", blacktriangledown: "▼", angle: "∠", sphericalangle: "∢", aleph: "ℵ", hbar: "ħ", imath: "𝚤", jmath: "𝚥", ell: "ℓ", wp: "℘", Re: "ℜ", Im: "ℑ", mho: "℧", prime: "′", emptyset: "∅", nabla: "∇", surd: "√", partial: "∂", top: "⟙", bot: "⟂", vdash: "⟝", dashv: "⟞", forall: "∀", exists: "∃", nexists: "∄", neg: "¬", lnot: "¬", flat: "♭", natural: "♮", sharp: "♯", backslash: "\\", Box: "□", Diamond: "♢", clubsuit: "♣", diamondsuit: "♦", heartsuit: "♥", spadesuit: "♠", Join: "⨝", blacksquare: "■", bigstar: "★", diagdown: "╲", diagup: "╱", blacklozenge: "⧫", rfloor: "⌋", lfloor: "⌊", rceil: "⌉", lceil: "⌈", rangle: "⟩", langle: "⟨", sum: "∑", int: "∫", oint: "∮", prod: "∏", coprod: "∏", bigcap: "∩", bigcup: "∪", bigsqcup: "⊔", bigvee: "∨", bigwedge: "∧", bigodot: "⊙", bigotimes: "⊗", bigoplus: "⊕", biguplus: "⊎", alpha: "α", beta: "β", chi: "χ", delta: "δ", epsilon: "ε", eta: "η", gamma: "γ", iota: "ι", kappa: "κ", lambda: "λ", mu: "μ", nu: "ν", omega: "ω", phi: "φ", pi: "π", psi: "ψ", rho: "ρ", sigma: "σ", tau: "τ", theta: "θ", upsilon: "υ", xi: "ξ", zeta: "ζ", Alpha: "Α", Beta: "Β", Chi: "Χ", Delta: "Δ", Epsilon: "Ε", Eta: "Η", Gamma: "Γ", Iota: "Ι", Kappa: "Κ", Lambda: "Λ", Mu: "Μ", Nu: "Ν", Omega: "Ω", Phi: "Φ", Pi: "Π", Psi: "Ψ", Rho: "Ρ", Sigma: "Σ", Tau: "Τ", Theta: "Θ", Upsilon: "Υ", Xi: "Ξ", Zeta: "Ζ", aa: "å", AA: "Å", ae: "æ", AE: "Æ", dh: "ð", DH: "Ð", dj: "đ", DJ: "Đ", ij: "ij", IJ: "IJ", l: "ł", L: "Ł", ng: "ŋ", NG: "Ŋ", o: "ø", O: "Ø", oe: "œ", OE: "Œ", ss: "ß", SS: "SS", th: "þ", TH: "Þ" };
1550
- var we = /^(\^|_|\\[^#$%&~_^\\{}()\s]+)(\{)?/, xe = /^%[^\n]+(?:\n|$)/, jt = /^[^#$%&~_^\\{}]+/, Ue = /^\\([&{}$%#_])/, Ye = /(?:\\[\\@,!:;-]|-{2,3}|[!?]`|``?|,,|''?|~|<<|>>)/g, Qt = { "---": "—", "--": "–", "!`": "¡", "?`": "¿", "``": "“", ",,": "„", "''": "”", "`": "‘", "'": "’", "<<": "«", ">>": "»", "~": " ", "\\-": "­", "\\,": " ", "\\;": " ", "\\:": " ", "\\!": " ", "\\@": "\uFEFF", "\\\\": "\\newline{}" }, q = { bf: function(r) {
1542
+ var we = /^(\^|_|\\[^#$%&~_^\\{}()\s]+)(\{)?/, xe = /^%[^\n]+(?:\n|$)/, jt = /^[^#$%&~_^\\{}]+/, Ye = /^\\([&{}$%#_])/, Ve = /(?:\\[\\@,!:;-]|-{2,3}|[!?]`|``?|,,|''?|~|<<|>>)/g, Qt = { "---": "—", "--": "–", "!`": "¡", "?`": "¿", "``": "“", ",,": "„", "''": "”", "`": "‘", "'": "’", "<<": "«", ">>": "»", "~": " ", "\\-": "­", "\\,": " ", "\\;": " ", "\\:": " ", "\\!": " ", "\\@": "\uFEFF", "\\\\": "\\newline{}" }, q = { bf: function(r) {
1551
1543
  r.weight = "bold";
1552
1544
  }, it: function(r) {
1553
1545
  r.style = "italic";
@@ -1569,15 +1561,15 @@ function On() {
1569
1561
  this.open_context().href = i, this.add_token(new M(i)), this.close_context();
1570
1562
  } };
1571
1563
  q.textsuperscript = q["^"], q.textsubscript = q._, q.textsl = q.sl, q.mathbf = q.bf, q.mathit = q.it, q.textbf = q.bf, q.textit = q.it, q.textcolor = q.color;
1572
- var Ve = /[\r\n\xA0]+/g;
1564
+ var Xe = /[\r\n\xA0]+/g;
1573
1565
  function Ee(r, i) {
1574
1566
  r.sup && (r.baseline = 0.45, r.size = 0.7), r.sub && (r.baseline = -0.3, r.size = 0.7);
1575
- var l = i;
1576
- return (r.style || r.weight || r.baseline || r.color || r.size || r.family) && (l = R(i, r)), l;
1567
+ var a = i;
1568
+ return (r.style || r.weight || r.baseline || r.color || r.size || r.family) && (a = R(i, r)), a;
1577
1569
  }
1578
- function te(r, i, l) {
1579
- for (var t, o, h = r.width; h + l.width > i && r.length; ) o = (t = r[r.length - 1]).width, t.width > l.width ? (t.value = t.value.slice(0, -1), t.width = B(t, t.font), h += t.width) : r.pop(), h -= o;
1580
- r[r.length - 1] instanceof ut && r.pop(), t = r[r.length - 1] || t || {}, l.font = R(l.font, t.bold, t.italic, ""), l.href = r.length ? t.href : null, l.rel = r.length ? t.rel : null, l.target = r.length ? t.target : null, r.push(l);
1570
+ function te(r, i, a) {
1571
+ for (var t, s, c = r.width; c + a.width > i && r.length; ) s = (t = r[r.length - 1]).width, t.width > a.width ? (t.value = t.value.slice(0, -1), t.width = B(t, t.font), c += t.width) : r.pop(), c -= s;
1572
+ r[r.length - 1] instanceof ut && r.pop(), t = r[r.length - 1] || t || {}, a.font = R(a.font, t.bold, t.italic, ""), a.href = r.length ? t.href : null, a.rel = r.length ? t.rel : null, a.target = r.length ? t.target : null, r.push(a);
1581
1573
  }
1582
1574
  function ct(r) {
1583
1575
  return Math.round(1e6 * r) / 1e6;
@@ -1587,11 +1579,11 @@ function On() {
1587
1579
  if (Array.isArray(i)) return Ft(i);
1588
1580
  }(r) || function(i) {
1589
1581
  if (typeof Symbol < "u" && i[Symbol.iterator] != null || i["@@iterator"] != null) return Array.from(i);
1590
- }(r) || function(i, l) {
1582
+ }(r) || function(i, a) {
1591
1583
  if (i) {
1592
- if (typeof i == "string") return Ft(i, l);
1584
+ if (typeof i == "string") return Ft(i, a);
1593
1585
  var t = Object.prototype.toString.call(i).slice(8, -1);
1594
- return t === "Object" && i.constructor && (t = i.constructor.name), t === "Map" || t === "Set" ? Array.from(i) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? Ft(i, l) : void 0;
1586
+ return t === "Object" && i.constructor && (t = i.constructor.name), t === "Map" || t === "Set" ? Array.from(i) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? Ft(i, a) : void 0;
1595
1587
  }
1596
1588
  }(r) || function() {
1597
1589
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
@@ -1600,72 +1592,72 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1600
1592
  }
1601
1593
  function Ft(r, i) {
1602
1594
  (i == null || i > r.length) && (i = r.length);
1603
- for (var l = 0, t = new Array(i); l < i; l++) t[l] = r[l];
1595
+ for (var a = 0, t = new Array(i); a < i; a++) t[a] = r[a];
1604
1596
  return t;
1605
1597
  }
1606
- var ke = { center: "middle", right: "end" }, Xe = { middle: 0.5, center: 0.5, bottom: 1, end: 1 }, ee = function(r, i) {
1598
+ var ke = { center: "middle", right: "end" }, Ge = { middle: 0.5, center: 0.5, bottom: 1, end: 1 }, ee = function(r, i) {
1607
1599
  return !r && !i || r === i;
1608
1600
  };
1609
- function Ge(r, i) {
1610
- var l = [], t = i.font(), o = t.size, h = t.family, p = i.align(), m = i.createElement();
1601
+ function Je(r, i) {
1602
+ var a = [], t = i.font(), s = t.size, c = t.family, p = i.align(), m = i.createElement();
1611
1603
  if (r.length) {
1612
- var w = t.height, b = i.valign(), E = i.height()(), D = i.width()(0), T = !isFinite(D) && r.length === 1, O = T ? null : i.x(), j = ct(w / o), W = T ? null : ct(w / (1.15 * o + (w - o) / 2));
1613
- if (Xe[b] && isFinite(E)) {
1604
+ var w = t.height, b = i.valign(), E = i.height()(), D = i.width()(0), T = !isFinite(D) && r.length === 1, O = T ? null : i.x(), j = ct(w / s), W = T ? null : ct(w / (1.15 * s + (w - s) / 2));
1605
+ if (Ge[b] && isFinite(E)) {
1614
1606
  var F = b === "bottom" ? 1 : 0.5;
1615
- W += (E * F - w * r.length * F) / o;
1607
+ W += (E * F - w * r.length * F) / s;
1616
1608
  }
1617
1609
  var P = p === "justify", H = 0;
1618
1610
  p === "right" ? H = D : p === "center" && (H = D / 2);
1619
- for (var N = [], J = "tspan", K = null, U = "", $ = function() {
1611
+ for (var N = [], J = "tspan", K = null, U = "", I = function() {
1620
1612
  if (U) {
1621
1613
  var Ct = m(J, K, U);
1622
1614
  N.push(Ct);
1623
1615
  }
1624
1616
  J = "tspan", K = null, U = "";
1625
- }, st = 0, nt = r.length; st < nt; st++) {
1626
- var ft = "", Et = "", ht = 0, gt = r[st];
1617
+ }, ot = 0, nt = r.length; ot < nt; ot++) {
1618
+ var ft = "", Et = "", ht = 0, gt = r[ot];
1627
1619
  if (gt.length) {
1628
1620
  N = [];
1629
1621
  for (var Mt = 0, le = 0, pt = void 0, Z = 0, Oe = gt.length; Z < Oe; Z++) {
1630
1622
  var Y = gt[Z], Q = Y.font;
1631
- Y.whitespace && Mt++, le += Y.width, Z && !Y.tracking && !ht && ee(Q.id, ft) && ee(Y.class, Et) && ee(pt, Y.href) ? U += Y.value : ($(), U = Y.value, K = { fontFamily: Q.family !== h ? Q.family : null, fontSize: Q.size !== o ? Q.size : null, fontWeight: Q.weight || null, fontStyle: Q.style || null, fontVariant: Q.variant !== "normal" && Q.variant || null, fill: Q.color || null, baselineShift: Q.baseline ? 100 * Q.baseline + "%" : null, className: Y.class || null }, ht && (K.dx = ct(ht), ht = 0), Y.tracking && (ht = Q.size * Y.tracking), Y.href && !pt ? (pt = Y.href, J = "a", K.href = pt, K.rel = Y.rel, K.target = Y.target) : pt = null, ft = Q.id, Et = Y.class);
1623
+ Y.whitespace && Mt++, le += Y.width, Z && !Y.tracking && !ht && ee(Q.id, ft) && ee(Y.class, Et) && ee(pt, Y.href) ? U += Y.value : (I(), U = Y.value, K = { fontFamily: Q.family !== c ? Q.family : null, fontSize: Q.size !== s ? Q.size : null, fontWeight: Q.weight || null, fontStyle: Q.style || null, fontVariant: Q.variant !== "normal" && Q.variant || null, fill: Q.color || null, baselineShift: Q.baseline ? 100 * Q.baseline + "%" : null, className: Y.class || null }, ht && (K.dx = ct(ht), ht = 0), Y.tracking && (ht = Q.size * Y.tracking), Y.href && !pt ? (pt = Y.href, J = "a", K.href = pt, K.rel = Y.rel, K.target = Y.target) : pt = null, ft = Q.id, Et = Y.class);
1632
1624
  }
1633
- if ($(), T) l.push.apply(l, Ae(N));
1625
+ if (I(), T) a.push.apply(a, Ae(N));
1634
1626
  else {
1635
- var De = null, ue = st === nt - 1 || gt[gt.length - 1] instanceof X;
1636
- P && gt.length > 1 && !ue && (De = ct((D - le) / Mt)), l.push(m.apply(void 0, ["tspan", { wordSpacing: De, x: O(st) + H, dy: ct(st ? j : W) + "em" }].concat(Ae(N))));
1627
+ var De = null, ue = ot === nt - 1 || gt[gt.length - 1] instanceof X;
1628
+ P && gt.length > 1 && !ue && (De = ct((D - le) / Mt)), a.push(m.apply(void 0, ["tspan", { wordSpacing: De, x: O(ot) + H, dy: ct(ot ? j : W) + "em" }].concat(Ae(N))));
1637
1629
  }
1638
- } else l.push(m("tspan", { x: O(st), dy: ct(st ? j : W) + "em" }, " "));
1630
+ } else a.push(m("tspan", { x: O(ot), dy: ct(ot ? j : W) + "em" }, " "));
1639
1631
  }
1640
1632
  }
1641
- return m.apply(void 0, ["text", { fontFamily: h, fontSize: o, textAnchor: ke[p] || "start" }].concat(l));
1633
+ return m.apply(void 0, ["text", { fontFamily: c, fontSize: s, textAnchor: ke[p] || "start" }].concat(a));
1642
1634
  }
1643
- var Je = { middle: 0.5, center: 0.5, bottom: 1, end: 1 };
1644
- function Ke(r, i, l) {
1635
+ var Ke = { middle: 0.5, center: 0.5, bottom: 1, end: 1 };
1636
+ function Ze(r, i, a) {
1645
1637
  if (r.length) {
1646
- l.textBaseline = "middle";
1647
- var t = i.font(), o = t.height, h = t.size, p = i.valign(), m = i.height()(), w = i.width()(0), b = i.align(), E = b === "justify", D = 0.5 * o, T = Je[p];
1638
+ a.textBaseline = "middle";
1639
+ var t = i.font(), s = t.height, c = t.size, p = i.valign(), m = i.height()(), w = i.width()(0), b = i.align(), E = b === "justify", D = 0.5 * s, T = Ke[p];
1648
1640
  if (T && isFinite(m)) {
1649
- var O = r.length * o;
1641
+ var O = r.length * s;
1650
1642
  D += m * T - O * T;
1651
1643
  }
1652
1644
  r.forEach(function(j, W) {
1653
- var F = i.x()(W), P = W * o + D, H = 0, N = 0;
1645
+ var F = i.x()(W), P = W * s + D, H = 0, N = 0;
1654
1646
  j.forEach(function(U) {
1655
1647
  U.whitespace && H++, N += U.width;
1656
1648
  });
1657
1649
  var J = 0, K = W === r.length - 1 || j[j.length - 1] instanceof X;
1658
1650
  E && j.length > 1 && !K && (J = (w - N) / H), j.forEach(function(U) {
1659
- l.font = U.font;
1660
- var $ = U.font, st = $.baseline ? h * -$.baseline + 0.15 * h : 0;
1661
- l.fillStyle = function(Et, ht) {
1651
+ a.font = U.font;
1652
+ var I = U.font, ot = I.baseline ? c * -I.baseline + 0.15 * c : 0;
1653
+ a.fillStyle = function(Et, ht) {
1662
1654
  return Et.color ? Et.color : ht.href ? "#00C" : "#000";
1663
- }($, U);
1655
+ }(I, U);
1664
1656
  var nt = 0;
1665
- if (b === "right" ? nt += w - N : b === "center" ? nt += w / 2 - N / 2 : b === "justify" && (U.whitespace || U instanceof X) && (F += J), l.fillText(U.value, F + nt, P + st), U.href) {
1666
- l.beginPath(), l.strokeStyle = l.fillStyle;
1667
- var ft = Math.floor(P + 0.45 * h) + 0.5;
1668
- l.moveTo(F + nt, ft), l.lineTo(F + nt + U.width, ft), l.stroke();
1657
+ if (b === "right" ? nt += w - N : b === "center" ? nt += w / 2 - N / 2 : b === "justify" && (U.whitespace || U instanceof X) && (F += J), a.fillText(U.value, F + nt, P + ot), U.href) {
1658
+ a.beginPath(), a.strokeStyle = a.fillStyle;
1659
+ var ft = Math.floor(P + 0.45 * c) + 0.5;
1660
+ a.moveTo(F + nt, ft), a.lineTo(F + nt + U.width, ft), a.stroke();
1669
1661
  }
1670
1662
  F += U.width;
1671
1663
  });
@@ -1680,8 +1672,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1680
1672
  }, re(r);
1681
1673
  }
1682
1674
  function _e(r) {
1683
- for (var i = {}, l = 0; l < r.length; l++) {
1684
- var t = r[l];
1675
+ for (var i = {}, a = 0; a < r.length; a++) {
1676
+ var t = r[a];
1685
1677
  typeof t != "number" && t != null && (typeof t == "string" ? i.text = t : typeof t == "function" ? i.fn = t : re(t) === "object" && t._groups ? i.d3 = t : t && t.nodeType && t.getContext ? i.ctx = t.getContext("2d") : t && t.fillText && t.beginPath ? i.ctx = t : t && (i.text = t));
1686
1678
  }
1687
1679
  return i;
@@ -1694,20 +1686,20 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1694
1686
  }, dt(r);
1695
1687
  }
1696
1688
  function Se(r, i) {
1697
- for (var l = 0; l < i.length; l++) {
1698
- var t = i[l];
1699
- t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(r, (o = function(h, p) {
1700
- if (dt(h) !== "object" || h === null) return h;
1701
- var m = h[Symbol.toPrimitive];
1689
+ for (var a = 0; a < i.length; a++) {
1690
+ var t = i[a];
1691
+ t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(r, (s = function(c, p) {
1692
+ if (dt(c) !== "object" || c === null) return c;
1693
+ var m = c[Symbol.toPrimitive];
1702
1694
  if (m !== void 0) {
1703
- var w = m.call(h, p);
1695
+ var w = m.call(c, p);
1704
1696
  if (dt(w) !== "object") return w;
1705
1697
  throw new TypeError("@@toPrimitive must return a primitive value.");
1706
1698
  }
1707
- return String(h);
1708
- }(t.key, "string"), dt(o) === "symbol" ? o : String(o)), t);
1699
+ return String(c);
1700
+ }(t.key, "string"), dt(s) === "symbol" ? s : String(s)), t);
1709
1701
  }
1710
- var o;
1702
+ var s;
1711
1703
  }
1712
1704
  var wt = R(), St = function(r) {
1713
1705
  return typeof r == "function" ? r : function() {
@@ -1715,27 +1707,27 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1715
1707
  };
1716
1708
  }, G = function() {
1717
1709
  function r(t) {
1718
- if (function(h, p) {
1719
- if (!(h instanceof p)) throw new TypeError("Cannot call a class as a function");
1710
+ if (function(c, p) {
1711
+ if (!(c instanceof p)) throw new TypeError("Cannot call a class as a function");
1720
1712
  }(this, r), this.props = { overflow: "ellipsis", lineclamp: null, align: "left", wordBreak: null, valign: "top", width: function() {
1721
1713
  return 1 / 0;
1722
1714
  }, height: function() {
1723
1715
  return 1 / 0;
1724
1716
  }, x: function() {
1725
1717
  return 0;
1726
- }, font: null, tAnchor: 0, parser: r.defaultparser }, t) for (var o in t) typeof this[o] == "function" && this[o](t[o]);
1718
+ }, font: null, tAnchor: 0, parser: r.defaultparser }, t) for (var s in t) typeof this[s] == "function" && this[s](t[s]);
1727
1719
  }
1728
- var i, l;
1729
- return i = r, l = [{ key: "linebreak", value: function(t) {
1730
- var o = this, h = this.props.parser(String(t)), p = this.font(), m = function(w, b, E) {
1720
+ var i, a;
1721
+ return i = r, a = [{ key: "linebreak", value: function(t) {
1722
+ var s = this, c = this.props.parser(String(t)), p = this.font(), m = function(w, b, E) {
1731
1723
  if (!w.length) return [];
1732
1724
  var D = b.height(), T = b.width(), O = b.overflowLine(), j = b.overflowWrap(), W = R(E, !0, !1), F = isFinite(D()) ? Math.floor(D() / E.height) : 1 / 0;
1733
1725
  if (!D() && !T(0) || !F) return [];
1734
1726
  for (var P = 0, H = 0, N = 0, J = [], K = [], U = !1; P < w.length && H < F; ) {
1735
- var $ = w[P], st = Ee($, E);
1736
- if ($.width = B($, st), $.font = st, $.line = H, $.whitespace = $.value in C, $.value && ($.value = $.value.replace(Ve, " ")), !(!N && $.whitespace || U && $.whitespace)) if ($ instanceof X) N = 0, K = [], J.push(P + 1), H++;
1737
- else if ($ instanceof lt || $ instanceof ut) K.push({ index: P, width: N });
1738
- else if ($.whitespace || N + $.width < T(H)) N += $.width;
1727
+ var I = w[P], ot = Ee(I, E);
1728
+ if (I.width = B(I, ot), I.font = ot, I.line = H, I.whitespace = I.value in C, I.value && (I.value = I.value.replace(Xe, " ")), !(!N && I.whitespace || U && I.whitespace)) if (I instanceof X) N = 0, K = [], J.push(P + 1), H++;
1729
+ else if (I instanceof lt || I instanceof ut) K.push({ index: P, width: N });
1730
+ else if (I.whitespace || N + I.width < T(H)) N += I.width;
1739
1731
  else if (K.length) {
1740
1732
  var nt = void 0, ft = void 0;
1741
1733
  do {
@@ -1746,27 +1738,27 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1746
1738
  J.push(nt.index + 1), N = 0, H++, P = nt.index, K = [];
1747
1739
  } else if (j === "break-word") {
1748
1740
  var gt = T(H);
1749
- if (N + $.width > gt) {
1750
- var Mt = $.clone();
1741
+ if (N + I.width > gt) {
1742
+ var Mt = I.clone();
1751
1743
  do
1752
- $.value = $.value.slice(0, -1), $.width = B($, $.font), N += $.width;
1753
- while ($.value && $.width > gt);
1754
- Mt.value = Mt.value.slice($.value.length), w.splice(P + 1, 0, new lt(), Mt);
1744
+ I.value = I.value.slice(0, -1), I.width = B(I, I.font), N += I.width;
1745
+ while (I.value && I.width > gt);
1746
+ Mt.value = Mt.value.slice(I.value.length), w.splice(P + 1, 0, new lt(), Mt);
1755
1747
  }
1756
1748
  J.push(P + 1), N = 0, H++;
1757
- } else N += $.width;
1758
- P++, U = $.whitespace;
1749
+ } else N += I.width;
1750
+ P++, U = I.whitespace;
1759
1751
  }
1760
1752
  P !== J[J.length - 1] && J.push(P);
1761
1753
  var le = 0, pt = 0, Z = J.map(function(Ct) {
1762
1754
  for (var et, Tt = le; (et = w[Tt]) && (et.whitespace || !et.value); ) Tt++;
1763
- for (var At = Ct, tr = null; At > Tt && (et = w[At - 1]) && (et.whitespace || !(et.value || et instanceof ut)); ) et instanceof X && (tr = et), At--;
1755
+ for (var At = Ct, er = null; At > Tt && (et = w[At - 1]) && (et.whitespace || !(et.value || et instanceof ut)); ) et instanceof X && (er = et), At--;
1764
1756
  et instanceof ut && (et.value = "-", et.width = B("-", et.font)), le = Ct;
1765
- var zt = w.slice(Tt, At).filter(function(er) {
1766
- return er.value;
1757
+ var zt = w.slice(Tt, At).filter(function(rr) {
1758
+ return rr.value;
1767
1759
  });
1768
- return tr && zt.push(tr), zt.width = zt.reduce(function(er, Jr) {
1769
- return er + Jr.width;
1760
+ return er && zt.push(er), zt.width = zt.reduce(function(rr, Jr) {
1761
+ return rr + Jr.width;
1770
1762
  }, 0), zt.width > pt && (pt = zt.width), zt;
1771
1763
  });
1772
1764
  if (Z.hasLineOverflow = !1, O) {
@@ -1785,9 +1777,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1785
1777
  ue.font = E, ue.width = B(Y, W), te(De, Q, ue), Z.hasOverflow = !0;
1786
1778
  } else Z.hasOverflow = !1;
1787
1779
  return Z.font = E, Z.width = pt, Z;
1788
- }(h, this, p);
1780
+ }(c, this, p);
1789
1781
  return m.height = m.length * p.height, m.render = function(w) {
1790
- return o.render(m, w);
1782
+ return s.render(m, w);
1791
1783
  }, m.svg = m.render, m.draw = m.render, m;
1792
1784
  } }, { key: "font", value: function(t) {
1793
1785
  return arguments.length ? (this.props.font = R(t), this) : this.props.font || R(wt);
@@ -1799,12 +1791,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1799
1791
  return arguments.length ? (this.props.valign = t, this) : this.props.valign;
1800
1792
  } }, { key: "align", value: function(t) {
1801
1793
  if (!arguments.length) return this.props.align;
1802
- var o = String(t).toLowerCase();
1803
- return o === "left" || o === "start" ? (this.props.align = "left", this.props.tAnchor = 0) : o === "center" || o === "middle" ? (this.props.align = "center", this.props.tAnchor = -0.5) : o === "end" || o === "right" ? (this.props.align = "right", this.props.tAnchor = -1) : o === "justify" && (this.props.align = t, this.props.tAnchor = 0), this;
1794
+ var s = String(t).toLowerCase();
1795
+ return s === "left" || s === "start" ? (this.props.align = "left", this.props.tAnchor = 0) : s === "center" || s === "middle" ? (this.props.align = "center", this.props.tAnchor = -0.5) : s === "end" || s === "right" ? (this.props.align = "right", this.props.tAnchor = -1) : s === "justify" && (this.props.align = t, this.props.tAnchor = 0), this;
1804
1796
  } }, { key: "overflowWrap", value: function(t) {
1805
1797
  if (!arguments.length) return this.props.overflowWrap || "normal";
1806
- var o = String(t).toLowerCase();
1807
- return o === "break-word" ? this.props.overflowWrap = "break-word" : o !== "normal" && t != null || (this.props.overflowWrap = null), this;
1798
+ var s = String(t).toLowerCase();
1799
+ return s === "break-word" ? this.props.overflowWrap = "break-word" : s !== "normal" && t != null || (this.props.overflowWrap = null), this;
1808
1800
  } }, { key: "width", value: function(t) {
1809
1801
  return arguments.length ? (this.props.width = St(t), this) : this.props.width;
1810
1802
  } }, { key: "height", value: function(t) {
@@ -1814,8 +1806,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1814
1806
  } }, { key: "parser", value: function(t) {
1815
1807
  if (!arguments.length) return this.props.parser;
1816
1808
  if (typeof t == "string") {
1817
- var o = r[t] || r[t + "parser"];
1818
- typeof o == "function" && (t = o);
1809
+ var s = r[t] || r[t + "parser"];
1810
+ typeof s == "function" && (t = s);
1819
1811
  }
1820
1812
  if (typeof t != "function") throw new Error("Unknown parser: " + t);
1821
1813
  return this.props.parser = t, this;
@@ -1823,8 +1815,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1823
1815
  return arguments.length ? (this.props.createElement = t, this) : this.props.createElement || r.createElement;
1824
1816
  } }, { key: "render", value: function() {
1825
1817
  var t = _e(arguments);
1826
- return typeof t.text == "string" && (t.text = this.linebreak(t.text)), t.ctx ? Ke(t.text, this, t.ctx) : Ge(t.text, this);
1827
- } }], l && Se(i.prototype, l), Object.defineProperty(i, "prototype", { writable: !1 }), r;
1818
+ return typeof t.text == "string" && (t.text = this.linebreak(t.text)), t.ctx ? Ze(t.text, this, t.ctx) : Je(t.text, this);
1819
+ } }], a && Se(i.prototype, a), Object.defineProperty(i, "prototype", { writable: !1 }), r;
1828
1820
  }();
1829
1821
  function xt(r) {
1830
1822
  return xt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(i) {
@@ -1835,24 +1827,24 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1835
1827
  }
1836
1828
  function ne(r, i) {
1837
1829
  (i == null || i > r.length) && (i = r.length);
1838
- for (var l = 0, t = new Array(i); l < i; l++) t[l] = r[l];
1830
+ for (var a = 0, t = new Array(i); a < i; a++) t[a] = r[a];
1839
1831
  return t;
1840
1832
  }
1841
1833
  function Ce(r, i) {
1842
- for (var l = 0; l < i.length; l++) {
1843
- var t = i[l];
1844
- t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(r, (o = function(h, p) {
1845
- if (xt(h) !== "object" || h === null) return h;
1846
- var m = h[Symbol.toPrimitive];
1834
+ for (var a = 0; a < i.length; a++) {
1835
+ var t = i[a];
1836
+ t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(r, (s = function(c, p) {
1837
+ if (xt(c) !== "object" || c === null) return c;
1838
+ var m = c[Symbol.toPrimitive];
1847
1839
  if (m !== void 0) {
1848
- var w = m.call(h, p);
1840
+ var w = m.call(c, p);
1849
1841
  if (xt(w) !== "object") return w;
1850
1842
  throw new TypeError("@@toPrimitive must return a primitive value.");
1851
1843
  }
1852
- return String(h);
1853
- }(t.key, "string"), xt(o) === "symbol" ? o : String(o)), t);
1844
+ return String(c);
1845
+ }(t.key, "string"), xt(s) === "symbol" ? s : String(s)), t);
1854
1846
  }
1855
- var o;
1847
+ var s;
1856
1848
  }
1857
1849
  var Te = function(r) {
1858
1850
  return typeof r == "function" ? r : function() {
@@ -1860,19 +1852,19 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1860
1852
  };
1861
1853
  }, ie = function() {
1862
1854
  function r(t) {
1863
- if (function(h, p) {
1864
- if (!(h instanceof p)) throw new TypeError("Cannot call a class as a function");
1855
+ if (function(c, p) {
1856
+ if (!(c instanceof p)) throw new TypeError("Cannot call a class as a function");
1865
1857
  }(this, r), this.props = { width: function() {
1866
1858
  return 1 / 0;
1867
1859
  }, height: function() {
1868
1860
  return 1 / 0;
1869
- }, rotation: 0, vAnchor: 0, hAnchor: 0 }, t) for (var o in t) typeof this[o] == "function" && this[o](t[o]);
1861
+ }, rotation: 0, vAnchor: 0, hAnchor: 0 }, t) for (var s in t) typeof this[s] == "function" && this[s](t[s]);
1870
1862
  this.render = this.render.bind(this);
1871
1863
  }
1872
- var i, l;
1873
- return i = r, l = [{ key: "anchor", value: function(t) {
1874
- var o = this.props, h = o.hAnchor, p = o.vAnchor, m = o.width, w = o.height;
1875
- if (!arguments.length) return [h * m(0), p * w(0)];
1864
+ var i, a;
1865
+ return i = r, a = [{ key: "anchor", value: function(t) {
1866
+ var s = this.props, c = s.hAnchor, p = s.vAnchor, m = s.width, w = s.height;
1867
+ if (!arguments.length) return [c * m(0), p * w(0)];
1876
1868
  if (typeof t == "string") {
1877
1869
  var b = this.props;
1878
1870
  t.toLowerCase().trim().split(/\s+/).forEach(function(E) {
@@ -1888,78 +1880,78 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1888
1880
  return arguments.length ? (this.props.rotation = t, this) : this.props.rotation;
1889
1881
  } }, { key: "createElement", value: function(t) {
1890
1882
  return arguments.length ? (this.props.createElement = t, this) : this.props.createElement || r.createElement;
1891
- } }, { key: "canvas", value: function(t, o) {
1892
- var h, p = t.getContext ? t.getContext("2d") : t;
1883
+ } }, { key: "canvas", value: function(t, s) {
1884
+ var c, p = t.getContext ? t.getContext("2d") : t;
1893
1885
  return p.save(), p.rotate(this.rotate() * Math.PI / 180), p.translate.apply(p, function(m) {
1894
1886
  if (Array.isArray(m)) return ne(m);
1895
- }(h = this.anchor()) || function(m) {
1887
+ }(c = this.anchor()) || function(m) {
1896
1888
  if (typeof Symbol < "u" && m[Symbol.iterator] != null || m["@@iterator"] != null) return Array.from(m);
1897
- }(h) || function(m, w) {
1889
+ }(c) || function(m, w) {
1898
1890
  if (m) {
1899
1891
  if (typeof m == "string") return ne(m, w);
1900
1892
  var b = Object.prototype.toString.call(m).slice(8, -1);
1901
1893
  return b === "Object" && m.constructor && (b = m.constructor.name), b === "Map" || b === "Set" ? Array.from(m) : b === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(b) ? ne(m, w) : void 0;
1902
1894
  }
1903
- }(h) || function() {
1895
+ }(c) || function() {
1904
1896
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
1905
1897
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
1906
- }()), o(p), p.restore(), p;
1898
+ }()), s(p), p.restore(), p;
1907
1899
  } }, { key: "render", value: function() {
1908
1900
  var t = _e(arguments);
1909
1901
  if (t.d3) return t.d3.attr("transform", "rotate(".concat(this.rotate(), ") translate(").concat(this.anchor(), ")"));
1910
1902
  if (t.ctx) return this.canvas(t.ctx, t.fn);
1911
1903
  if (t.text) {
1912
- var o = typeof t.text.render == "function" ? t.text.render() : t.text;
1913
- return this.createElement()("g", { transform: "rotate(".concat(this.rotate(), ") translate(").concat(this.anchor(), ")") }, o);
1904
+ var s = typeof t.text.render == "function" ? t.text.render() : t.text;
1905
+ return this.createElement()("g", { transform: "rotate(".concat(this.rotate(), ") translate(").concat(this.anchor(), ")") }, s);
1914
1906
  }
1915
- } }], l && Ce(i.prototype, l), Object.defineProperty(i, "prototype", { writable: !1 }), r;
1916
- }(), Re = Object.prototype.hasOwnProperty, se = {};
1917
- function Ze(r) {
1918
- return se[r] || (se[r] = r.replace(/([a-z])([A-Z])/g, function(i, l, t) {
1919
- return l + "-" + t.toLowerCase();
1920
- })), se[r];
1921
- }
1922
- function oe(r, i) {
1923
- if (Array.isArray(i)) return i.forEach(function(l) {
1924
- return oe(r, l);
1907
+ } }], a && Ce(i.prototype, a), Object.defineProperty(i, "prototype", { writable: !1 }), r;
1908
+ }(), Re = Object.prototype.hasOwnProperty, oe = {};
1909
+ function Qe(r) {
1910
+ return oe[r] || (oe[r] = r.replace(/([a-z])([A-Z])/g, function(i, a, t) {
1911
+ return a + "-" + t.toLowerCase();
1912
+ })), oe[r];
1913
+ }
1914
+ function se(r, i) {
1915
+ if (Array.isArray(i)) return i.forEach(function(a) {
1916
+ return se(r, a);
1925
1917
  });
1926
1918
  typeof i == "string" && (i = document.createTextNode(i)), r.appendChild(i);
1927
1919
  }
1928
1920
  function ae(r, i) {
1929
1921
  if (typeof document < "u") {
1930
- var l = typeof r == "string" ? document.createElementNS("http://www.w3.org/2000/svg", r) : r;
1931
- if (i && l.setAttribute) for (var t in i) Re.call(i, t) && i[t] != null && l.setAttribute(t === "className" ? "class" : Ze(t), i[t]);
1932
- for (var o = arguments.length, h = new Array(o > 2 ? o - 2 : 0), p = 2; p < o; p++) h[p - 2] = arguments[p];
1933
- return h != null && h.length && h.forEach(function(m) {
1934
- oe(l, m);
1935
- }), l;
1922
+ var a = typeof r == "string" ? document.createElementNS("http://www.w3.org/2000/svg", r) : r;
1923
+ if (i && a.setAttribute) for (var t in i) Re.call(i, t) && i[t] != null && a.setAttribute(t === "className" ? "class" : Qe(t), i[t]);
1924
+ for (var s = arguments.length, c = new Array(s > 2 ? s - 2 : 0), p = 2; p < s; p++) c[p - 2] = arguments[p];
1925
+ return c != null && c.length && c.forEach(function(m) {
1926
+ se(a, m);
1927
+ }), a;
1936
1928
  }
1937
1929
  }
1938
1930
  G.createElement = ae, G.textparser = kt, G.defaultparser = kt, G.htmlparser = function(r) {
1939
1931
  r = String(r || "").trim();
1940
- for (var i, l, t = { weight: null, style: null, sub: !1, sup: !1, href: null, color: null, rel: null, target: null }, o = [], h = [], p = function(D) {
1932
+ for (var i, a, t = { weight: null, style: null, sub: !1, sup: !1, href: null, color: null, rel: null, target: null }, s = [], c = [], p = function(D) {
1941
1933
  for (var T in t) t[T] && (D[T] = t[T]);
1942
- o.push(D);
1934
+ s.push(D);
1943
1935
  }, m = function(D) {
1944
- var T = o.length, O = Be[D];
1936
+ var T = s.length, O = qe[D];
1945
1937
  if (T && O) {
1946
- for (var j = T - 1; o[j] && (o[j] instanceof lt || He.test(o[j].value)); ) j--;
1947
- for (; O && o[j] && o[j] instanceof X; ) j--, O--;
1948
- for (; O-- > 0; ) o.push(new X());
1938
+ for (var j = T - 1; s[j] && (s[j] instanceof lt || Be.test(s[j].value)); ) j--;
1939
+ for (; O && s[j] && s[j] instanceof X; ) j--, O--;
1940
+ for (; O-- > 0; ) s.push(new X());
1949
1941
  }
1950
1942
  }; r.length; ) {
1951
1943
  if (i = /^[^<]+/.exec(r)) kt(Zt(i[0]), !1).forEach(p);
1952
- else if (!(i = $t.exec(r))) if (i = Gt.exec(r)) h.length && (t = h.pop()), m(i[1]);
1944
+ else if (!(i = It.exec(r))) if (i = Gt.exec(r)) c.length && (t = c.pop()), m(i[1]);
1953
1945
  else if (i = Jt.exec(r)) {
1954
1946
  var w = i[1];
1955
- m(w), h.push(t), t = Object.create(t), _t[w] && _t[w](t, "");
1956
- var b = It(i[2]);
1957
- w === "a" && (b.href && (t.href = b.href), b.rel && (t.rel = b.rel), b.target && (t.target = b.target)), b.class && (t.class = t.class ? t.class + " " + b.class : b.class), b.style && (l = /(?:^|\s|;)color\s*:\s*([^;\s"']+)/.exec(b.style)) && l[1] && (t.color = l[1]), w === "br" && o.push(new X());
1947
+ m(w), c.push(t), t = Object.create(t), _t[w] && _t[w](t, "");
1948
+ var b = $t(i[2]);
1949
+ w === "a" && (b.href && (t.href = b.href), b.rel && (t.rel = b.rel), b.target && (t.target = b.target)), b.class && (t.class = t.class ? t.class + " " + b.class : b.class), b.style && (a = /(?:^|\s|;)color\s*:\s*([^;\s"']+)/.exec(b.style)) && a[1] && (t.color = a[1]), w === "br" && s.push(new X());
1958
1950
  } else i = [r.slice(0, 1)], p(new M(i[0]));
1959
1951
  r = r.slice(i[0].length);
1960
1952
  }
1961
- for (var E = o[o.length - 1]; E instanceof X; ) o.pop(), E = o[o.length - 1];
1962
- return o;
1953
+ for (var E = s[s.length - 1]; E instanceof X; ) s.pop(), E = s[s.length - 1];
1954
+ return s;
1963
1955
  }, G.latexparser = function(r) {
1964
1956
  r = String(r || "").trim();
1965
1957
  var i = [0];
@@ -1967,7 +1959,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1967
1959
  return i.push(P), "\\verb," + (i.length - 1) + ",";
1968
1960
  }).replace(/\\\\\n/g, function() {
1969
1961
  return "\\\\";
1970
- }).replace(Ye, function(F, P, H) {
1962
+ }).replace(Ve, function(F, P, H) {
1971
1963
  return H.charAt(P - 1) === "\\" ? F : Qt[F];
1972
1964
  }).replace(/\n\s+/g, function(F) {
1973
1965
  return /\n/.test(F.slice(1)) ? "\\par " : F;
@@ -1978,23 +1970,23 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1978
1970
  }).replace(/\\verb,(.*?),/, function(F, P) {
1979
1971
  return "\\verb,".concat(i[+P], ",");
1980
1972
  });
1981
- for (var l, t = { weight: null, italic: null, variant: null, sub: !1, sup: !1, href: null }, o = [], h = [], p = function(F) {
1973
+ for (var a, t = { weight: null, italic: null, variant: null, sub: !1, sup: !1, href: null }, s = [], c = [], p = function(F) {
1982
1974
  for (var P in t) t[P] && (F[P] = t[P]);
1983
- return o.push(F), F;
1975
+ return s.push(F), F;
1984
1976
  }, m = function() {
1985
- h.push(t), t = Object.create(t);
1977
+ c.push(t), t = Object.create(t);
1986
1978
  }, w = function() {
1987
- if (!h.length) throw new Error("Unexpected }");
1988
- t = h.pop();
1989
- }, b = { tokens: o, open_context: m, close_context: w, add_token: p }; r.length; ) {
1990
- if (l = jt.exec(r)) kt(l[0], !1).forEach(p);
1991
- else if (l = Ue.exec(r)) p(new M(l[1]));
1992
- else if (!(l = xe.exec(r))) {
1993
- if (l = /^\{/.exec(r)) m();
1994
- else if (l = /^\}/.exec(r)) w();
1995
- else if (!(l = /^\$/.exec(r))) if (l = /^\\verb,([^,]+),/.exec(r)) p(new M(l[1]));
1996
- else if (l = we.exec(r)) {
1997
- var E = l[1].slice(1) || l[1], D = !!l[2];
1979
+ if (!c.length) throw new Error("Unexpected }");
1980
+ t = c.pop();
1981
+ }, b = { tokens: s, open_context: m, close_context: w, add_token: p }; r.length; ) {
1982
+ if (a = jt.exec(r)) kt(a[0], !1).forEach(p);
1983
+ else if (a = Ye.exec(r)) p(new M(a[1]));
1984
+ else if (!(a = xe.exec(r))) {
1985
+ if (a = /^\{/.exec(r)) m();
1986
+ else if (a = /^\}/.exec(r)) w();
1987
+ else if (!(a = /^\$/.exec(r))) if (a = /^\\verb,([^,]+),/.exec(r)) p(new M(a[1]));
1988
+ else if (a = we.exec(r)) {
1989
+ var E = a[1].slice(1) || a[1], D = !!a[2];
1998
1990
  if (/^(La)?TeX$/i.test(E)) {
1999
1991
  m(), t.family = "serif";
2000
1992
  var T = void 0;
@@ -2003,42 +1995,42 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
2003
1995
  else if (E in q) {
2004
1996
  var O = [], j = q[E].length - 1, W = void 0;
2005
1997
  if (j) {
2006
- for (D = !1, r = r.slice(l[0].length - 1); j--; ) {
1998
+ for (D = !1, r = r.slice(a[0].length - 1); j--; ) {
2007
1999
  if (!(W = /^\{([^}]+)\}/.exec(r))) throw new Error(E + " is missing an argument");
2008
2000
  O.push(W[1]), r = r.slice(W[0].length);
2009
2001
  }
2010
- l[0] = /^\{/.exec(r) ? "{" : "", D = !!l[0];
2002
+ a[0] = /^\{/.exec(r) ? "{" : "", D = !!a[0];
2011
2003
  }
2012
2004
  D && m(), q[E].apply(b, [t].concat(O));
2013
- } else console.warn("unknown latex command", E), p(new M(l[1])), D && m();
2014
- } else l = [r.slice(0, 1)], p(new M(l[0]));
2005
+ } else console.warn("unknown latex command", E), p(new M(a[1])), D && m();
2006
+ } else a = [r.slice(0, 1)], p(new M(a[0]));
2015
2007
  }
2016
- r = r.slice(l[0].length);
2008
+ r = r.slice(a[0].length);
2017
2009
  }
2018
- return o;
2019
- }, G.measureText = function(r, i, l) {
2020
- return B(r, R(i), l);
2010
+ return s;
2011
+ }, G.measureText = function(r, i, a) {
2012
+ return B(r, R(i), a);
2021
2013
  }, G.Token = M, G.Break = lt, G.LineBreak = X, G.SoftHyphen = ut, G.Rotator = ie, ie.createElement = ae;
2022
- const Qe = G;
2014
+ const tr = G;
2023
2015
  return n.default;
2024
2016
  })());
2025
2017
  }(dr)), dr.exports;
2026
2018
  }
2027
- var Dn = On();
2028
- const Tr = /* @__PURE__ */ Ur(Dn);
2029
- function ir(u) {
2019
+ var Cn = Sn();
2020
+ const Tr = /* @__PURE__ */ Ur(Cn);
2021
+ function or(u) {
2030
2022
  return u.replace(/…$/, "");
2031
2023
  }
2032
2024
  function sr(u) {
2033
2025
  return u.children[0].innerHTML;
2034
2026
  }
2035
- function Pn(u, e) {
2036
- const s = mt(u), { fontSize: n, font: a, padding: c = 0 } = u.properties.style || {};
2037
- if (s.width === s.height && s.width === 0) return;
2038
- const f = new Tr({
2039
- font: `${n}px/${n}px ${a}`.replace(/(px)+/g, "px"),
2040
- width: s.width - c * 2,
2041
- height: s.height - c * 2,
2027
+ function Tn(u, e) {
2028
+ const o = mt(u), { fontSize: n, font: l, padding: h = 0 } = u.properties.style || {};
2029
+ if (o.width === o.height && o.width === 0) return;
2030
+ const d = new Tr({
2031
+ font: `${n}px/${n}px ${l}`.replace(/(px)+/g, "px"),
2032
+ width: o.width - h * 2,
2033
+ height: o.height - h * 2,
2042
2034
  align: "left",
2043
2035
  valign: "top",
2044
2036
  x: 0,
@@ -2046,49 +2038,49 @@ function Pn(u, e) {
2046
2038
  parser: "html",
2047
2039
  createElement: Tr.createElement
2048
2040
  });
2049
- f.overflowWrap("break-word");
2050
- const g = f.linebreak(
2041
+ d.overflowWrap("break-word");
2042
+ const g = d.linebreak(
2051
2043
  u.properties.content.replaceAll(`
2052
2044
  `, "<br>")
2053
- ).render(), d = [...g.children];
2045
+ ).render(), f = [...g.children];
2054
2046
  let v = 0;
2055
2047
  const y = [];
2056
2048
  u.properties.content.split(`
2057
2049
  `).forEach((S) => {
2058
2050
  let R = S;
2059
- for (; R.length && v < d.length; ) {
2060
- if (d[v].innerHTML === "&nbsp;") {
2051
+ for (; R.length && v < f.length; ) {
2052
+ if (f[v].innerHTML === "&nbsp;") {
2061
2053
  R.startsWith(`
2062
2054
  `) || y.push(v), v++;
2063
2055
  break;
2064
2056
  }
2065
- const C = ir(sr(d[v]));
2057
+ const C = or(sr(f[v]));
2066
2058
  R.startsWith(C) && (R = R.slice(C.length).trim()), v++;
2067
2059
  }
2068
- }), y.forEach((S) => g.removeChild(d[S]));
2069
- const A = u.properties.content.match(/(https?:\/\/.*)/gm), _ = A ? A.map((S) => S.split(" ")[0]) : [];
2070
- g.setAttribute("transform", `translate(${c}, ${c})`), _.forEach((S) => {
2060
+ }), y.forEach((S) => g.removeChild(f[S]));
2061
+ const A = u.properties.content.match(/(https?:\/\/.*)/gm), k = A ? A.map((S) => S.split(" ")[0]) : [];
2062
+ g.setAttribute("transform", `translate(${h}, ${h})`), k.forEach((S) => {
2071
2063
  let R = S;
2072
2064
  const C = [];
2073
2065
  for (; R.length > 0; ) {
2074
- const L = d.find(
2075
- (k) => !!k.children[0] && k.children[0].tagName === "tspan" && R.startsWith(ir(sr(k)))
2066
+ const L = f.find(
2067
+ (_) => !!_.children[0] && _.children[0].tagName === "tspan" && R.startsWith(or(sr(_)))
2076
2068
  );
2077
2069
  if (!L) break;
2078
2070
  C.push(L);
2079
- const I = ir(L.children[0].innerHTML).length;
2080
- if (!I) break;
2081
- R = R.slice(I);
2071
+ const $ = or(L.children[0].innerHTML).length;
2072
+ if (!$) break;
2073
+ R = R.slice($);
2082
2074
  }
2083
2075
  C.forEach((L) => {
2084
- const I = document.createElementNS("http://www.w3.org/2000/svg", "a");
2085
- I.setAttribute("href", S), I.setAttribute("target", "_blank"), I.innerHTML = sr(L), L.children[0].innerHTML = "", L.children[0].appendChild(I);
2076
+ const $ = document.createElementNS("http://www.w3.org/2000/svg", "a");
2077
+ $.setAttribute("href", S), $.setAttribute("target", "_blank"), $.innerHTML = sr(L), L.children[0].innerHTML = "", L.children[0].appendChild($);
2086
2078
  });
2087
2079
  }), e.appendChild(g);
2088
2080
  }
2089
2081
  const Rr = 20;
2090
- class Ln extends Vr {
2091
- constructor(e, s = {}) {
2082
+ class Rn extends Vr {
2083
+ constructor(e, o = {}) {
2092
2084
  super(
2093
2085
  e,
2094
2086
  `
@@ -2104,126 +2096,126 @@ class Ln extends Vr {
2104
2096
  <textarea wrap="on"></textarea>
2105
2097
  </div>
2106
2098
  `
2107
- ), x(this, "textArea"), x(this, "handleSize"), x(this, "rect", { x: 0, y: 0, width: 0, height: 0 }), x(this, "annotation", { ...nr }), x(this, "startX", 0), x(this, "startY", 0), x(this, "handles", []), x(this, "draggedHandle", V), x(this, "isFocused", !1), x(this, "placeholder", "Type your text here..."), x(this, "_onFocus", () => {
2099
+ ), x(this, "textArea"), x(this, "handleSize"), x(this, "rect", { x: 0, y: 0, width: 0, height: 0 }), x(this, "annotation", { ...ir }), x(this, "startX", 0), x(this, "startY", 0), x(this, "handles", []), x(this, "draggedHandle", V), x(this, "isFocused", !1), x(this, "placeholder", "Type your text here..."), x(this, "_onFocus", () => {
2108
2100
  this.textArea.value === this.placeholder && (this.textArea.value = ""), this.isFocused = !0;
2109
2101
  }), x(this, "_onBlur", () => {
2110
2102
  this.isFocused = !1;
2111
- }), x(this, "startDrawing", (a, c, f = Tn(a, c, 0, 0, "", Wt)) => {
2112
- this.add(f);
2113
- const g = this.ogma.view.graphToScreenCoordinates({ x: a, y: c });
2114
- this.select(f.id), this.startDragging(this.getById(f.id), g.x, g.y), this.draggedHandle = 6;
2103
+ }), x(this, "startDrawing", (l, h, d = kn(l, h, 0, 0, "", Wt)) => {
2104
+ this.add(d);
2105
+ const g = this.ogma.view.graphToScreenCoordinates({ x: l, y: h });
2106
+ this.select(d.id), this.startDragging(this.getById(d.id), g.x, g.y), this.draggedHandle = 6;
2115
2107
  }), x(this, "cancelDrawing", () => {
2116
- this.isDragging && (this.remove(this.annotation.id), this.annotation = { ...nr }, this.draggedHandle = V, this.isDragging = !1, this.emit(Ut, this.annotation));
2117
- }), x(this, "startDragging", (a, c, f) => {
2118
- this.annotation = a;
2119
- const g = vt(this.annotation), d = mt(this.annotation);
2120
- this.rect.x = g.x, this.rect.y = g.y, this.rect.width = d.width, this.rect.height = d.height, this.startX = c, this.startY = f, this.disableDragging(), this.textArea.classList.add("noevents"), this.textArea.setAttribute("disabled", "disabled"), this.emit(ze, this.annotation), this.isDragging = !0;
2121
- }), x(this, "onHandleMouseDown", (a) => {
2122
- const c = this.getById(this.selectedId) || this.getById(this.hoveredId);
2123
- if (!c) return;
2124
- this.selectedId !== c.id && this.select(this.hoveredId);
2125
- const { x: f, y: g } = or(a, this.ogma.getContainer());
2126
- this.startDragging(c, f, g), this.draggedHandle = Nr(a.target);
2127
- }), x(this, "onMouseMove", (a) => {
2128
- requestAnimationFrame(() => this._onMouseMove(a));
2129
- }), x(this, "_onMouseMove", (a) => {
2108
+ this.isDragging && (this.remove(this.annotation.id), this.annotation = { ...ir }, this.draggedHandle = V, this.isDragging = !1, this.emit(Ut, this.annotation));
2109
+ }), x(this, "startDragging", (l, h, d) => {
2110
+ this.annotation = l;
2111
+ const g = vt(this.annotation), f = mt(this.annotation);
2112
+ this.rect.x = g.x, this.rect.y = g.y, this.rect.width = f.width, this.rect.height = f.height, this.startX = h, this.startY = d, this.disableDragging(), this.textArea.classList.add("noevents"), this.textArea.setAttribute("disabled", "disabled"), this.emit(Ne, this.annotation), this.isDragging = !0;
2113
+ }), x(this, "onHandleMouseDown", (l) => {
2114
+ const h = this.getById(this.selectedId) || this.getById(this.hoveredId);
2115
+ if (!h) return;
2116
+ this.selectedId !== h.id && this.select(this.hoveredId);
2117
+ const { x: d, y: g } = Me(l, this.ogma.getContainer());
2118
+ this.startDragging(h, d, g), this.draggedHandle = Nr(l.target);
2119
+ }), x(this, "onMouseMove", (l) => {
2120
+ requestAnimationFrame(() => this._onMouseMove(l));
2121
+ }), x(this, "_onMouseMove", (l) => {
2130
2122
  if (!this.isDragging) return;
2131
- a.stopPropagation(), a.preventDefault();
2132
- const c = this.handles[this.draggedHandle];
2133
- let f = c.classList.contains("top");
2134
- const g = c.classList.contains("left"), d = c.classList.contains("right"), v = c.classList.contains("bottom");
2135
- let y = c.classList.contains("line-handle");
2136
- !y && !f && !v && !g && !d && (f = !0, y = !0);
2137
- const { x: A, y: _ } = or(
2138
- a,
2123
+ l.stopPropagation(), l.preventDefault();
2124
+ const h = this.handles[this.draggedHandle];
2125
+ let d = h.classList.contains("top");
2126
+ const g = h.classList.contains("left"), f = h.classList.contains("right"), v = h.classList.contains("bottom");
2127
+ let y = h.classList.contains("line-handle");
2128
+ !y && !d && !v && !g && !f && (d = !0, y = !0);
2129
+ const { x: A, y: k } = Me(
2130
+ l,
2139
2131
  this.ogma.getContainer()
2140
2132
  );
2141
2133
  let S = this.rect.x, R = this.rect.y, C = Math.max(this.rect.width, Rr), L = Math.max(this.rect.height, Rr);
2142
- const I = this.ogma.view.getZoom(), k = (A - this.startX) / I, z = (_ - this.startY) / I, B = this.ogma.view.getAngle(), tt = ot({ x: k, y: z }, B), rt = ot({ x: k, y: z }, -B);
2143
- y ? (S = this.rect.x + tt.x, R = this.rect.y + tt.y) : g && f ? (S += tt.x, R += tt.y, C -= k, L -= z) : d && v ? (C += k, L += z) : g && v ? (S += rt.x, C -= rt.x, L += rt.y) : d && f && (R += rt.y, C += rt.x, L -= rt.y), hn(this.annotation, S, R, C, L), this.emit(Me, this.annotation, "text"), this.refreshEditor(), this.layer.refresh();
2134
+ const $ = this.ogma.view.getZoom(), _ = (A - this.startX) / $, z = (k - this.startY) / $, B = this.ogma.view.getAngle(), tt = st({ x: _, y: z }, B), rt = st({ x: _, y: z }, -B);
2135
+ y ? (S = this.rect.x + tt.x, R = this.rect.y + tt.y) : g && d ? (S += tt.x, R += tt.y, C -= _, L -= z) : f && v ? (C += _, L += z) : g && v ? (S += rt.x, C -= rt.x, L += rt.y) : f && d && (R += rt.y, C += rt.x, L -= rt.y), hn(this.annotation, S, R, C, L), this.emit(ze, this.annotation, "text"), this.refreshEditor(), this.layer.refresh();
2144
2136
  }), x(this, "onMouseUp", () => {
2145
2137
  !this.isDragging || this.draggedHandle === V || (this.restoreDragging(), this.textArea.classList.remove("noevents"), this.textArea.removeAttribute("disabled"), this.emit(Ut, this.annotation), this.isDragging = !1, this.draggedHandle = V);
2146
- }), x(this, "_onMousedown", (a) => {
2147
- a.stopPropagation();
2138
+ }), x(this, "_onMousedown", (l) => {
2139
+ l.stopPropagation();
2148
2140
  }), x(this, "onViewChanged", () => {
2149
- const a = Math.max(2, this.handleSize / this.ogma.view.getZoom());
2150
- document.documentElement.style.setProperty("--handle-scale", `${1 / a}`), this.ogma.view.getAngle() === 0 ? this.editor.element.classList.remove("rotated") : this.editor.element.classList.add("rotated");
2141
+ const l = Math.max(2, this.handleSize / this.ogma.view.getZoom());
2142
+ document.documentElement.style.setProperty("--handle-scale", `${1 / l}`), this.ogma.view.getAngle() === 0 ? this.editor.element.classList.remove("rotated") : this.editor.element.classList.add("rotated");
2151
2143
  }), x(this, "_onInput", () => {
2152
- const a = this.getById(this.selectedId);
2153
- a && (this.textArea.value = this.textArea.value.replace(/ +(?= )/g, ""), this.textArea.focus(), a.properties.content = this.textArea.value, this.emit(cr, a), this.layer.refresh());
2144
+ const l = this.getById(this.selectedId);
2145
+ l && (this.textArea.value = this.textArea.value.replace(/ +(?= )/g, ""), this.textArea.focus(), l.properties.content = this.textArea.value, this.emit(cr, l), this.layer.refresh());
2154
2146
  }), this.showeditorOnHover = !1, this.handleSize = Sr.handleSize, this.placeholder = Sr.placeholder;
2155
2147
  const n = this.textArea = this.editor.element.querySelector("textarea");
2156
2148
  n.addEventListener("input", this._onInput), n.addEventListener("focus", this._onFocus), n.addEventListener("blur", this._onBlur), n.addEventListener("mousedown", this._onMousedown), n.spellcheck = !1, this.handles = Array.prototype.slice.call(
2157
2149
  this.editor.element.querySelectorAll(".annotation-text-handle > .handle")
2158
2150
  ), this.handles.push(this.editor.element), this.handles.forEach(
2159
- (a) => a.addEventListener("mousedown", this.onHandleMouseDown)
2151
+ (l) => l.addEventListener("mousedown", this.onHandleMouseDown)
2160
2152
  ), document.addEventListener("mouseup", this.onMouseUp), document.addEventListener("mousemove", this.onMouseMove, !0), e.events.on(["viewChanged", "zoom"], this.onViewChanged);
2161
2153
  }
2162
2154
  _canRemove() {
2163
2155
  return !this.isFocused;
2164
2156
  }
2165
- detect({ x: e, y: s }, n = 0) {
2166
- const a = { x: e, y: s }, c = this.ogma.view.getAngle();
2167
- return this.elements.find((f) => {
2168
- const { x: g, y: d } = vt(f), { width: v, height: y } = mt(f), A = { x: g, y: d }, { x: _, y: S } = ot(Ot(a, A), -c);
2169
- return _ > -n && _ < v + n && S > -n && S < y + n;
2157
+ detect({ x: e, y: o }, n = 0) {
2158
+ const l = { x: e, y: o }, h = this.ogma.view.getAngle();
2159
+ return this.elements.find((d) => {
2160
+ const { x: g, y: f } = vt(d), { width: v, height: y } = mt(d), A = { x: g, y: f }, { x: k, y: S } = st(Ot(l, A), -h);
2161
+ return k > -n && k < v + n && S > -n && S < y + n;
2170
2162
  });
2171
2163
  }
2172
2164
  draw(e) {
2173
2165
  e.innerHTML = "";
2174
- const s = "", n = this.ogma.view.getAngle();
2175
- for (let c = 0; c < this.elements.length; c++) {
2176
- const f = this.elements[c], g = `class${c}`, d = mt(f), v = vt(f);
2177
- if (f.id === this.selectedId) continue;
2166
+ const o = "", n = this.ogma.view.getAngle();
2167
+ for (let h = 0; h < this.elements.length; h++) {
2168
+ const d = this.elements[h], g = `class${h}`, f = mt(d), v = vt(d);
2169
+ if (d.id === this.selectedId) continue;
2178
2170
  const {
2179
2171
  color: y,
2180
2172
  fontSize: A,
2181
- font: _,
2173
+ font: k,
2182
2174
  strokeColor: S,
2183
2175
  strokeWidth: R,
2184
2176
  strokeType: C,
2185
2177
  background: L,
2186
- borderRadius: I
2187
- } = f.properties.style || Wt, k = Rt("g");
2188
- k.classList.add("annotation-text"), k.setAttribute("fill", `${y}`), k.setAttribute("font-size", `${A}px`), k.setAttribute("font-family", `${_}`);
2178
+ borderRadius: $
2179
+ } = d.properties.style || Wt, _ = Rt("g");
2180
+ _.classList.add("annotation-text"), _.setAttribute("fill", `${y}`), _.setAttribute("font-size", `${A}px`), _.setAttribute("font-family", `${k}`);
2189
2181
  const z = Rt("rect");
2190
- I && (z.setAttribute("rx", `${I}`), z.setAttribute("ry", `${I}`));
2182
+ $ && (z.setAttribute("rx", `${$}`), z.setAttribute("ry", `${$}`));
2191
2183
  let B = !1;
2192
- C && C !== "none" && (B = !0, z.setAttribute("stroke", S || "black"), z.setAttribute("stroke-width", `${R}`), C === "dashed" && z.setAttribute("stroke-dasharray", "5,5")), (L && L.length || B) && (B = !0, z.setAttribute("fill", L || "transparent")), B && (z.setAttribute("width", `${d.width}`), z.setAttribute("height", `${d.height}`)), k.appendChild(z), Pn(f, k);
2193
- const { x: tt, y: rt } = ot(v, -n);
2194
- k.setAttribute("transform", `translate(${tt},${rt})`), k.classList.add(g), k.setAttribute("data-annotation", `${f.id}`), k.setAttribute("data-annotation-type", "text"), e.appendChild(k);
2184
+ C && C !== "none" && (B = !0, z.setAttribute("stroke", S || "black"), z.setAttribute("stroke-width", `${R}`), C === "dashed" && z.setAttribute("stroke-dasharray", "5,5")), (L && L.length || B) && (B = !0, z.setAttribute("fill", L || "transparent")), B && (z.setAttribute("width", `${f.width}`), z.setAttribute("height", `${f.height}`)), _.appendChild(z), Tn(d, _);
2185
+ const { x: tt, y: rt } = st(v, -n);
2186
+ _.setAttribute("transform", `translate(${tt},${rt})`), _.classList.add(g), _.setAttribute("data-annotation", `${d.id}`), _.setAttribute("data-annotation-type", "text"), e.appendChild(_);
2195
2187
  }
2196
- const a = Rt("style");
2197
- a.innerHTML = s, e.firstChild && e.insertBefore(a, e.firstChild);
2188
+ const l = Rt("style");
2189
+ l.innerHTML = o, e.firstChild && e.insertBefore(l, e.firstChild);
2198
2190
  }
2199
2191
  refreshDrawing() {
2200
- const e = this.ogma.view.getAngle(), s = this.layer.element.children;
2201
- for (let n = 0; n < s.length; n++) {
2202
- const a = s[n];
2203
- if (!a.hasAttribute("data-annotation")) continue;
2204
- const c = a.getAttribute("data-annotation"), f = vt(this.getById(c)), { x: g, y: d } = ot(f, -e);
2205
- a.setAttribute("transform", `translate(${g},${d})`);
2192
+ const e = this.ogma.view.getAngle(), o = this.layer.element.children;
2193
+ for (let n = 0; n < o.length; n++) {
2194
+ const l = o[n];
2195
+ if (!l.hasAttribute("data-annotation")) continue;
2196
+ const h = l.getAttribute("data-annotation"), d = vt(this.getById(h)), { x: g, y: f } = st(d, -e);
2197
+ l.setAttribute("transform", `translate(${g},${f})`);
2206
2198
  }
2207
2199
  }
2208
2200
  getDefaultOptions() {
2209
- return nr;
2201
+ return ir;
2210
2202
  }
2211
2203
  refreshEditor() {
2212
2204
  if (+this.selectedId < 0 && +this.hoveredId < 0) return;
2213
- const e = this.getById(this.selectedId) || this.getById(this.hoveredId), s = mt(e), n = this.ogma.view.graphToScreenCoordinates(
2205
+ const e = this.getById(this.selectedId) || this.getById(this.hoveredId), o = mt(e), n = this.ogma.view.graphToScreenCoordinates(
2214
2206
  vt(e)
2215
- ), a = this.ogma.view.getZoom(), {
2216
- font: c,
2217
- fontSize: f,
2207
+ ), l = this.ogma.view.getZoom(), {
2208
+ font: h,
2209
+ fontSize: d,
2218
2210
  color: g,
2219
- background: d,
2211
+ background: f,
2220
2212
  padding: v = 0
2221
- } = e.properties.style || Wt, y = (f || 1) * a;
2213
+ } = e.properties.style || Wt, y = (d || 1) * l;
2222
2214
  this.textArea.value = e.properties.content;
2223
2215
  const A = this.editor.element.style;
2224
- A.transform = `translate(${n.x}px, ${n.y}px)translate(-50%, -50%)translate(${s.width / 2 * a}px, ${s.height / 2 * a}px)`, A.width = `${s.width * a}px`, A.height = `${s.height * a}px`;
2225
- const _ = this.textArea.style;
2226
- _.font = `${y} ${c}`, _.fontFamily = c || "sans-serif", _.fontSize = `${y}px`, _.padding = `${a * v}px`, _.lineHeight = `${y}px`, _.boxSizing = "border-box", _.color = g || "black", _.background = d || "transparent", this.textArea.placeholder = this.placeholder, this.layer.refresh();
2216
+ A.transform = `translate(${n.x}px, ${n.y}px)translate(-50%, -50%)translate(${o.width / 2 * l}px, ${o.height / 2 * l}px)`, A.width = `${o.width * l}px`, A.height = `${o.height * l}px`;
2217
+ const k = this.textArea.style;
2218
+ k.font = `${y} ${h}`, k.fontFamily = h || "sans-serif", k.fontSize = `${y}px`, k.padding = `${l * v}px`, k.lineHeight = `${y}px`, k.boxSizing = "border-box", k.color = g || "black", k.background = f || "transparent", this.textArea.placeholder = this.placeholder, this.layer.refresh();
2227
2219
  }
2228
2220
  select(e) {
2229
2221
  super.select(e), this.textArea.classList.add("noevents");
@@ -2232,59 +2224,59 @@ class Ln extends Vr {
2232
2224
  super.destroy(), document.removeEventListener("mouseup", this.onMouseUp), document.removeEventListener("mousemove", this.onMouseMove, !0), this.ogma.events.off(this.onViewChanged);
2233
2225
  }
2234
2226
  }
2235
- class $n {
2227
+ class On {
2236
2228
  constructor() {
2237
2229
  x(this, "links", {}), x(this, "linksByTargetId", {}), x(this, "linksByArrowId", {});
2238
2230
  }
2239
- add(e, s, n, a, c) {
2240
- const f = Ne(), g = e.id, d = {
2241
- id: f,
2231
+ add(e, o, n, l, h) {
2232
+ const d = He(), g = e.id, f = {
2233
+ id: d,
2242
2234
  arrow: g,
2243
2235
  target: n,
2244
- targetType: a,
2245
- connectionPoint: c,
2246
- side: s
2236
+ targetType: l,
2237
+ connectionPoint: h,
2238
+ side: o
2247
2239
  };
2248
- return this.links[f] = d, this.linksByTargetId[n] || (this.linksByTargetId[n] = []), this.linksByTargetId[n].push(f), this.linksByArrowId[g] || (this.linksByArrowId[g] = {}), this.linksByArrowId[g][s] = f, e.properties.link = e.properties.link || {}, e.properties.link[s] = {
2240
+ return this.links[d] = f, this.linksByTargetId[n] || (this.linksByTargetId[n] = []), this.linksByTargetId[n].push(d), this.linksByArrowId[g] || (this.linksByArrowId[g] = {}), this.linksByArrowId[g][o] = d, e.properties.link = e.properties.link || {}, e.properties.link[o] = {
2249
2241
  id: n,
2250
- side: s,
2251
- type: a,
2252
- magnet: c
2242
+ side: o,
2243
+ type: l,
2244
+ magnet: h
2253
2245
  }, this;
2254
2246
  }
2255
- arrowIsLinked(e, s) {
2247
+ arrowIsLinked(e, o) {
2256
2248
  var n;
2257
- return !!((n = this.linksByArrowId[e]) != null && n[s]);
2249
+ return !!((n = this.linksByArrowId[e]) != null && n[o]);
2258
2250
  }
2259
2251
  // remove the link between the arrow and the target by arrow id and side
2260
- remove(e, s) {
2261
- var n, a;
2262
- const c = e.id, f = (n = this.linksByArrowId[c]) == null ? void 0 : n[s];
2263
- if ((a = e.properties.link) == null || delete a[s], !f) return this;
2264
- const g = this.links[f];
2265
- delete this.links[f];
2266
- const d = this.linksByTargetId[g.target];
2267
- for (let v = 0; v < d.length; v++)
2268
- if (d[v] === f) {
2269
- d.splice(v, 1);
2252
+ remove(e, o) {
2253
+ var n, l;
2254
+ const h = e.id, d = (n = this.linksByArrowId[h]) == null ? void 0 : n[o];
2255
+ if ((l = e.properties.link) == null || delete l[o], !d) return this;
2256
+ const g = this.links[d];
2257
+ delete this.links[d];
2258
+ const f = this.linksByTargetId[g.target];
2259
+ for (let v = 0; v < f.length; v++)
2260
+ if (f[v] === d) {
2261
+ f.splice(v, 1);
2270
2262
  break;
2271
2263
  }
2272
- return delete this.linksByArrowId[c][s], this;
2264
+ return delete this.linksByArrowId[h][o], this;
2273
2265
  }
2274
- getArrowLink(e, s) {
2266
+ getArrowLink(e, o) {
2275
2267
  var n;
2276
- const a = (n = this.linksByArrowId[e]) == null ? void 0 : n[s];
2277
- return a ? this.links[a] : null;
2268
+ const l = (n = this.linksByArrowId[e]) == null ? void 0 : n[o];
2269
+ return l ? this.links[l] : null;
2278
2270
  }
2279
- getTargetLinks(e, s) {
2271
+ getTargetLinks(e, o) {
2280
2272
  var n;
2281
- return ((n = this.linksByTargetId[e]) == null ? void 0 : n.map((a) => this.links[a]).filter((a) => a.targetType === s)) ?? [];
2273
+ return ((n = this.linksByTargetId[e]) == null ? void 0 : n.map((l) => this.links[l]).filter((l) => l.targetType === o)) ?? [];
2282
2274
  }
2283
2275
  forEach(e) {
2284
2276
  Object.values(this.links).forEach(e);
2285
2277
  }
2286
2278
  }
2287
- const at = (u) => u.properties.type === "arrow", yt = (u) => u.properties.type === "text", Or = (u) => u.type === "FeatureCollection", In = {
2279
+ const at = (u) => u.properties.type === "arrow", yt = (u) => u.properties.type === "text", Or = (u) => u.type === "FeatureCollection", Dn = {
2288
2280
  magnetColor: "#3e8",
2289
2281
  detectMargin: 20,
2290
2282
  magnetHandleRadius: 5,
@@ -2304,57 +2296,57 @@ const at = (u) => u.properties.type === "arrow", yt = (u) => u.properties.type =
2304
2296
  { x: 0.5, y: 1 },
2305
2297
  { x: 1, y: 1 }
2306
2298
  ];
2307
- class jn extends Yr {
2308
- constructor(e, s = {}) {
2309
- super(), x(this, "arrows"), x(this, "texts"), x(this, "links", new $n()), x(this, "layer"), x(this, "annotations"), x(this, "ogma"), x(this, "options"), x(this, "selected", null), x(this, "updateTimeout", 0), x(this, "hoveredNode", null), x(this, "dragged", null), x(this, "textToMagnet"), x(this, "activeLinks", []), x(this, "_render", (n) => {
2299
+ class Pn extends Yr {
2300
+ constructor(e, o = {}) {
2301
+ super(), x(this, "arrows"), x(this, "texts"), x(this, "links", new On()), x(this, "layer"), x(this, "annotations"), x(this, "ogma"), x(this, "options"), x(this, "selected", null), x(this, "updateTimeout", 0), x(this, "hoveredNode", null), x(this, "dragged", null), x(this, "textToMagnet"), x(this, "activeLinks", []), x(this, "_render", (n) => {
2310
2302
  if (!this.dragged || this.textToMagnet === void 0) return;
2311
2303
  n.beginPath(), n.fillStyle = "green";
2312
- const a = this.ogma.view.getZoom();
2313
- Pr.forEach((c) => {
2304
+ const l = this.ogma.view.getZoom();
2305
+ Pr.forEach((h) => {
2314
2306
  if (!this.textToMagnet) return;
2315
- const f = mt(this.textToMagnet), g = vt(this.textToMagnet), d = Ie(c, { x: f.width, y: f.height }), v = ot(d, this.ogma.view.getAngle()), { x: y, y: A } = Bt(v, g);
2316
- n.moveTo(y, A), n.arc(y, A, this.options.magnetHandleRadius / a, 0, Math.PI * 2);
2307
+ const d = mt(this.textToMagnet), g = vt(this.textToMagnet), f = $e(h, { x: d.width, y: d.height }), v = st(f, this.ogma.view.getAngle()), { x: y, y: A } = Bt(v, g);
2308
+ n.moveTo(y, A), n.arc(y, A, this.options.magnetHandleRadius / l, 0, Math.PI * 2);
2317
2309
  }), n.fill(), n.closePath();
2318
- }), x(this, "_onFeatureDrag", (n, a) => {
2319
- const c = a;
2320
- if (at(n) && c === "line")
2321
- ["start", "end"].find((f) => {
2322
- const g = f === "start" ? de(n) : je(n);
2323
- return this._snapToText(n, c, g) || this._findAndSnapToNode(n, f, g);
2310
+ }), x(this, "_onFeatureDrag", (n, l) => {
2311
+ const h = l;
2312
+ if (at(n) && h === "line")
2313
+ ["start", "end"].find((d) => {
2314
+ const g = d === "start" ? de(n) : je(n);
2315
+ return this._snapToText(n, h, g) || this._findAndSnapToNode(n, d, g);
2324
2316
  });
2325
- else if (at(n) && c !== "line") {
2326
- const f = c === "start" ? de(n) : je(n);
2327
- this._snapToText(n, c, f) || this._findAndSnapToNode(n, c, f);
2328
- } else yt(n) && (this.activeLinks.forEach(({ arrow: f, side: g, connectionPoint: d }) => {
2329
- const v = this.getAnnotation(f), y = mt(n), A = vt(n), _ = Ie(d, { x: y.width, y: y.height }), S = ot(_, this.ogma.view.getAngle()), R = Bt(S, A);
2317
+ else if (at(n) && h !== "line") {
2318
+ const d = h === "start" ? de(n) : je(n);
2319
+ this._snapToText(n, h, d) || this._findAndSnapToNode(n, h, d);
2320
+ } else yt(n) && (this.activeLinks.forEach(({ arrow: d, side: g, connectionPoint: f }) => {
2321
+ const v = this.getAnnotation(d), y = mt(n), A = vt(n), k = $e(f, { x: y.width, y: y.height }), S = st(k, this.ogma.view.getAngle()), R = Bt(S, A);
2330
2322
  v.geometry.coordinates[g === "start" ? 0 : 1] = [R.x, R.y];
2331
2323
  }), this.activeLinks.length && this.arrows.refreshLayer());
2332
- this.layer.refresh(), this.emit(Me, n, a);
2324
+ this.layer.refresh(), this.emit(ze, n, l);
2333
2325
  }), x(this, "_onFeatureDragEnd", (n) => {
2334
- this.dragged !== null && at(n) && de(this.dragged) && Dr.forEach((a) => {
2335
- this.links.getArrowLink(n.id, a) && this.emit(kn, {
2326
+ this.dragged !== null && at(n) && de(this.dragged) && Dr.forEach((l) => {
2327
+ this.links.getArrowLink(n.id, l) && this.emit(wn, {
2336
2328
  arrow: n,
2337
- link: this.links.getArrowLink(n.id, a)
2329
+ link: this.links.getArrowLink(n.id, l)
2338
2330
  });
2339
- }), (yt(n) || at(n)) && this.onUpdate(n), this.dragged = null, this.activeLinks = [], this.textToMagnet = void 0, this.annotations.forEach((a) => a.enableDetection()), this.layer.refresh(), this.emit(Ut, n);
2331
+ }), (yt(n) || at(n)) && this.onUpdate(n), this.dragged = null, this.activeLinks = [], this.textToMagnet = void 0, this.annotations.forEach((l) => l.enableDetection()), this.layer.refresh(), this.emit(Ut, n);
2340
2332
  }), x(this, "_onFeatureDragStart", (n) => {
2341
- this.textToMagnet = void 0, at(n) ? this.dragged = n : yt(n) && this.activeLinks.push(...this.links.getTargetLinks(n.id, "text")), this.annotations.forEach((a) => {
2342
- const c = a.getSelectedFeature();
2343
- c && c !== n && a.unhover().unselect(), a.disableDetection();
2344
- }), this.emit(ze, n);
2333
+ this.textToMagnet = void 0, at(n) ? this.dragged = n : yt(n) && this.activeLinks.push(...this.links.getTargetLinks(n.id, "text")), this.annotations.forEach((l) => {
2334
+ const h = l.getSelectedFeature();
2335
+ h && h !== n && l.unhover().unselect(), l.disableDetection();
2336
+ }), this.emit(Ne, n);
2345
2337
  }), x(this, "_onNodesDragStart", () => {
2346
2338
  this.arrows.unhover().unselect(), this.texts.unhover().unselect();
2347
2339
  }), x(this, "_onNodesDrag", (n) => {
2348
- const { dx: a, dy: c } = n;
2349
- this._moveNodes(n.nodes, a, c);
2340
+ const { dx: l, dy: h } = n;
2341
+ this._moveNodes(n.nodes, l, h);
2350
2342
  }), x(this, "_onLayoutEnd", (n) => {
2351
- n.ids.forEach((a, c) => {
2352
- this.links.getTargetLinks(a, "node").forEach((f) => {
2353
- const g = this.getAnnotation(f.arrow), d = f.side, v = Le(
2343
+ n.ids.forEach((l, h) => {
2344
+ this.links.getTargetLinks(l, "node").forEach((d) => {
2345
+ const g = this.getAnnotation(d.arrow), f = d.side, v = Le(
2354
2346
  g,
2355
- d === "start" ? "end" : "start"
2356
- ), y = n.positions.current[c], A = this.ogma.getNode(a).getAttribute("radius"), _ = $e(v, y, +A);
2357
- Ht(g, d, _.x, _.y);
2347
+ f === "start" ? "end" : "start"
2348
+ ), y = n.positions.current[h], A = this.ogma.getNode(l).getAttribute("radius"), k = Ie(v, y, +A);
2349
+ Ht(g, f, k.x, k.y);
2358
2350
  });
2359
2351
  }), this.arrows.refreshLayer(), this.texts.refreshLayer();
2360
2352
  }), x(this, "_onAdded", (n) => {
@@ -2371,57 +2363,57 @@ class jn extends Yr {
2371
2363
  );
2372
2364
  }), x(this, "_onUpdate", (n) => {
2373
2365
  this.emit(cr, n);
2374
- }), this.options = this.setOptions({ ...In, ...s }), this.ogma = e, this.arrows = new Cn(e, this.options), this.texts = new Ln(e, this.options), this.annotations = [this.arrows, this.texts], this.annotations.forEach((n) => {
2375
- n.on(ze, this._onFeatureDragStart).on(Me, this._onFeatureDrag).on(Ut, this._onFeatureDragEnd).on(cr, this.onUpdate).on(lr, this._onUnselect).on(ar, this._onSelect).on(hr, this._onAdded).on(ur, this._onRemoved);
2366
+ }), this.options = this.setOptions({ ...Dn, ...o }), this.ogma = e, this.arrows = new An(e, this.options), this.texts = new Rn(e, this.options), this.annotations = [this.arrows, this.texts], this.annotations.forEach((n) => {
2367
+ n.on(Ne, this._onFeatureDragStart).on(ze, this._onFeatureDrag).on(Ut, this._onFeatureDragEnd).on(cr, this.onUpdate).on(lr, this._onUnselect).on(ar, this._onSelect).on(hr, this._onAdded).on(ur, this._onRemoved);
2376
2368
  }), this.ogma.events.on("nodesDragStart", this._onNodesDragStart).on("nodesDragProgress", this._onNodesDrag).on("layoutEnd", this._onLayoutEnd).on(["viewChanged", "rotate"], () => {
2377
2369
  this.refreshTextLinks();
2378
2370
  }), this.layer = e.layers.addCanvasLayer(this._render), this.layer.moveToBottom();
2379
2371
  }
2380
- _moveNodes(e, s, n) {
2381
- e.forEach((a) => {
2382
- const c = this.links.getTargetLinks(a.getId(), "node"), f = a.getPosition();
2383
- c.forEach((g) => {
2384
- const d = this.getAnnotation(g.arrow), v = g.side, y = Le(
2385
- d,
2372
+ _moveNodes(e, o, n) {
2373
+ e.forEach((l) => {
2374
+ const h = this.links.getTargetLinks(l.getId(), "node"), d = l.getPosition();
2375
+ h.forEach((g) => {
2376
+ const f = this.getAnnotation(g.arrow), v = g.side, y = Le(
2377
+ f,
2386
2378
  v === "start" ? "end" : "start"
2387
2379
  );
2388
- let A = f;
2389
- const _ = +a.getAttribute("radius"), S = 1e-6;
2390
- (g.connectionPoint.x - (f.x - s) > S || g.connectionPoint.y - (f.y - n) > S) && (A = $e(y, f, _)), Ht(d, v, A.x, A.y);
2380
+ let A = d;
2381
+ const k = +l.getAttribute("radius"), S = 1e-6;
2382
+ (g.connectionPoint.x - (d.x - o) > S || g.connectionPoint.y - (d.y - n) > S) && (A = Ie(y, d, k)), Ht(f, v, A.x, A.y);
2391
2383
  });
2392
2384
  }), this.arrows.refreshLayer();
2393
2385
  }
2394
- _snapToText(e, s, n) {
2395
- const a = this.texts.detect(n, this.options.detectMargin);
2396
- if (this.links.remove(e, s), !a) return !1;
2397
- this.textToMagnet = a;
2398
- const c = this.findMagnetPoint(Pr, a, n);
2399
- return c ? (Ht(e, s, c.point.x, c.point.y), this.links.add(e, s, a.id, "text", c.magnet), !0) : !1;
2386
+ _snapToText(e, o, n) {
2387
+ const l = this.texts.detect(n, this.options.detectMargin);
2388
+ if (this.links.remove(e, o), !l) return !1;
2389
+ this.textToMagnet = l;
2390
+ const h = this.findMagnetPoint(Pr, l, n);
2391
+ return h ? (Ht(e, o, h.point.x, h.point.y), this.links.add(e, o, l.id, "text", h.magnet), !0) : !1;
2400
2392
  }
2401
- _findAndSnapToNode(e, s, n) {
2402
- var a, c;
2403
- const f = this.ogma.view.graphToScreenCoordinates(n), g = this.ogma.view.getElementAt(f);
2404
- this.links.remove(e, s), g && g.isNode ? ((a = this.hoveredNode) == null || a.setSelected(!1), this.hoveredNode = g, g.setSelected(!0), this._snapToNode(e, s, g, f)) : ((c = this.hoveredNode) == null || c.setSelected(!1), this.hoveredNode = null);
2393
+ _findAndSnapToNode(e, o, n) {
2394
+ var l, h;
2395
+ const d = this.ogma.view.graphToScreenCoordinates(n), g = this.ogma.view.getElementAt(d);
2396
+ this.links.remove(e, o), g && g.isNode ? ((l = this.hoveredNode) == null || l.setSelected(!1), this.hoveredNode = g, g.setSelected(!0), this._snapToNode(e, o, g, d)) : ((h = this.hoveredNode) == null || h.setSelected(!1), this.hoveredNode = null);
2405
2397
  }
2406
- _snapToNode(e, s, n, a) {
2407
- const c = n.getPositionOnScreen(), f = +n.getAttribute("radius"), g = f * this.ogma.view.getZoom(), d = a.x - c.x, v = a.y - c.y, y = Math.sqrt(d * d + v * v), A = n.getPosition();
2398
+ _snapToNode(e, o, n, l) {
2399
+ const h = n.getPositionOnScreen(), d = +n.getAttribute("radius"), g = d * this.ogma.view.getZoom(), f = l.x - h.x, v = l.y - h.y, y = Math.sqrt(f * f + v * v), A = n.getPosition();
2408
2400
  if (y < g + this.options.detectMargin) {
2409
- let _ = A;
2401
+ let k = A;
2410
2402
  if (y > g / 2) {
2411
- const S = Le(e, s === "end" ? "start" : "end");
2412
- _ = $e(S, _, f);
2403
+ const S = Le(e, o === "end" ? "start" : "end");
2404
+ k = Ie(S, k, d);
2413
2405
  }
2414
- Ht(e, s, _.x, _.y), this.links.add(e, s, n.getId(), "node", _);
2406
+ Ht(e, o, k.x, k.y), this.links.add(e, o, n.getId(), "node", k);
2415
2407
  }
2416
2408
  }
2417
2409
  refreshTextLinks() {
2418
2410
  let e = !1;
2419
2411
  this.links.forEach(
2420
- ({ connectionPoint: s, targetType: n, target: a, arrow: c, side: f }) => {
2412
+ ({ connectionPoint: o, targetType: n, target: l, arrow: h, side: d }) => {
2421
2413
  if (n !== "text") return;
2422
2414
  e = !0;
2423
- const g = this.getAnnotation(a), d = this.getAnnotation(c), v = mt(g), y = vt(g), A = Ie(s, { x: v.width, y: v.height }), _ = ot(A, this.ogma.view.getAngle()), S = Bt(_, y);
2424
- Ht(d, f, S.x, S.y);
2415
+ const g = this.getAnnotation(l), f = this.getAnnotation(h), v = mt(g), y = vt(g), A = $e(o, { x: v.width, y: v.height }), k = st(A, this.ogma.view.getAngle()), S = Bt(k, y);
2416
+ Ht(f, d, S.x, S.y);
2425
2417
  }
2426
2418
  ), e && this.arrows.refreshLayer();
2427
2419
  }
@@ -2431,24 +2423,24 @@ class jn extends Yr {
2431
2423
  getSelected() {
2432
2424
  return this.selected;
2433
2425
  }
2434
- findMagnetPoint(e, s, n) {
2435
- let a;
2436
- for (const c of e) {
2437
- const f = mt(s), g = vt(s), d = Ie(c, { x: f.width, y: f.height }), v = ot(d, this.ogma.view.getAngle()), y = Bt(v, g), A = qt(Ot(y, n)), _ = Math.min(
2426
+ findMagnetPoint(e, o, n) {
2427
+ let l;
2428
+ for (const h of e) {
2429
+ const d = mt(o), g = vt(o), f = $e(h, { x: d.width, y: d.height }), v = st(f, this.ogma.view.getAngle()), y = Bt(v, g), A = qt(Ot(y, n)), k = Math.min(
2438
2430
  this.options.magnetRadius * this.ogma.view.getZoom(),
2439
2431
  // when really zoomed in: avoid to snap on too far away magnets
2440
- f.width / 2,
2441
- f.height / 2
2432
+ d.width / 2,
2433
+ d.height / 2
2442
2434
  );
2443
- if (A < Math.max(_, this.options.magnetHandleRadius)) {
2444
- a = {
2435
+ if (A < Math.max(k, this.options.magnetHandleRadius)) {
2436
+ l = {
2445
2437
  point: y,
2446
- magnet: c
2438
+ magnet: h
2447
2439
  };
2448
2440
  break;
2449
2441
  }
2450
2442
  }
2451
- return a;
2443
+ return l;
2452
2444
  }
2453
2445
  /**
2454
2446
  * Set the options for the controller
@@ -2466,8 +2458,8 @@ class jn extends Yr {
2466
2458
  * @param id the id of the annotation to select
2467
2459
  */
2468
2460
  select(e) {
2469
- const s = this.getAnnotations().features.find((n) => n.id === e);
2470
- return s ? (at(s) ? this.arrows.select(s.id) : yt(s) && this.texts.select(s.id), this) : this;
2461
+ const o = this.getAnnotations().features.find((n) => n.id === e);
2462
+ return o ? (at(o) ? this.arrows.select(o.id) : yt(o) && this.texts.select(o.id), this) : this;
2471
2463
  }
2472
2464
  /**
2473
2465
  * Unselects the currently selected annotation
@@ -2481,11 +2473,11 @@ class jn extends Yr {
2481
2473
  */
2482
2474
  add(e) {
2483
2475
  if (Or(e)) {
2484
- const [s, n] = e.features.reduce(
2485
- (a, c) => (at(c) ? a[1].push(c) : yt(c) && a[0].push(c), a),
2476
+ const [o, n] = e.features.reduce(
2477
+ (l, h) => (at(h) ? l[1].push(h) : yt(h) && l[0].push(h), l),
2486
2478
  [[], []]
2487
2479
  );
2488
- return s.forEach((a) => this.add(a)), n.forEach((a) => this.add(a)), this.arrows.refreshLayer(), this;
2480
+ return o.forEach((l) => this.add(l)), n.forEach((l) => this.add(l)), this.arrows.refreshLayer(), this;
2489
2481
  }
2490
2482
  switch (e.properties.type) {
2491
2483
  case "text":
@@ -2504,26 +2496,26 @@ class jn extends Yr {
2504
2496
  */
2505
2497
  remove(e) {
2506
2498
  return Or(e) ? (e.features.forEach(
2507
- (s) => this.remove(s)
2499
+ (o) => this.remove(o)
2508
2500
  ), this) : (at(e) ? (this.links.remove(e, "start"), this.links.remove(e, "end"), this.arrows.remove(e.id)) : this.texts.remove(e.id), this);
2509
2501
  }
2510
2502
  loadLink(e) {
2511
2503
  if (e.properties.link)
2512
- for (const s of Dr) {
2513
- const n = e.properties.link[s];
2504
+ for (const o of Dr) {
2505
+ const n = e.properties.link[o];
2514
2506
  if (!n) continue;
2515
- const a = this.getAnnotation(n.id);
2516
- if (n.type === "text" && a)
2517
- this.links.add(e, s, n.id, n.type, n.magnet);
2507
+ const l = this.getAnnotation(n.id);
2508
+ if (n.type === "text" && l)
2509
+ this.links.add(e, o, n.id, n.type, n.magnet);
2518
2510
  else if (n.type === "node") {
2519
- const c = this.ogma.getNode(n.id);
2520
- if (!c) continue;
2521
- this.links.add(e, s, n.id, n.type, n.magnet);
2522
- const f = c.getPosition(), g = c.getAttribute("radius") || 0, d = Le(
2511
+ const h = this.ogma.getNode(n.id);
2512
+ if (!h) continue;
2513
+ this.links.add(e, o, n.id, n.type, n.magnet);
2514
+ const d = h.getPosition(), g = h.getAttribute("radius") || 0, f = Le(
2523
2515
  e,
2524
- s === "start" ? "end" : "start"
2525
- ), v = $e(d, f, +g);
2526
- Ht(e, s, v.x, v.y);
2516
+ o === "start" ? "end" : "start"
2517
+ ), v = Ie(f, d, +g);
2518
+ Ht(e, o, v.x, v.y);
2527
2519
  }
2528
2520
  }
2529
2521
  }
@@ -2533,8 +2525,8 @@ class jn extends Yr {
2533
2525
  * @param y coord of the first point
2534
2526
  * @param arrow The arrow to add
2535
2527
  */
2536
- startArrow(e, s, n) {
2537
- this.cancelDrawing(), this.arrows.startDrawing(e, s, n);
2528
+ startArrow(e, o, n) {
2529
+ this.cancelDrawing(), this.arrows.startDrawing(e, o, n);
2538
2530
  }
2539
2531
  /**
2540
2532
  * Start adding a text (add it, and give control to the user)
@@ -2542,30 +2534,29 @@ class jn extends Yr {
2542
2534
  * @param y coord of the top left point
2543
2535
  * @param text The text to add
2544
2536
  */
2545
- startText(e, s, n) {
2546
- this.cancelDrawing(), this.texts.startDrawing(e, s, n);
2537
+ startText(e, o, n) {
2538
+ this.cancelDrawing(), this.texts.startDrawing(e, o, n);
2547
2539
  }
2548
2540
  /**
2549
2541
  * Cancel drawing on the current frame
2550
2542
  */
2551
2543
  cancelDrawing() {
2552
- this.annotations.forEach((e) => e.cancelDrawing()), this.emit(An);
2544
+ this.annotations.forEach((e) => e.cancelDrawing()), this.emit(bn);
2553
2545
  }
2554
2546
  /**
2555
2547
  * Update the style of the annotation with the given id
2556
2548
  * @param id The id of the annotation to update
2557
2549
  * @param style The new style
2558
2550
  */
2559
- updateStyle(e, s) {
2560
- const n = this.getAnnotations().features.find((a) => a.id === e);
2561
- return n ? (at(n) ? this.arrows.updateStyle(n, s) : yt(n) && this.texts.updateStyle(n, s), this.onUpdate(n), this) : this;
2551
+ updateStyle(e, o) {
2552
+ const n = this.getAnnotations().features.find((l) => l.id === e);
2553
+ return n ? (at(n) ? this.arrows.updateStyle(n, o) : yt(n) && this.texts.updateStyle(n, o), this.onUpdate(n), this) : this;
2562
2554
  }
2563
- setScale(e, s, n, a) {
2564
- const c = this.getAnnotations().features.find((f) => f.id === e);
2565
- return c ? (at(c) ? this.arrows.scale(c, s, n, a) : yt(c) && this.texts.scale(c, s, n, a), this.onUpdate(c), this) : this;
2555
+ setScale(e, o, n, l) {
2556
+ const h = this.getAnnotations().features.find((d) => d.id === e);
2557
+ return h ? (at(h) ? this.arrows.scale(h, o, n, l) : yt(h) && this.texts.scale(h, o, n, l), this.onUpdate(h), this) : this;
2566
2558
  }
2567
2559
  /**
2568
- *
2569
2560
  * @returns the annotations in the controller
2570
2561
  */
2571
2562
  getAnnotations() {
@@ -2573,8 +2564,8 @@ class jn extends Yr {
2573
2564
  type: "FeatureCollection",
2574
2565
  features: []
2575
2566
  };
2576
- return this.annotations.forEach((s) => {
2577
- e.features = [...e.features, ...s.getElements()];
2567
+ return this.annotations.forEach((o) => {
2568
+ e.features = [...e.features, ...o.getElements()];
2578
2569
  }), e;
2579
2570
  }
2580
2571
  /**
@@ -2583,7 +2574,7 @@ class jn extends Yr {
2583
2574
  * @returns The annotation with the given id
2584
2575
  */
2585
2576
  getAnnotation(e) {
2586
- return this.getAnnotations().features.find((s) => s.id === e);
2577
+ return this.getAnnotations().features.find((o) => o.id === e);
2587
2578
  }
2588
2579
  /**
2589
2580
  * Destroy the controller and its elements
@@ -2592,7 +2583,7 @@ class jn extends Yr {
2592
2583
  this.annotations.forEach((e) => e.destroy()), this.layer.destroy();
2593
2584
  }
2594
2585
  }
2595
- const Lr = [8, 10, 12, 14, 16, 24, 32, 48, 64, 72], $r = "none", Xr = "#333333", Wn = [
2586
+ const Lr = [8, 10, 12, 14, 16, 24, 32, 48, 64, 72], Ir = "none", Xr = "#333333", Nn = [
2596
2587
  "#FFFFFF",
2597
2588
  "#F44E3B",
2598
2589
  "#FE9200",
@@ -2605,7 +2596,7 @@ const Lr = [8, 10, 12, 14, 16, 24, 32, 48, 64, 72], $r = "none", Xr = "#333333",
2605
2596
  "#333333",
2606
2597
  "#808080",
2607
2598
  "#cccccc"
2608
- ], Un = [
2599
+ ], Hn = [
2609
2600
  "Roboto",
2610
2601
  "Helvetica Neue",
2611
2602
  "Helvetica",
@@ -2617,33 +2608,33 @@ const Lr = [8, 10, 12, 14, 16, 24, 32, 48, 64, 72], $r = "none", Xr = "#333333",
2617
2608
  "Consolas",
2618
2609
  "Courier New",
2619
2610
  "monospace"
2620
- ].sort((u, e) => u.toLocaleLowerCase().localeCompare(e.toLocaleLowerCase())), Fn = {
2611
+ ].sort((u, e) => u.toLocaleLowerCase().localeCompare(e.toLocaleLowerCase())), Ln = {
2621
2612
  head: "arrow",
2622
2613
  strokeColor: Xr,
2623
2614
  strokeWidth: 5
2624
- }, Mn = 0.25, zn = {
2615
+ }, In = 0.25, $n = {
2625
2616
  font: "Roboto",
2626
2617
  fontSize: Lr[2],
2627
- padding: Lr[2] * Mn,
2618
+ padding: Lr[2] * In,
2628
2619
  color: Xr,
2629
- strokeType: $r,
2630
- background: $r
2620
+ strokeType: Ir,
2621
+ background: Ir
2631
2622
  };
2632
- function Nn(u) {
2633
- return u.reduce((e, s) => e + s, 0) / u.length;
2623
+ function jn(u) {
2624
+ return u.reduce((e, o) => e + o, 0) / u.length;
2634
2625
  }
2635
- function Yn(u, e = 0, s = 1) {
2636
- return e + (s - e) * u;
2626
+ function Bn(u, e = 0, o = 1) {
2627
+ return e + (o - e) * u;
2637
2628
  }
2638
- function Vn(u, e = 0, s = 1) {
2639
- return (u - e) / (s - e);
2629
+ function qn(u, e = 0, o = 1) {
2630
+ return (u - e) / (o - e);
2640
2631
  }
2641
- function Xn() {
2632
+ function Wn() {
2642
2633
  return jr(null);
2643
2634
  }
2644
2635
  const Gr = jr(
2645
2636
  void 0
2646
- ), Gn = () => Kr(Gr), Hn = (u, e) => {
2637
+ ), Un = () => Kr(Gr), Fn = (u, e) => {
2647
2638
  switch (e.type) {
2648
2639
  case "add":
2649
2640
  return {
@@ -2653,59 +2644,59 @@ const Gr = jr(
2653
2644
  case "remove":
2654
2645
  return {
2655
2646
  ...u,
2656
- features: u.features.filter((s) => s.id !== e.payload.id)
2647
+ features: u.features.filter((o) => o.id !== e.payload.id)
2657
2648
  };
2658
2649
  case "update":
2659
2650
  return {
2660
2651
  ...u,
2661
2652
  features: u.features.map(
2662
- (s) => s.id === e.payload.id ? e.payload : s
2653
+ (o) => o.id === e.payload.id ? e.payload : o
2663
2654
  )
2664
2655
  };
2665
2656
  default:
2666
2657
  return u;
2667
2658
  }
2668
- }, Jn = ({ children: u }) => {
2669
- const e = Qr(), [s, n] = Zr(Hn, {
2659
+ }, Yn = ({ children: u }) => {
2660
+ const e = Qr(), [o, n] = Zr(Fn, {
2670
2661
  type: "FeatureCollection",
2671
2662
  features: []
2672
- }), [a, c] = Nt(null), [f, g] = Nt(Fn), [d, v] = Nt(zn), [y, A] = Nt(), [_, S] = Nt(1), [R, C] = Nt(1);
2673
- return rr(() => {
2663
+ }), [l, h] = Nt(null), [d, g] = Nt(Ln), [f, v] = Nt($n), [y, A] = Nt(), [k, S] = Nt(1), [R, C] = Nt(1);
2664
+ return nr(() => {
2674
2665
  if (!e) return;
2675
- const L = new jn(e, {
2666
+ const L = new Pn(e, {
2676
2667
  minArrowHeight: 1
2677
- }), I = Nn(e.getNodes().getAttribute("radius")) / 5, k = _;
2668
+ }), $ = jn(e.getNodes().getAttribute("radius")) / 5, _ = k;
2678
2669
  return g({
2679
- ...f,
2680
- strokeWidth: (f.strokeWidth || 1) * k
2681
- }), S(k), C(I), L.on("select", (z) => {
2670
+ ...d,
2671
+ strokeWidth: (d.strokeWidth || 1) * _
2672
+ }), S(_), C($), L.on("select", (z) => {
2682
2673
  at(z) ? g({
2683
2674
  ...z.properties.style || {}
2684
2675
  }) : yt(z) && v({
2685
2676
  ...z.properties.style || {}
2686
- }), c(z);
2677
+ }), h(z);
2687
2678
  }).on("unselect", () => {
2688
- c(null);
2679
+ h(null);
2689
2680
  }), A(L), () => {
2690
- y == null || y.destroy();
2681
+ L.destroy();
2691
2682
  };
2692
- }, [e]), rr(() => {
2693
- y && a && (a == null ? void 0 : a.properties.type) === "arrow" && y.updateStyle(a.id, f);
2694
- }, [y, f, a]), rr(() => {
2695
- y && a && (a == null ? void 0 : a.properties.type) === "text" && y.updateStyle(a.id, d);
2696
- }, [y, d, a]), /* @__PURE__ */ nn.jsx(
2683
+ }, [e]), nr(() => {
2684
+ y && l && (l == null ? void 0 : l.properties.type) === "arrow" && y.updateStyle(l.id, d);
2685
+ }, [y, d, l]), nr(() => {
2686
+ y && l && (l == null ? void 0 : l.properties.type) === "text" && y.updateStyle(l.id, f);
2687
+ }, [y, f, l]), /* @__PURE__ */ nn.jsx(
2697
2688
  Gr.Provider,
2698
2689
  {
2699
2690
  value: {
2700
- annotations: s,
2691
+ annotations: o,
2701
2692
  updateAnnotations: n,
2702
- currentAnnotation: a,
2703
- setCurrentAnnotation: c,
2704
- textStyle: d,
2693
+ currentAnnotation: l,
2694
+ setCurrentAnnotation: h,
2695
+ textStyle: f,
2705
2696
  setTextStyle: v,
2706
- arrowStyle: f,
2697
+ arrowStyle: d,
2707
2698
  setArrowStyle: g,
2708
- arrowWidthFactor: _,
2699
+ arrowWidthFactor: k,
2709
2700
  setArrowWidthFactor: S,
2710
2701
  textSizeFactor: R,
2711
2702
  setTextSizeFactor: C,
@@ -2718,18 +2709,18 @@ const Gr = jr(
2718
2709
  };
2719
2710
  export {
2720
2711
  Gr as AnnotationsContext,
2721
- Jn as AnnotationsContextProvider,
2712
+ Yn as AnnotationsContextProvider,
2722
2713
  Xr as BLACK,
2723
- Mn as RELATIVE_PADDING,
2724
- $r as TRANSPARENT,
2725
- Xn as createAnnotationsContext,
2726
- Fn as defaultArrowStyle,
2727
- Wn as defaultColors,
2728
- zn as defaultTextStyle,
2714
+ In as RELATIVE_PADDING,
2715
+ Ir as TRANSPARENT,
2716
+ Wn as createAnnotationsContext,
2717
+ Ln as defaultArrowStyle,
2718
+ Nn as defaultColors,
2719
+ $n as defaultTextStyle,
2729
2720
  Lr as fontSizes,
2730
- Un as fonts,
2731
- Yn as interpolate,
2732
- Nn as mean,
2733
- Vn as normalize,
2734
- Gn as useAnnotationsContext
2721
+ Hn as fonts,
2722
+ Bn as interpolate,
2723
+ jn as mean,
2724
+ qn as normalize,
2725
+ Un as useAnnotationsContext
2735
2726
  };