@linkurious/ogma-annotations-react 1.1.16 → 1.1.19

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,6 +1,6 @@
1
1
  import Cr, { createContext as Or, useContext as qr, useReducer as Yr, useState as Nt, useEffect as er } from "react";
2
2
  import { useOgma as Gr } from "@linkurious/ogma-react";
3
- var or = { exports: {} }, he = {};
3
+ var or = { exports: {} }, ue = {};
4
4
  /**
5
5
  * @license React
6
6
  * react-jsx-runtime.production.min.js
@@ -13,22 +13,22 @@ var or = { exports: {} }, he = {};
13
13
  var dr;
14
14
  function Xr() {
15
15
  if (dr)
16
- return he;
16
+ return ue;
17
17
  dr = 1;
18
- var u = Cr, e = Symbol.for("react.element"), o = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, l = u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, c = { key: !0, ref: !0, __self: !0, __source: !0 };
19
- function f(g, d, v) {
20
- var y, _ = {}, C = null, E = null;
21
- v !== void 0 && (C = "" + v), d.key !== void 0 && (C = "" + d.key), d.ref !== void 0 && (E = d.ref);
22
- for (y in d)
23
- i.call(d, y) && !c.hasOwnProperty(y) && (_[y] = d[y]);
24
- if (g && g.defaultProps)
25
- for (y in d = g.defaultProps, d)
26
- _[y] === void 0 && (_[y] = d[y]);
27
- return { $$typeof: e, type: g, key: C, ref: E, props: _, _owner: l.current };
28
- }
29
- return he.Fragment = o, he.jsx = f, he.jsxs = f, he;
18
+ var h = Cr, e = Symbol.for("react.element"), s = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, l = h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, c = { key: !0, ref: !0, __self: !0, __source: !0 };
19
+ function g(y, f, m) {
20
+ var v, k = {}, C = null, _ = null;
21
+ m !== void 0 && (C = "" + m), f.key !== void 0 && (C = "" + f.key), f.ref !== void 0 && (_ = f.ref);
22
+ for (v in f)
23
+ i.call(f, v) && !c.hasOwnProperty(v) && (k[v] = f[v]);
24
+ if (y && y.defaultProps)
25
+ for (v in f = y.defaultProps, f)
26
+ k[v] === void 0 && (k[v] = f[v]);
27
+ return { $$typeof: e, type: y, key: C, ref: _, props: k, _owner: l.current };
28
+ }
29
+ return ue.Fragment = s, ue.jsx = g, ue.jsxs = g, ue;
30
30
  }
31
- var ce = {};
31
+ var he = {};
32
32
  /**
33
33
  * @license React
34
34
  * react-jsx-runtime.development.js
@@ -41,48 +41,48 @@ var ce = {};
41
41
  var fr;
42
42
  function Jr() {
43
43
  return fr || (fr = 1, process.env.NODE_ENV !== "production" && function() {
44
- var u = Cr, e = Symbol.for("react.element"), o = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), l = 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"), _ = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), E = Symbol.for("react.offscreen"), P = Symbol.iterator, S = "@@iterator";
45
- function $(t) {
44
+ var h = Cr, e = Symbol.for("react.element"), s = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), l = Symbol.for("react.strict_mode"), c = Symbol.for("react.profiler"), g = Symbol.for("react.provider"), y = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), m = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), k = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), _ = Symbol.for("react.offscreen"), R = Symbol.iterator, S = "@@iterator";
45
+ function D(t) {
46
46
  if (t === null || typeof t != "object")
47
47
  return null;
48
- var s = P && t[P] || t[S];
49
- return typeof s == "function" ? s : null;
48
+ var u = R && t[R] || t[S];
49
+ return typeof u == "function" ? u : null;
50
50
  }
51
- var L = u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
51
+ var L = h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
52
52
  function T(t) {
53
53
  {
54
- for (var s = arguments.length, h = new Array(s > 1 ? s - 1 : 0), p = 1; p < s; p++)
55
- h[p - 1] = arguments[p];
56
- B("error", t, h);
54
+ for (var u = arguments.length, d = new Array(u > 1 ? u - 1 : 0), p = 1; p < u; p++)
55
+ d[p - 1] = arguments[p];
56
+ U("error", t, d);
57
57
  }
58
58
  }
59
- function B(t, s, h) {
59
+ function U(t, u, d) {
60
60
  {
61
- var p = L.ReactDebugCurrentFrame, m = p.getStackAddendum();
62
- m !== "" && (s += "%s", h = h.concat([m]));
63
- var w = h.map(function(b) {
64
- return String(b);
61
+ var p = L.ReactDebugCurrentFrame, b = p.getStackAddendum();
62
+ b !== "" && (u += "%s", d = d.concat([b]));
63
+ var w = d.map(function(A) {
64
+ return String(A);
65
65
  });
66
- w.unshift("Warning: " + s), Function.prototype.apply.call(console[t], console, w);
66
+ w.unshift("Warning: " + u), Function.prototype.apply.call(console[t], console, w);
67
67
  }
68
68
  }
69
- var N = !1, it = !1, xt = !1, qt = !1, Yt = !1, pe;
70
- pe = Symbol.for("react.module.reference");
69
+ var H = !1, it = !1, At = !1, qt = !1, Yt = !1, ge;
70
+ ge = Symbol.for("react.module.reference");
71
71
  function Ot(t) {
72
- return !!(typeof t == "string" || typeof t == "function" || t === i || t === c || Yt || t === l || t === v || t === y || qt || t === E || N || it || xt || typeof t == "object" && t !== null && (t.$$typeof === C || t.$$typeof === _ || t.$$typeof === f || t.$$typeof === g || t.$$typeof === d || // This needs to include all possible module reference object
72
+ return !!(typeof t == "string" || typeof t == "function" || t === i || t === c || Yt || t === l || t === m || t === v || qt || t === _ || H || it || At || typeof t == "object" && t !== null && (t.$$typeof === C || t.$$typeof === k || t.$$typeof === g || t.$$typeof === y || t.$$typeof === f || // This needs to include all possible module reference object
73
73
  // types supported by any Flight configuration anywhere since
74
74
  // we don't know which Flight build this will end up being used
75
75
  // with.
76
- t.$$typeof === pe || t.getModuleId !== void 0));
76
+ t.$$typeof === ge || t.getModuleId !== void 0));
77
77
  }
78
- function Pt(t, s, h) {
78
+ function Pt(t, u, d) {
79
79
  var p = t.displayName;
80
80
  if (p)
81
81
  return p;
82
- var m = s.displayName || s.name || "";
83
- return m !== "" ? h + "(" + m + ")" : h;
82
+ var b = u.displayName || u.name || "";
83
+ return b !== "" ? d + "(" + b + ")" : d;
84
84
  }
85
- function Gt(t) {
85
+ function pe(t) {
86
86
  return t.displayName || "Context";
87
87
  }
88
88
  function tt(t) {
@@ -95,34 +95,34 @@ function Jr() {
95
95
  switch (t) {
96
96
  case i:
97
97
  return "Fragment";
98
- case o:
98
+ case s:
99
99
  return "Portal";
100
100
  case c:
101
101
  return "Profiler";
102
102
  case l:
103
103
  return "StrictMode";
104
- case v:
104
+ case m:
105
105
  return "Suspense";
106
- case y:
106
+ case v:
107
107
  return "SuspenseList";
108
108
  }
109
109
  if (typeof t == "object")
110
110
  switch (t.$$typeof) {
111
+ case y:
112
+ var u = t;
113
+ return pe(u) + ".Consumer";
111
114
  case g:
112
- var s = t;
113
- return Gt(s) + ".Consumer";
115
+ var d = t;
116
+ return pe(d._context) + ".Provider";
114
117
  case f:
115
- var h = t;
116
- return Gt(h._context) + ".Provider";
117
- case d:
118
118
  return Pt(t, t.render, "ForwardRef");
119
- case _:
119
+ case k:
120
120
  var p = t.displayName || null;
121
121
  return p !== null ? p : tt(t.type) || "Memo";
122
122
  case C: {
123
- var m = t, w = m._payload, b = m._init;
123
+ var b = t, w = b._payload, A = b._init;
124
124
  try {
125
- return tt(b(w));
125
+ return tt(A(w));
126
126
  } catch {
127
127
  return null;
128
128
  }
@@ -130,18 +130,18 @@ function Jr() {
130
130
  }
131
131
  return null;
132
132
  }
133
- var D = Object.assign, lt = 0, G, ut, Rt, ye, Xt, ve, me;
134
- function At() {
133
+ var z = Object.assign, lt = 0, X, ut, Rt, ye, Gt, ve, me;
134
+ function Et() {
135
135
  }
136
- At.__reactDisabledLog = !0;
136
+ Et.__reactDisabledLog = !0;
137
137
  function be() {
138
138
  {
139
139
  if (lt === 0) {
140
- G = console.log, ut = console.info, Rt = console.warn, ye = console.error, Xt = console.group, ve = console.groupCollapsed, me = console.groupEnd;
140
+ X = console.log, ut = console.info, Rt = console.warn, ye = console.error, Gt = console.group, ve = console.groupCollapsed, me = console.groupEnd;
141
141
  var t = {
142
142
  configurable: !0,
143
143
  enumerable: !0,
144
- value: At,
144
+ value: Et,
145
145
  writable: !0
146
146
  };
147
147
  Object.defineProperties(console, {
@@ -157,7 +157,7 @@ function Jr() {
157
157
  lt++;
158
158
  }
159
159
  }
160
- function Ne() {
160
+ function Be() {
161
161
  {
162
162
  if (lt--, lt === 0) {
163
163
  var t = {
@@ -166,25 +166,25 @@ function Jr() {
166
166
  writable: !0
167
167
  };
168
168
  Object.defineProperties(console, {
169
- log: D({}, t, {
170
- value: G
169
+ log: z({}, t, {
170
+ value: X
171
171
  }),
172
- info: D({}, t, {
172
+ info: z({}, t, {
173
173
  value: ut
174
174
  }),
175
- warn: D({}, t, {
175
+ warn: z({}, t, {
176
176
  value: Rt
177
177
  }),
178
- error: D({}, t, {
178
+ error: z({}, t, {
179
179
  value: ye
180
180
  }),
181
- group: D({}, t, {
182
- value: Xt
181
+ group: z({}, t, {
182
+ value: Gt
183
183
  }),
184
- groupCollapsed: D({}, t, {
184
+ groupCollapsed: z({}, t, {
185
185
  value: ve
186
186
  }),
187
- groupEnd: D({}, t, {
187
+ groupEnd: z({}, t, {
188
188
  value: me
189
189
  })
190
190
  });
@@ -192,170 +192,170 @@ function Jr() {
192
192
  lt < 0 && T("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
193
193
  }
194
194
  }
195
- var Jt = L.ReactCurrentDispatcher, Zt;
196
- function It(t, s, h) {
195
+ var Xt = L.ReactCurrentDispatcher, Jt;
196
+ function It(t, u, d) {
197
197
  {
198
- if (Zt === void 0)
198
+ if (Jt === void 0)
199
199
  try {
200
200
  throw Error();
201
- } catch (m) {
202
- var p = m.stack.trim().match(/\n( *(at )?)/);
203
- Zt = p && p[1] || "";
201
+ } catch (b) {
202
+ var p = b.stack.trim().match(/\n( *(at )?)/);
203
+ Jt = p && p[1] || "";
204
204
  }
205
205
  return `
206
- ` + Zt + t;
206
+ ` + Jt + t;
207
207
  }
208
208
  }
209
- var Kt = !1, Et;
209
+ var Kt = !1, _t;
210
210
  {
211
- var Be = typeof WeakMap == "function" ? WeakMap : Map;
212
- Et = new Be();
211
+ var He = typeof WeakMap == "function" ? WeakMap : Map;
212
+ _t = new He();
213
213
  }
214
- function Qt(t, s) {
214
+ function Zt(t, u) {
215
215
  if (!t || Kt)
216
216
  return "";
217
217
  {
218
- var h = Et.get(t);
219
- if (h !== void 0)
220
- return h;
218
+ var d = _t.get(t);
219
+ if (d !== void 0)
220
+ return d;
221
221
  }
222
222
  var p;
223
223
  Kt = !0;
224
- var m = Error.prepareStackTrace;
224
+ var b = Error.prepareStackTrace;
225
225
  Error.prepareStackTrace = void 0;
226
226
  var w;
227
- w = Jt.current, Jt.current = null, be();
227
+ w = Xt.current, Xt.current = null, be();
228
228
  try {
229
- if (s) {
230
- var b = function() {
229
+ if (u) {
230
+ var A = function() {
231
231
  throw Error();
232
232
  };
233
- if (Object.defineProperty(b.prototype, "props", {
233
+ if (Object.defineProperty(A.prototype, "props", {
234
234
  set: function() {
235
235
  throw Error();
236
236
  }
237
237
  }), typeof Reflect == "object" && Reflect.construct) {
238
238
  try {
239
- Reflect.construct(b, []);
240
- } catch (I) {
241
- p = I;
239
+ Reflect.construct(A, []);
240
+ } catch ($) {
241
+ p = $;
242
242
  }
243
- Reflect.construct(t, [], b);
243
+ Reflect.construct(t, [], A);
244
244
  } else {
245
245
  try {
246
- b.call();
247
- } catch (I) {
248
- p = I;
246
+ A.call();
247
+ } catch ($) {
248
+ p = $;
249
249
  }
250
- t.call(b.prototype);
250
+ t.call(A.prototype);
251
251
  }
252
252
  } else {
253
253
  try {
254
254
  throw Error();
255
- } catch (I) {
256
- p = I;
255
+ } catch ($) {
256
+ p = $;
257
257
  }
258
258
  t();
259
259
  }
260
- } catch (I) {
261
- if (I && p && typeof I.stack == "string") {
262
- for (var A = I.stack.split(`
263
- `), R = p.stack.split(`
264
- `), k = A.length - 1, O = R.length - 1; k >= 1 && O >= 0 && A[k] !== R[O]; )
265
- O--;
266
- for (; k >= 1 && O >= 0; k--, O--)
267
- if (A[k] !== R[O]) {
268
- if (k !== 1 || O !== 1)
260
+ } catch ($) {
261
+ if ($ && p && typeof $.stack == "string") {
262
+ for (var E = $.stack.split(`
263
+ `), O = p.stack.split(`
264
+ `), P = E.length - 1, I = O.length - 1; P >= 1 && I >= 0 && E[P] !== O[I]; )
265
+ I--;
266
+ for (; P >= 1 && I >= 0; P--, I--)
267
+ if (E[P] !== O[I]) {
268
+ if (P !== 1 || I !== 1)
269
269
  do
270
- if (k--, O--, O < 0 || A[k] !== R[O]) {
271
- var j = `
272
- ` + A[k].replace(" at new ", " at ");
273
- return t.displayName && j.includes("<anonymous>") && (j = j.replace("<anonymous>", t.displayName)), typeof t == "function" && Et.set(t, j), j;
270
+ if (P--, I--, I < 0 || E[P] !== O[I]) {
271
+ var B = `
272
+ ` + E[P].replace(" at new ", " at ");
273
+ return t.displayName && B.includes("<anonymous>") && (B = B.replace("<anonymous>", t.displayName)), typeof t == "function" && _t.set(t, B), B;
274
274
  }
275
- while (k >= 1 && O >= 0);
275
+ while (P >= 1 && I >= 0);
276
276
  break;
277
277
  }
278
278
  }
279
279
  } finally {
280
- Kt = !1, Jt.current = w, Ne(), Error.prepareStackTrace = m;
280
+ Kt = !1, Xt.current = w, Be(), Error.prepareStackTrace = b;
281
281
  }
282
- var U = t ? t.displayName || t.name : "", M = U ? It(U) : "";
283
- return typeof t == "function" && Et.set(t, M), M;
282
+ var M = t ? t.displayName || t.name : "", F = M ? It(M) : "";
283
+ return typeof t == "function" && _t.set(t, F), F;
284
284
  }
285
- function He(t, s, h) {
286
- return Qt(t, !1);
285
+ function Ue(t, u, d) {
286
+ return Zt(t, !1);
287
287
  }
288
- function Ue(t) {
289
- var s = t.prototype;
290
- return !!(s && s.isReactComponent);
288
+ function We(t) {
289
+ var u = t.prototype;
290
+ return !!(u && u.isReactComponent);
291
291
  }
292
- function Lt(t, s, h) {
292
+ function Lt(t, u, d) {
293
293
  if (t == null)
294
294
  return "";
295
295
  if (typeof t == "function")
296
- return Qt(t, Ue(t));
296
+ return Zt(t, We(t));
297
297
  if (typeof t == "string")
298
298
  return It(t);
299
299
  switch (t) {
300
- case v:
300
+ case m:
301
301
  return It("Suspense");
302
- case y:
302
+ case v:
303
303
  return It("SuspenseList");
304
304
  }
305
305
  if (typeof t == "object")
306
306
  switch (t.$$typeof) {
307
- case d:
308
- return He(t.render);
309
- case _:
310
- return Lt(t.type, s, h);
307
+ case f:
308
+ return Ue(t.render);
309
+ case k:
310
+ return Lt(t.type, u, d);
311
311
  case C: {
312
- var p = t, m = p._payload, w = p._init;
312
+ var p = t, b = p._payload, w = p._init;
313
313
  try {
314
- return Lt(w(m), s, h);
314
+ return Lt(w(b), u, d);
315
315
  } catch {
316
316
  }
317
317
  }
318
318
  }
319
319
  return "";
320
320
  }
321
- var _t = Object.prototype.hasOwnProperty, we = {}, xe = L.ReactDebugCurrentFrame;
321
+ var bt = Object.prototype.hasOwnProperty, we = {}, xe = L.ReactDebugCurrentFrame;
322
322
  function Ft(t) {
323
323
  if (t) {
324
- var s = t._owner, h = Lt(t.type, t._source, s ? s.type : null);
325
- xe.setExtraStackFrame(h);
324
+ var u = t._owner, d = Lt(t.type, t._source, u ? u.type : null);
325
+ xe.setExtraStackFrame(d);
326
326
  } else
327
327
  xe.setExtraStackFrame(null);
328
328
  }
329
- function We(t, s, h, p, m) {
329
+ function Ve(t, u, d, p, b) {
330
330
  {
331
- var w = Function.call.bind(_t);
332
- for (var b in t)
333
- if (w(t, b)) {
334
- var A = void 0;
331
+ var w = Function.call.bind(bt);
332
+ for (var A in t)
333
+ if (w(t, A)) {
334
+ var E = void 0;
335
335
  try {
336
- if (typeof t[b] != "function") {
337
- var R = 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`.");
338
- throw R.name = "Invariant Violation", R;
336
+ if (typeof t[A] != "function") {
337
+ var O = Error((p || "React class") + ": " + d + " type `" + A + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof t[A] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
338
+ throw O.name = "Invariant Violation", O;
339
339
  }
340
- A = t[b](s, b, p, h, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
341
- } catch (k) {
342
- A = k;
340
+ E = t[A](u, A, p, d, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
341
+ } catch (P) {
342
+ E = P;
343
343
  }
344
- A && !(A instanceof Error) && (Ft(m), T("%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 A), Ft(null)), A instanceof Error && !(A.message in we) && (we[A.message] = !0, Ft(m), T("Failed %s type: %s", h, A.message), Ft(null));
344
+ E && !(E instanceof Error) && (Ft(b), T("%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", d, A, typeof E), Ft(null)), E instanceof Error && !(E.message in we) && (we[E.message] = !0, Ft(b), T("Failed %s type: %s", d, E.message), Ft(null));
345
345
  }
346
346
  }
347
347
  }
348
- var Ve = Array.isArray;
349
- function te(t) {
350
- return Ve(t);
348
+ var qe = Array.isArray;
349
+ function Qt(t) {
350
+ return qe(t);
351
351
  }
352
- function H(t) {
352
+ function W(t) {
353
353
  {
354
- var s = typeof Symbol == "function" && Symbol.toStringTag, h = s && t[Symbol.toStringTag] || t.constructor.name || "Object";
355
- return h;
354
+ var u = typeof Symbol == "function" && Symbol.toStringTag, d = u && t[Symbol.toStringTag] || t.constructor.name || "Object";
355
+ return d;
356
356
  }
357
357
  }
358
- function qe(t) {
358
+ function Ye(t) {
359
359
  try {
360
360
  return Ae(t), !1;
361
361
  } catch {
@@ -365,125 +365,125 @@ function Jr() {
365
365
  function Ae(t) {
366
366
  return "" + t;
367
367
  }
368
- function ee(t) {
369
- if (qe(t))
370
- return T("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", H(t)), Ae(t);
368
+ function te(t) {
369
+ if (Ye(t))
370
+ return T("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", W(t)), Ae(t);
371
371
  }
372
372
  var ot = L.ReactCurrentOwner, Ee = {
373
373
  key: !0,
374
374
  ref: !0,
375
375
  __self: !0,
376
376
  __source: !0
377
- }, $t, _e, re;
378
- re = {};
379
- function ne(t) {
380
- if (_t.call(t, "ref")) {
381
- var s = Object.getOwnPropertyDescriptor(t, "ref").get;
382
- if (s && s.isReactWarning)
377
+ }, jt, _e, ee;
378
+ ee = {};
379
+ function re(t) {
380
+ if (bt.call(t, "ref")) {
381
+ var u = Object.getOwnPropertyDescriptor(t, "ref").get;
382
+ if (u && u.isReactWarning)
383
383
  return !1;
384
384
  }
385
385
  return t.ref !== void 0;
386
386
  }
387
- function Ye(t) {
388
- if (_t.call(t, "key")) {
389
- var s = Object.getOwnPropertyDescriptor(t, "key").get;
390
- if (s && s.isReactWarning)
387
+ function Ge(t) {
388
+ if (bt.call(t, "key")) {
389
+ var u = Object.getOwnPropertyDescriptor(t, "key").get;
390
+ if (u && u.isReactWarning)
391
391
  return !1;
392
392
  }
393
393
  return t.key !== void 0;
394
394
  }
395
- function Ge(t, s) {
396
- if (typeof t.ref == "string" && ot.current && s && ot.current.stateNode !== s) {
397
- var h = tt(ot.current.type);
398
- re[h] || (T('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', tt(ot.current.type), t.ref), re[h] = !0);
395
+ function Xe(t, u) {
396
+ if (typeof t.ref == "string" && ot.current && u && ot.current.stateNode !== u) {
397
+ var d = tt(ot.current.type);
398
+ ee[d] || (T('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', tt(ot.current.type), t.ref), ee[d] = !0);
399
399
  }
400
400
  }
401
- function Xe(t, s) {
401
+ function Je(t, u) {
402
402
  {
403
- var h = function() {
404
- $t || ($t = !0, T("%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));
403
+ var d = function() {
404
+ jt || (jt = !0, T("%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)", u));
405
405
  };
406
- h.isReactWarning = !0, Object.defineProperty(t, "key", {
407
- get: h,
406
+ d.isReactWarning = !0, Object.defineProperty(t, "key", {
407
+ get: d,
408
408
  configurable: !0
409
409
  });
410
410
  }
411
411
  }
412
- function ie(t, s) {
412
+ function ne(t, u) {
413
413
  {
414
- var h = function() {
415
- _e || (_e = !0, T("%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));
414
+ var d = function() {
415
+ _e || (_e = !0, T("%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)", u));
416
416
  };
417
- h.isReactWarning = !0, Object.defineProperty(t, "ref", {
418
- get: h,
417
+ d.isReactWarning = !0, Object.defineProperty(t, "ref", {
418
+ get: d,
419
419
  configurable: !0
420
420
  });
421
421
  }
422
422
  }
423
- var ke = function(t, s, h, p, m, w, b) {
424
- var A = {
423
+ var ke = function(t, u, d, p, b, w, A) {
424
+ var E = {
425
425
  // This tag allows us to uniquely identify this as a React Element
426
426
  $$typeof: e,
427
427
  // Built-in properties that belong on the element
428
428
  type: t,
429
- key: s,
430
- ref: h,
431
- props: b,
429
+ key: u,
430
+ ref: d,
431
+ props: A,
432
432
  // Record the component responsible for creating this element.
433
433
  _owner: w
434
434
  };
435
- return A._store = {}, Object.defineProperty(A._store, "validated", {
435
+ return E._store = {}, Object.defineProperty(E._store, "validated", {
436
436
  configurable: !1,
437
437
  enumerable: !1,
438
438
  writable: !0,
439
439
  value: !1
440
- }), Object.defineProperty(A, "_self", {
440
+ }), Object.defineProperty(E, "_self", {
441
441
  configurable: !1,
442
442
  enumerable: !1,
443
443
  writable: !1,
444
444
  value: p
445
- }), Object.defineProperty(A, "_source", {
445
+ }), Object.defineProperty(E, "_source", {
446
446
  configurable: !1,
447
447
  enumerable: !1,
448
448
  writable: !1,
449
- value: m
450
- }), Object.freeze && (Object.freeze(A.props), Object.freeze(A)), A;
449
+ value: b
450
+ }), Object.freeze && (Object.freeze(E.props), Object.freeze(E)), E;
451
451
  };
452
- function kt(t, s, h, p, m) {
452
+ function kt(t, u, d, p, b) {
453
453
  {
454
- var w, b = {}, A = null, R = null;
455
- h !== void 0 && (ee(h), A = "" + h), Ye(s) && (ee(s.key), A = "" + s.key), ne(s) && (R = s.ref, Ge(s, m));
456
- for (w in s)
457
- _t.call(s, w) && !Ee.hasOwnProperty(w) && (b[w] = s[w]);
454
+ var w, A = {}, E = null, O = null;
455
+ d !== void 0 && (te(d), E = "" + d), Ge(u) && (te(u.key), E = "" + u.key), re(u) && (O = u.ref, Xe(u, b));
456
+ for (w in u)
457
+ bt.call(u, w) && !Ee.hasOwnProperty(w) && (A[w] = u[w]);
458
458
  if (t && t.defaultProps) {
459
- var k = t.defaultProps;
460
- for (w in k)
461
- b[w] === void 0 && (b[w] = k[w]);
459
+ var P = t.defaultProps;
460
+ for (w in P)
461
+ A[w] === void 0 && (A[w] = P[w]);
462
462
  }
463
- if (A || R) {
464
- var O = typeof t == "function" ? t.displayName || t.name || "Unknown" : t;
465
- A && Xe(b, O), R && ie(b, O);
463
+ if (E || O) {
464
+ var I = typeof t == "function" ? t.displayName || t.name || "Unknown" : t;
465
+ E && Je(A, I), O && ne(A, I);
466
466
  }
467
- return ke(t, A, R, m, p, ot.current, b);
467
+ return ke(t, E, O, b, p, ot.current, A);
468
468
  }
469
469
  }
470
- var oe = L.ReactCurrentOwner, Te = L.ReactDebugCurrentFrame;
470
+ var ie = L.ReactCurrentOwner, Te = L.ReactDebugCurrentFrame;
471
471
  function ht(t) {
472
472
  if (t) {
473
- var s = t._owner, h = Lt(t.type, t._source, s ? s.type : null);
474
- Te.setExtraStackFrame(h);
473
+ var u = t._owner, d = Lt(t.type, t._source, u ? u.type : null);
474
+ Te.setExtraStackFrame(d);
475
475
  } else
476
476
  Te.setExtraStackFrame(null);
477
477
  }
478
- var X;
479
- X = !1;
478
+ var J;
479
+ J = !1;
480
480
  function dt(t) {
481
481
  return typeof t == "object" && t !== null && t.$$typeof === e;
482
482
  }
483
- function jt() {
483
+ function $t() {
484
484
  {
485
- if (oe.current) {
486
- var t = tt(oe.current.type);
485
+ if (ie.current) {
486
+ var t = tt(ie.current.type);
487
487
  if (t)
488
488
  return `
489
489
 
@@ -492,91 +492,83 @@ Check the render method of \`` + t + "`.";
492
492
  return "";
493
493
  }
494
494
  }
495
- function Je(t) {
496
- {
497
- if (t !== void 0) {
498
- var s = t.fileName.replace(/^.*[\\\/]/, ""), h = t.lineNumber;
499
- return `
500
-
501
- Check your code at ` + s + ":" + h + ".";
502
- }
503
- return "";
504
- }
495
+ function Ke(t) {
496
+ return "";
505
497
  }
506
- var se = {};
498
+ var oe = {};
507
499
  function Se(t) {
508
500
  {
509
- var s = jt();
510
- if (!s) {
511
- var h = typeof t == "string" ? t : t.displayName || t.name;
512
- h && (s = `
501
+ var u = $t();
502
+ if (!u) {
503
+ var d = typeof t == "string" ? t : t.displayName || t.name;
504
+ d && (u = `
513
505
 
514
- Check the top-level render call using <` + h + ">.");
506
+ Check the top-level render call using <` + d + ">.");
515
507
  }
516
- return s;
508
+ return u;
517
509
  }
518
510
  }
519
- function Ce(t, s) {
511
+ function Ce(t, u) {
520
512
  {
521
513
  if (!t._store || t._store.validated || t.key != null)
522
514
  return;
523
515
  t._store.validated = !0;
524
- var h = Se(s);
525
- if (se[h])
516
+ var d = Se(u);
517
+ if (oe[d])
526
518
  return;
527
- se[h] = !0;
519
+ oe[d] = !0;
528
520
  var p = "";
529
- t && t._owner && t._owner !== oe.current && (p = " It was passed a child from " + tt(t._owner.type) + "."), ht(t), T('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), ht(null);
521
+ t && t._owner && t._owner !== ie.current && (p = " It was passed a child from " + tt(t._owner.type) + "."), ht(t), T('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', d, p), ht(null);
530
522
  }
531
523
  }
532
- function Dt(t, s) {
524
+ function Dt(t, u) {
533
525
  {
534
526
  if (typeof t != "object")
535
527
  return;
536
- if (te(t))
537
- for (var h = 0; h < t.length; h++) {
538
- var p = t[h];
539
- dt(p) && Ce(p, s);
528
+ if (Qt(t))
529
+ for (var d = 0; d < t.length; d++) {
530
+ var p = t[d];
531
+ dt(p) && Ce(p, u);
540
532
  }
541
533
  else if (dt(t))
542
534
  t._store && (t._store.validated = !0);
543
535
  else if (t) {
544
- var m = $(t);
545
- if (typeof m == "function" && m !== t.entries)
546
- for (var w = m.call(t), b; !(b = w.next()).done; )
547
- dt(b.value) && Ce(b.value, s);
536
+ var b = D(t);
537
+ if (typeof b == "function" && b !== t.entries)
538
+ for (var w = b.call(t), A; !(A = w.next()).done; )
539
+ dt(A.value) && Ce(A.value, u);
548
540
  }
549
541
  }
550
542
  }
551
543
  function Ze(t) {
552
544
  {
553
- var s = t.type;
554
- if (s == null || typeof s == "string")
545
+ var u = t.type;
546
+ if (u == null || typeof u == "string")
555
547
  return;
556
- var h;
557
- if (typeof s == "function")
558
- h = s.propTypes;
559
- else if (typeof s == "object" && (s.$$typeof === d || // Note: Memo only checks outer props here.
548
+ var d;
549
+ if (typeof u == "function")
550
+ d = u.propTypes;
551
+ else if (typeof u == "object" && (u.$$typeof === f || // Note: Memo only checks outer props here.
560
552
  // Inner props are checked in the reconciler.
561
- s.$$typeof === _))
562
- h = s.propTypes;
553
+ u.$$typeof === k))
554
+ d = u.propTypes;
563
555
  else
564
556
  return;
565
- if (h) {
566
- var p = tt(s);
567
- We(h, t.props, "prop", p, t);
568
- } else if (s.PropTypes !== void 0 && !X) {
569
- X = !0;
570
- var m = tt(s);
571
- T("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", m || "Unknown");
557
+ if (d) {
558
+ var p = tt(u);
559
+ Ve(d, t.props, "prop", p, t);
560
+ } else if (u.PropTypes !== void 0 && !J) {
561
+ J = !0;
562
+ var b = tt(u);
563
+ T("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", b || "Unknown");
572
564
  }
573
- typeof s.getDefaultProps == "function" && !s.getDefaultProps.isReactClassApproved && T("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
565
+ typeof u.getDefaultProps == "function" && !u.getDefaultProps.isReactClassApproved && T("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
574
566
  }
575
567
  }
576
568
  function Oe(t) {
577
569
  {
578
- for (var s = Object.keys(t.props), h = 0; h < s.length; h++) {
579
- var p = s[h];
570
+ for (var u = Object.keys(t.props), d = 0; d < u.length; d++) {
571
+ var p = u[d];
580
572
  if (p !== "children" && p !== "key") {
581
573
  ht(t), T("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", p), ht(null);
582
574
  break;
@@ -585,50 +577,65 @@ Check the top-level render call using <` + h + ">.");
585
577
  t.ref !== null && (ht(t), T("Invalid attribute `ref` supplied to `React.Fragment`."), ht(null));
586
578
  }
587
579
  }
588
- function ae(t, s, h, p, m, w) {
580
+ var se = {};
581
+ function Pe(t, u, d, p, b, w) {
589
582
  {
590
- var b = Ot(t);
591
- if (!b) {
592
- var A = "";
593
- (t === void 0 || typeof t == "object" && t !== null && Object.keys(t).length === 0) && (A += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
594
- var R = Je(m);
595
- R ? A += R : A += jt();
596
- var k;
597
- t === null ? k = "null" : te(t) ? k = "array" : t !== void 0 && t.$$typeof === e ? (k = "<" + (tt(t.type) || "Unknown") + " />", A = " Did you accidentally export a JSX literal instead of a component?") : k = typeof t, T("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", k, A);
583
+ var A = Ot(t);
584
+ if (!A) {
585
+ var E = "";
586
+ (t === void 0 || typeof t == "object" && t !== null && Object.keys(t).length === 0) && (E += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
587
+ var O = Ke();
588
+ O ? E += O : E += $t();
589
+ var P;
590
+ t === null ? P = "null" : Qt(t) ? P = "array" : t !== void 0 && t.$$typeof === e ? (P = "<" + (tt(t.type) || "Unknown") + " />", E = " Did you accidentally export a JSX literal instead of a component?") : P = typeof t, T("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", P, E);
598
591
  }
599
- var O = kt(t, s, h, m, w);
600
- if (O == null)
601
- return O;
602
- if (b) {
603
- var j = s.children;
604
- if (j !== void 0)
592
+ var I = kt(t, u, d, b, w);
593
+ if (I == null)
594
+ return I;
595
+ if (A) {
596
+ var B = u.children;
597
+ if (B !== void 0)
605
598
  if (p)
606
- if (te(j)) {
607
- for (var U = 0; U < j.length; U++)
608
- Dt(j[U], t);
609
- Object.freeze && Object.freeze(j);
599
+ if (Qt(B)) {
600
+ for (var M = 0; M < B.length; M++)
601
+ Dt(B[M], t);
602
+ Object.freeze && Object.freeze(B);
610
603
  } else
611
604
  T("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
612
605
  else
613
- Dt(j, t);
606
+ Dt(B, t);
614
607
  }
615
- return t === i ? Oe(O) : Ze(O), O;
608
+ if (bt.call(u, "key")) {
609
+ var F = tt(t), $ = Object.keys(u).filter(function(G) {
610
+ return G !== "key";
611
+ }), N = $.length > 0 ? "{key: someKey, " + $.join(": ..., ") + ": ...}" : "{key: someKey}";
612
+ if (!se[F + N]) {
613
+ var K = $.length > 0 ? "{" + $.join(": ..., ") + ": ...}" : "{}";
614
+ T(`A props object containing a "key" prop is being spread into JSX:
615
+ let props = %s;
616
+ <%s {...props} />
617
+ React keys must be passed directly to JSX without using spread:
618
+ let props = %s;
619
+ <%s key={someKey} {...props} />`, N, F, K, F), se[F + N] = !0;
620
+ }
621
+ }
622
+ return t === i ? Oe(I) : Ze(I), I;
616
623
  }
617
624
  }
618
- function Ke(t, s, h) {
619
- return ae(t, s, h, !0);
625
+ function r(t, u, d) {
626
+ return Pe(t, u, d, !0);
620
627
  }
621
- function r(t, s, h) {
622
- return ae(t, s, h, !1);
628
+ function n(t, u, d) {
629
+ return Pe(t, u, d, !1);
623
630
  }
624
- var n = r, a = Ke;
625
- ce.Fragment = i, ce.jsx = n, ce.jsxs = a;
626
- }()), ce;
631
+ var a = n, o = r;
632
+ he.Fragment = i, he.jsx = a, he.jsxs = o;
633
+ }()), he;
627
634
  }
628
635
  process.env.NODE_ENV === "production" ? or.exports = Xr() : or.exports = Jr();
629
- var Zr = or.exports, Kr = Object.defineProperty, Qr = (u, e, o) => e in u ? Kr(u, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : u[e] = o, x = (u, e, o) => (Qr(u, typeof e != "symbol" ? e + "" : e, o), o);
630
- let ze = (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), "");
631
- const ge = {
636
+ var Kr = or.exports, Zr = Object.defineProperty, Qr = (h, e, s) => e in h ? Zr(h, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : h[e] = s, x = (h, e, s) => (Qr(h, typeof e != "symbol" ? e + "" : e, s), s);
637
+ let Ne = (h = 21) => crypto.getRandomValues(new Uint8Array(h)).reduce((e, s) => (s &= 63, s < 36 ? e += s.toString(36) : s < 62 ? e += (s - 26).toString(36).toUpperCase() : s > 62 ? e += "-" : e += "_", e), "");
638
+ const fe = {
632
639
  strokeType: "plain",
633
640
  strokeColor: "black",
634
641
  strokeWidth: 1,
@@ -640,7 +647,7 @@ const ge = {
640
647
  properties: {
641
648
  type: "arrow",
642
649
  style: {
643
- ...ge
650
+ ...fe
644
651
  }
645
652
  },
646
653
  geometry: {
@@ -660,284 +667,284 @@ const ge = {
660
667
  // tail: 'arrow-plain',
661
668
  // start: { x: 0, y: 0 },
662
669
  // end: { x: 100, y: 100 }
663
- }, tn = (u = 0, e = 0, o = 0, i = 0, l = { ...ge }) => ({
664
- id: ze(),
670
+ }, tn = (h = 0, e = 0, s = 0, i = 0, l = { ...fe }) => ({
671
+ id: Ne(),
665
672
  type: "Feature",
666
673
  properties: {
667
674
  type: "arrow",
668
675
  style: {
669
- ...ge,
676
+ ...fe,
670
677
  ...l
671
678
  }
672
679
  },
673
680
  geometry: {
674
681
  type: "LineString",
675
682
  coordinates: [
676
- [u, e],
677
- [o, i]
683
+ [h, e],
684
+ [s, i]
678
685
  ]
679
686
  }
680
687
  }), en = "http://www.w3.org/2000/svg";
681
- function de(u) {
682
- return document.createElementNS(en, u);
688
+ function ce(h) {
689
+ return document.createElementNS(en, h);
683
690
  }
684
- function Pr(u) {
685
- return u.geometry.bbox || rn(u), u.geometry.bbox;
691
+ function Pr(h) {
692
+ return h.geometry.bbox || rn(h), h.geometry.bbox;
686
693
  }
687
- function mt(u) {
688
- const e = Pr(u);
694
+ function mt(h) {
695
+ const e = Pr(h);
689
696
  return {
690
697
  width: e[2] - e[0],
691
698
  height: e[3] - e[1]
692
699
  };
693
700
  }
694
- function vt(u) {
695
- const e = Pr(u);
701
+ function vt(h) {
702
+ const e = Pr(h);
696
703
  return { x: e[0], y: e[1] };
697
704
  }
698
- function rn(u) {
699
- const [e, o] = u.geometry.coordinates[0][0], [i, l] = u.geometry.coordinates[0][2];
700
- u.geometry.bbox = [e, o, i, l];
705
+ function rn(h) {
706
+ const [e, s] = h.geometry.coordinates[0][0], [i, l] = h.geometry.coordinates[0][2];
707
+ h.geometry.bbox = [e, s, i, l];
701
708
  }
702
- function nn(u, e, o, i, l) {
703
- u.geometry.bbox = [e, o, e + i, o + l], u.geometry.coordinates = [
709
+ function nn(h, e, s, i, l) {
710
+ h.geometry.bbox = [e, s, e + i, s + l], h.geometry.coordinates = [
704
711
  [
705
- [e, o],
706
- [e + i, o],
707
- [e + i, o + l],
708
- [e, o + l],
709
- [e, o]
712
+ [e, s],
713
+ [e + i, s],
714
+ [e + i, s + l],
715
+ [e, s + l],
716
+ [e, s]
710
717
  ]
711
718
  ];
712
719
  }
713
- function fe(u) {
714
- const [e, o] = u.geometry.coordinates[0];
715
- return { x: e, y: o };
720
+ function de(h) {
721
+ const [e, s] = h.geometry.coordinates[0];
722
+ return { x: e, y: s };
716
723
  }
717
- function Ie(u, e) {
718
- const [o, i] = u.geometry.coordinates[e === "start" ? 0 : 1];
719
- return { x: o, y: i };
724
+ function Le(h, e) {
725
+ const [s, i] = h.geometry.coordinates[e === "start" ? 0 : 1];
726
+ return { x: s, y: i };
720
727
  }
721
- function $e(u) {
722
- const [e, o] = u.geometry.coordinates[1];
723
- return { x: e, y: o };
728
+ function $e(h) {
729
+ const [e, s] = h.geometry.coordinates[1];
730
+ return { x: e, y: s };
724
731
  }
725
- function Rr(u, e, o) {
726
- u.geometry.coordinates[0] = [e, o];
732
+ function Rr(h, e, s) {
733
+ h.geometry.coordinates[0] = [e, s];
727
734
  }
728
- function Ir(u, e, o) {
729
- u.geometry.coordinates[1] = [e, o];
735
+ function Ir(h, e, s) {
736
+ h.geometry.coordinates[1] = [e, s];
730
737
  }
731
- function je(u) {
732
- return { start: fe(u), end: $e(u) };
738
+ function De(h) {
739
+ return { start: de(h), end: $e(h) };
733
740
  }
734
- function Bt(u, e, o, i) {
735
- e === "start" ? Rr(u, o, i) : Ir(u, o, i);
741
+ function Bt(h, e, s, i) {
742
+ e === "start" ? Rr(h, s, i) : Ir(h, s, i);
736
743
  }
737
- const Lr = (u) => parseInt(u.getAttribute("data-handle-id") || "-1");
738
- function on(u) {
739
- return Array.isArray(u) && u.length === 2 && u.every(isFinite);
744
+ const Lr = (h) => parseInt(h.getAttribute("data-handle-id") || "-1");
745
+ function on(h) {
746
+ return Array.isArray(h) && h.length === 2 && h.every(isFinite);
740
747
  }
741
- function sn(u, e, o, i) {
742
- for (let l = 0; l < u.coordinates.length; l++) {
743
- const c = u.coordinates[l];
748
+ function sn(h, e, s, i) {
749
+ for (let l = 0; l < h.coordinates.length; l++) {
750
+ const c = h.coordinates[l];
744
751
  if (on(c))
745
- c[0] = o + (c[0] - o) * e, c[1] = i + (c[1] - i) * e;
752
+ c[0] = s + (c[0] - s) * e, c[1] = i + (c[1] - i) * e;
746
753
  else
747
- for (let f = 0; f < c.length; f++) {
748
- const g = c[f];
749
- g[0] = o + (g[0] - o) * e, g[1] = i + (g[1] - i) * e;
754
+ for (let g = 0; g < c.length; g++) {
755
+ const y = c[g];
756
+ y[0] = s + (y[0] - s) * e, y[1] = i + (y[1] - i) * e;
750
757
  }
751
758
  }
752
- return u;
759
+ return h;
753
760
  }
754
- function Le(u, e, o) {
755
- const i = Math.atan2(u.y - e.y, u.x - e.x);
761
+ function Fe(h, e, s) {
762
+ const i = Math.atan2(h.y - e.y, h.x - e.x);
756
763
  return {
757
- x: e.x + o * Math.cos(i),
758
- y: e.y + o * Math.sin(i)
764
+ x: e.x + s * Math.cos(i),
765
+ y: e.y + s * Math.sin(i)
759
766
  };
760
767
  }
761
- function sr(u, e) {
768
+ function sr(h, e) {
762
769
  if (!e)
763
- return { x: u.clientX, y: u.clientY };
764
- const o = e.getBoundingClientRect();
770
+ return { x: h.clientX, y: h.clientY };
771
+ const s = e.getBoundingClientRect();
765
772
  return {
766
- x: u.clientX - o.left - e.clientLeft,
767
- y: u.clientY - o.top - e.clientTop
773
+ x: h.clientX - s.left - e.clientLeft,
774
+ y: h.clientY - s.top - e.clientTop
768
775
  };
769
776
  }
770
- const Ct = (u, e) => ({
771
- x: u.x - e.x,
772
- y: u.y - e.y
773
- }), Ut = (u) => Math.sqrt(u.x * u.x + u.y * u.y), Fr = (u) => ({
774
- x: -u.x,
775
- y: -u.y
776
- }), $r = (u) => {
777
- const e = Ut(u);
777
+ const Ct = (h, e) => ({
778
+ x: h.x - e.x,
779
+ y: h.y - e.y
780
+ }), Ut = (h) => Math.sqrt(h.x * h.x + h.y * h.y), Fr = (h) => ({
781
+ x: -h.x,
782
+ y: -h.y
783
+ }), jr = (h) => {
784
+ const e = Ut(h);
778
785
  return e === 0 ? { x: 0, y: 0 } : {
779
- x: u.x / e,
780
- y: u.y / e
786
+ x: h.x / e,
787
+ y: h.y / e
781
788
  };
782
- }, Ht = (u, e) => ({
783
- x: u.x + e.x,
784
- y: u.y + e.y
785
- }), jr = (u, e) => ({
786
- x: u.x * e,
787
- y: u.y * e
788
- }), Fe = (u, e) => ({
789
- x: u.x * e.x,
790
- y: u.y * e.y
791
- }), at = (u, e) => {
792
- const o = Math.sin(e), i = Math.cos(e);
789
+ }, Ht = (h, e) => ({
790
+ x: h.x + e.x,
791
+ y: h.y + e.y
792
+ }), $r = (h, e) => ({
793
+ x: h.x * e,
794
+ y: h.y * e
795
+ }), je = (h, e) => ({
796
+ x: h.x * e.x,
797
+ y: h.y * e.y
798
+ }), at = (h, e) => {
799
+ const s = Math.sin(e), i = Math.cos(e);
793
800
  return {
794
- x: u.x * i - u.y * o,
795
- y: u.x * o + u.y * i
801
+ x: h.x * i - h.y * s,
802
+ y: h.x * s + h.y * i
796
803
  };
797
- }, an = (u, e) => ({
798
- x: u.x / e,
799
- y: u.y / e
800
- }), pr = (u, e) => u.x * e.x + u.y * e.y;
801
- function Dr(u, e = 5, o = 30) {
804
+ }, an = (h, e) => ({
805
+ x: h.x / e,
806
+ y: h.y / e
807
+ }), pr = (h, e) => h.x * e.x + h.y * e.y;
808
+ function Dr(h, e = 5, s = 30) {
802
809
  var i;
803
- const { start: l, end: c } = je(u), f = Ct(c, l), g = u.properties.style && u.properties.style.strokeWidth ? (i = u.properties.style) == null ? void 0 : i.strokeWidth : 0;
804
- return Math.min(o, Math.max(3 * g, Ut(f) * 0.1, e));
810
+ const { start: l, end: c } = De(h), g = Ct(c, l), y = h.properties.style && h.properties.style.strokeWidth ? (i = h.properties.style) == null ? void 0 : i.strokeWidth : 0;
811
+ return Math.min(s, Math.max(3 * y, Ut(g) * 0.1, e));
805
812
  }
806
- function yr(u, e, o, i) {
807
- const l = jr(Fr($r(e)), i);
808
- if (!o || o === "none")
813
+ function yr(h, e, s, i) {
814
+ const l = $r(Fr(jr(e)), i);
815
+ if (!s || s === "none")
809
816
  return "";
810
- const c = Ht(u, at(l, Math.PI / 8)), f = Ht(u, at(l, -Math.PI / 8)), g = `${u.x} ${u.y}`;
811
- return `M ${c.x} ${c.y} L ${g} ${f.x} ${f.y} ${o === "arrow" ? "" : `${c.x} ${c.y}`}`;
817
+ const c = Ht(h, at(l, Math.PI / 8)), g = Ht(h, at(l, -Math.PI / 8)), y = `${h.x} ${h.y}`;
818
+ return `M ${c.x} ${c.y} L ${y} ${g.x} ${g.y} ${s === "arrow" ? "" : `${c.x} ${c.y}`}`;
812
819
  }
813
- function ln(u, e, o, i, l) {
814
- const { start: c, end: f } = je(u), { tail: g, head: d, strokeColor: v, strokeWidth: y } = u.properties.style || o, _ = Ct(f, c), C = Dr(u, i, l), E = de("path");
815
- E.setAttribute("data-annotation", `${u.id}`), E.setAttribute("data-annotation-type", "arrow");
816
- const P = d === "arrow-plain" || g === "arrow";
817
- E.setAttribute("stroke", v || "none"), E.setAttribute("stroke-width", `${y}`), E.setAttribute("fill", P ? v || "" : "none"), E.setAttribute("stroke-linecap", "round"), E.setAttribute("stroke-linejoin", "round");
818
- const S = yr(c, Fr(_), g, C), $ = yr(f, _, d, C), L = S + `M ${c.x} ${c.y} ${f.x} ${f.y}` + $;
819
- E.setAttribute("d", L), e.appendChild(E);
820
+ function ln(h, e, s, i, l) {
821
+ const { start: c, end: g } = De(h), { tail: y, head: f, strokeColor: m, strokeWidth: v } = h.properties.style || s, k = Ct(g, c), C = Dr(h, i, l), _ = ce("path");
822
+ _.setAttribute("data-annotation", `${h.id}`), _.setAttribute("data-annotation-type", "arrow");
823
+ const R = f === "arrow-plain" || y === "arrow";
824
+ _.setAttribute("stroke", m || "none"), _.setAttribute("stroke-width", `${v}`), _.setAttribute("fill", R ? m || "" : "none"), _.setAttribute("stroke-linecap", "round"), _.setAttribute("stroke-linejoin", "round");
825
+ const S = yr(c, Fr(k), y, C), D = yr(g, k, f, C), L = S + `M ${c.x} ${c.y} ${g.x} ${g.y}` + D;
826
+ _.setAttribute("d", L), e.appendChild(_);
820
827
  }
821
- const Y = -1, De = "dragging", Me = "dragstart", Vt = "dragend", ar = "select", lr = "unselect", un = "hover", hn = "unhover", ur = "remove", hr = "add", cn = "cancelDrawing", cr = "update", dn = "link";
828
+ const Y = -1, Me = "dragging", ze = "dragstart", Vt = "dragend", ar = "select", lr = "unselect", un = "hover", hn = "unhover", ur = "remove", hr = "add", cn = "cancelDrawing", cr = "update", dn = "link";
822
829
  var fn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
823
- function Mr(u) {
824
- return u && u.__esModule && Object.prototype.hasOwnProperty.call(u, "default") ? u.default : u;
830
+ function Mr(h) {
831
+ return h && h.__esModule && Object.prototype.hasOwnProperty.call(h, "default") ? h.default : h;
825
832
  }
826
833
  var zr = { exports: {} };
827
- (function(u) {
828
- var e = Object.prototype.hasOwnProperty, o = "~";
834
+ (function(h) {
835
+ var e = Object.prototype.hasOwnProperty, s = "~";
829
836
  function i() {
830
837
  }
831
- Object.create && (i.prototype = /* @__PURE__ */ Object.create(null), new i().__proto__ || (o = !1));
832
- function l(d, v, y) {
833
- this.fn = d, this.context = v, this.once = y || !1;
838
+ Object.create && (i.prototype = /* @__PURE__ */ Object.create(null), new i().__proto__ || (s = !1));
839
+ function l(f, m, v) {
840
+ this.fn = f, this.context = m, this.once = v || !1;
834
841
  }
835
- function c(d, v, y, _, C) {
836
- if (typeof y != "function")
842
+ function c(f, m, v, k, C) {
843
+ if (typeof v != "function")
837
844
  throw new TypeError("The listener must be a function");
838
- var E = new l(y, _ || d, C), P = o ? o + v : v;
839
- return d._events[P] ? d._events[P].fn ? d._events[P] = [d._events[P], E] : d._events[P].push(E) : (d._events[P] = E, d._eventsCount++), d;
845
+ var _ = new l(v, k || f, C), R = s ? s + m : m;
846
+ return f._events[R] ? f._events[R].fn ? f._events[R] = [f._events[R], _] : f._events[R].push(_) : (f._events[R] = _, f._eventsCount++), f;
840
847
  }
841
- function f(d, v) {
842
- --d._eventsCount === 0 ? d._events = new i() : delete d._events[v];
848
+ function g(f, m) {
849
+ --f._eventsCount === 0 ? f._events = new i() : delete f._events[m];
843
850
  }
844
- function g() {
851
+ function y() {
845
852
  this._events = new i(), this._eventsCount = 0;
846
853
  }
847
- g.prototype.eventNames = function() {
848
- var d = [], v, y;
854
+ y.prototype.eventNames = function() {
855
+ var f = [], m, v;
849
856
  if (this._eventsCount === 0)
850
- return d;
851
- for (y in v = this._events)
852
- e.call(v, y) && d.push(o ? y.slice(1) : y);
853
- return Object.getOwnPropertySymbols ? d.concat(Object.getOwnPropertySymbols(v)) : d;
854
- }, g.prototype.listeners = function(d) {
855
- var v = o ? o + d : d, y = this._events[v];
856
- if (!y)
857
+ return f;
858
+ for (v in m = this._events)
859
+ e.call(m, v) && f.push(s ? v.slice(1) : v);
860
+ return Object.getOwnPropertySymbols ? f.concat(Object.getOwnPropertySymbols(m)) : f;
861
+ }, y.prototype.listeners = function(f) {
862
+ var m = s ? s + f : f, v = this._events[m];
863
+ if (!v)
857
864
  return [];
858
- if (y.fn)
859
- return [y.fn];
860
- for (var _ = 0, C = y.length, E = new Array(C); _ < C; _++)
861
- E[_] = y[_].fn;
862
- return E;
863
- }, g.prototype.listenerCount = function(d) {
864
- var v = o ? o + d : d, y = this._events[v];
865
- return y ? y.fn ? 1 : y.length : 0;
866
- }, g.prototype.emit = function(d, v, y, _, C, E) {
867
- var P = o ? o + d : d;
868
- if (!this._events[P])
865
+ if (v.fn)
866
+ return [v.fn];
867
+ for (var k = 0, C = v.length, _ = new Array(C); k < C; k++)
868
+ _[k] = v[k].fn;
869
+ return _;
870
+ }, y.prototype.listenerCount = function(f) {
871
+ var m = s ? s + f : f, v = this._events[m];
872
+ return v ? v.fn ? 1 : v.length : 0;
873
+ }, y.prototype.emit = function(f, m, v, k, C, _) {
874
+ var R = s ? s + f : f;
875
+ if (!this._events[R])
869
876
  return !1;
870
- var S = this._events[P], $ = arguments.length, L, T;
877
+ var S = this._events[R], D = arguments.length, L, T;
871
878
  if (S.fn) {
872
- switch (S.once && this.removeListener(d, S.fn, void 0, !0), $) {
879
+ switch (S.once && this.removeListener(f, S.fn, void 0, !0), D) {
873
880
  case 1:
874
881
  return S.fn.call(S.context), !0;
875
882
  case 2:
876
- return S.fn.call(S.context, v), !0;
883
+ return S.fn.call(S.context, m), !0;
877
884
  case 3:
878
- return S.fn.call(S.context, v, y), !0;
885
+ return S.fn.call(S.context, m, v), !0;
879
886
  case 4:
880
- return S.fn.call(S.context, v, y, _), !0;
887
+ return S.fn.call(S.context, m, v, k), !0;
881
888
  case 5:
882
- return S.fn.call(S.context, v, y, _, C), !0;
889
+ return S.fn.call(S.context, m, v, k, C), !0;
883
890
  case 6:
884
- return S.fn.call(S.context, v, y, _, C, E), !0;
891
+ return S.fn.call(S.context, m, v, k, C, _), !0;
885
892
  }
886
- for (T = 1, L = new Array($ - 1); T < $; T++)
893
+ for (T = 1, L = new Array(D - 1); T < D; T++)
887
894
  L[T - 1] = arguments[T];
888
895
  S.fn.apply(S.context, L);
889
896
  } else {
890
- var B = S.length, N;
891
- for (T = 0; T < B; T++)
892
- switch (S[T].once && this.removeListener(d, S[T].fn, void 0, !0), $) {
897
+ var U = S.length, H;
898
+ for (T = 0; T < U; T++)
899
+ switch (S[T].once && this.removeListener(f, S[T].fn, void 0, !0), D) {
893
900
  case 1:
894
901
  S[T].fn.call(S[T].context);
895
902
  break;
896
903
  case 2:
897
- S[T].fn.call(S[T].context, v);
904
+ S[T].fn.call(S[T].context, m);
898
905
  break;
899
906
  case 3:
900
- S[T].fn.call(S[T].context, v, y);
907
+ S[T].fn.call(S[T].context, m, v);
901
908
  break;
902
909
  case 4:
903
- S[T].fn.call(S[T].context, v, y, _);
910
+ S[T].fn.call(S[T].context, m, v, k);
904
911
  break;
905
912
  default:
906
913
  if (!L)
907
- for (N = 1, L = new Array($ - 1); N < $; N++)
908
- L[N - 1] = arguments[N];
914
+ for (H = 1, L = new Array(D - 1); H < D; H++)
915
+ L[H - 1] = arguments[H];
909
916
  S[T].fn.apply(S[T].context, L);
910
917
  }
911
918
  }
912
919
  return !0;
913
- }, g.prototype.on = function(d, v, y) {
914
- return c(this, d, v, y, !1);
915
- }, g.prototype.once = function(d, v, y) {
916
- return c(this, d, v, y, !0);
917
- }, g.prototype.removeListener = function(d, v, y, _) {
918
- var C = o ? o + d : d;
920
+ }, y.prototype.on = function(f, m, v) {
921
+ return c(this, f, m, v, !1);
922
+ }, y.prototype.once = function(f, m, v) {
923
+ return c(this, f, m, v, !0);
924
+ }, y.prototype.removeListener = function(f, m, v, k) {
925
+ var C = s ? s + f : f;
919
926
  if (!this._events[C])
920
927
  return this;
921
- if (!v)
922
- return f(this, C), this;
923
- var E = this._events[C];
924
- if (E.fn)
925
- E.fn === v && (!_ || E.once) && (!y || E.context === y) && f(this, C);
928
+ if (!m)
929
+ return g(this, C), this;
930
+ var _ = this._events[C];
931
+ if (_.fn)
932
+ _.fn === m && (!k || _.once) && (!v || _.context === v) && g(this, C);
926
933
  else {
927
- for (var P = 0, S = [], $ = E.length; P < $; P++)
928
- (E[P].fn !== v || _ && !E[P].once || y && E[P].context !== y) && S.push(E[P]);
929
- S.length ? this._events[C] = S.length === 1 ? S[0] : S : f(this, C);
934
+ for (var R = 0, S = [], D = _.length; R < D; R++)
935
+ (_[R].fn !== m || k && !_[R].once || v && _[R].context !== v) && S.push(_[R]);
936
+ S.length ? this._events[C] = S.length === 1 ? S[0] : S : g(this, C);
930
937
  }
931
938
  return this;
932
- }, g.prototype.removeAllListeners = function(d) {
933
- var v;
934
- return d ? (v = o ? o + d : d, this._events[v] && f(this, v)) : (this._events = new i(), this._eventsCount = 0), this;
935
- }, g.prototype.off = g.prototype.removeListener, g.prototype.addListener = g.prototype.on, g.prefixed = o, g.EventEmitter = g, u.exports = g;
939
+ }, y.prototype.removeAllListeners = function(f) {
940
+ var m;
941
+ return f ? (m = s ? s + f : f, this._events[m] && g(this, m)) : (this._events = new i(), this._eventsCount = 0), this;
942
+ }, y.prototype.off = y.prototype.removeListener, y.prototype.addListener = y.prototype.on, y.prefixed = s, y.EventEmitter = y, h.exports = y;
936
943
  })(zr);
937
944
  var gn = zr.exports;
938
945
  const Nr = /* @__PURE__ */ Mr(gn);
939
946
  class Br extends Nr {
940
- constructor(e, o) {
947
+ constructor(e, s) {
941
948
  super(), x(this, "ogma"), x(this, "elements"), x(this, "layer"), x(this, "editor"), x(this, "selectedId", Y), x(this, "hoveredId", Y), x(this, "ogmaOptions"), x(this, "shouldDetect"), x(this, "isDragging"), x(this, "showeditorOnHover"), x(this, "_onKeyUp", (i) => {
942
949
  i.code === 27 && this.selectedId !== Y ? this.unselect() : (i.code === 46 || i.code === 8) && this.selectedId !== Y && this._canRemove() && this.remove(this.selectedId);
943
950
  }), x(this, "_onClickMouseMove", (i) => {
@@ -949,7 +956,7 @@ class Br extends Nr {
949
956
  this.refreshEditor(), this.refreshDrawing();
950
957
  }), this.layer = e.layers.addSVGLayer({
951
958
  draw: (i) => this.draw(i)
952
- }), this.layer.moveToTop(), this.editor = e.layers.addLayer(o), this.editor.hide();
959
+ }), this.layer.moveToTop(), this.editor = e.layers.addLayer(s), this.editor.hide();
953
960
  }
954
961
  _canRemove() {
955
962
  return !0;
@@ -960,38 +967,38 @@ class Br extends Nr {
960
967
  * @returns the added annotation
961
968
  */
962
969
  add(e) {
963
- const o = this.getDefaultOptions(), i = Object.assign(e, {
964
- id: e.id === void 0 ? ze() : e.id,
970
+ const s = this.getDefaultOptions(), i = Object.assign(e, {
971
+ id: e.id === void 0 ? Ne() : e.id,
965
972
  type: e.type,
966
973
  properties: {
967
- ...o.properties,
974
+ ...s.properties,
968
975
  ...e.properties || {},
969
976
  // styles need to be merged
970
- style: { ...o.properties.style, ...e.properties.style || {} }
977
+ style: { ...s.properties.style, ...e.properties.style || {} }
971
978
  },
972
979
  geometry: {
973
- ...o.geometry,
980
+ ...s.geometry,
974
981
  ...e.geometry
975
982
  }
976
983
  });
977
984
  return this.elements.push(i), this.layer.refresh(), this.emit(hr, i), i;
978
985
  }
979
- updateStyle(e, o) {
986
+ updateStyle(e, s) {
980
987
  this.updateAnnotation(e, {
981
988
  properties: {
982
- style: o
989
+ style: s
983
990
  }
984
991
  });
985
992
  }
986
- updateGeometry(e, o) {
993
+ updateGeometry(e, s) {
987
994
  this.updateAnnotation(e, {
988
- geometry: o
995
+ geometry: s
989
996
  });
990
997
  }
991
- scale(e, o, i, l) {
998
+ scale(e, s, i, l) {
992
999
  this.updateGeometry(
993
1000
  e,
994
- sn(e.geometry, o, i, l)
1001
+ sn(e.geometry, s, i, l)
995
1002
  );
996
1003
  }
997
1004
  /**
@@ -1000,18 +1007,18 @@ class Br extends Nr {
1000
1007
  * @param id Id of the annotation to update
1001
1008
  * @param element params of the annotation
1002
1009
  */
1003
- update(e, o) {
1010
+ update(e, s) {
1004
1011
  const i = this.getById(e);
1005
- this.updateAnnotation(i, o);
1012
+ this.updateAnnotation(i, s);
1006
1013
  }
1007
- updateAnnotation(e, o) {
1014
+ updateAnnotation(e, s) {
1008
1015
  if (!e)
1009
1016
  return;
1010
1017
  const i = e.id;
1011
- Object.keys(o).forEach((l) => {
1018
+ Object.keys(s).forEach((l) => {
1012
1019
  if (l !== "id")
1013
1020
  if (l === "properties") {
1014
- const c = o.properties || { style: {} };
1021
+ const c = s.properties || { style: {} };
1015
1022
  e.properties = {
1016
1023
  ...e.properties || {},
1017
1024
  ...c || {},
@@ -1023,15 +1030,15 @@ class Br extends Nr {
1023
1030
  } else
1024
1031
  l === "geometry" ? e.geometry = {
1025
1032
  ...e.geometry,
1026
- ...o.geometry
1027
- } : e[l] = o[l];
1033
+ ...s.geometry
1034
+ } : e[l] = s[l];
1028
1035
  }), i === this.selectedId && this.refreshEditor(), this.layer.refresh();
1029
1036
  }
1030
1037
  getById(e) {
1031
- const o = Number(e);
1038
+ const s = Number(e);
1032
1039
  for (let i = 0; i < this.elements.length; i++) {
1033
1040
  const l = this.elements[i];
1034
- if (!(l.id !== e && l.id !== o))
1041
+ if (!(l.id !== e && l.id !== s))
1035
1042
  return l;
1036
1043
  }
1037
1044
  }
@@ -1041,12 +1048,12 @@ class Br extends Nr {
1041
1048
  * Select element, show editor, disable Ogma dragging and fire event
1042
1049
  */
1043
1050
  select(e) {
1044
- const o = this.getById(e);
1045
- o && (this.editor.show(), this.selectedId = e, this.refreshEditor(), this.layer.refresh(), this.emit(ar, o));
1051
+ const s = this.getById(e);
1052
+ s && (this.editor.show(), this.selectedId = e, this.refreshEditor(), this.layer.refresh(), this.emit(ar, s));
1046
1053
  }
1047
1054
  hover(e) {
1048
- const o = this.getById(e);
1049
- o && (this.showeditorOnHover && this.editor.show(), this.hoveredId = e, this.refreshEditor(), this.layer.refresh(), this.emit(un, o));
1055
+ const s = this.getById(e);
1056
+ s && (this.showeditorOnHover && this.editor.show(), this.hoveredId = e, this.refreshEditor(), this.layer.refresh(), this.emit(un, s));
1050
1057
  }
1051
1058
  getSelectedFeature() {
1052
1059
  return this.selectedId === Y ? null : this.getById(this.selectedId);
@@ -1065,8 +1072,8 @@ class Br extends Nr {
1065
1072
  * Removes annotation with the given id
1066
1073
  */
1067
1074
  remove(e) {
1068
- const o = this.getById(e);
1069
- e === this.hoveredId && this.unhover(), e === this.selectedId && this.unselect(), this.elements = this.elements.filter((i) => i.id !== e), o && this.emit(ur, o), this.layer.refresh();
1075
+ const s = this.getById(e);
1076
+ e === this.hoveredId && this.unhover(), e === this.selectedId && this.unselect(), this.elements = this.elements.filter((i) => i.id !== e), s && this.emit(ur, s), this.layer.refresh();
1070
1077
  }
1071
1078
  /**
1072
1079
  * @method disableDragging
@@ -1118,7 +1125,7 @@ class Br extends Nr {
1118
1125
  }
1119
1126
  const vr = "handle-line", mr = "handle-start", br = "handle-end";
1120
1127
  class pn extends Br {
1121
- constructor(e, o = {}) {
1128
+ constructor(e, s = {}) {
1122
1129
  super(
1123
1130
  e,
1124
1131
  `
@@ -1132,26 +1139,26 @@ class pn extends Br {
1132
1139
  const l = this.getById(this.selectedId) || this.getById(this.hoveredId);
1133
1140
  if (!l)
1134
1141
  return;
1135
- const { x: c, y: f } = sr(i, this.ogma.getContainer());
1136
- this.startDragging(l, c, f), this.draggedHandle = Lr(i.target);
1142
+ const { x: c, y: g } = sr(i, this.ogma.getContainer());
1143
+ this.startDragging(l, c, g), this.draggedHandle = Lr(i.target);
1137
1144
  }), x(this, "onMouseUp", () => {
1138
1145
  this.draggedHandle !== -1 && (this.restoreDragging(), this.isDragging = !1, this.draggedHandle = Y, this.emit(Vt, this.arrow));
1139
1146
  }), x(this, "onMouseMove", (i) => {
1140
1147
  if (!this.isDragging || this.draggedHandle === Y)
1141
1148
  return;
1142
- const l = this.handles[this.draggedHandle], c = this.ogma.view.getAngle(), { x: f, y: g } = at(
1149
+ const l = this.handles[this.draggedHandle], c = this.ogma.view.getAngle(), { x: g, y } = at(
1143
1150
  an(
1144
- { x: i.clientX - this.startX, y: i.clientY - this.startY },
1151
+ { x: i.x - this.startX, y: i.y - this.startY },
1145
1152
  this.ogma.view.getZoom()
1146
1153
  ),
1147
1154
  c
1148
- ), d = l.id === vr, v = l.id === mr, y = l.id === br;
1149
- (d || v) && Rr(this.arrow, this.start.x + f, this.start.y + g), (d || y) && Ir(this.arrow, this.end.x + f, this.end.y + g), this.emit(
1150
- De,
1155
+ ), f = l.id === vr, m = l.id === mr, v = l.id === br;
1156
+ (f || m) && Rr(this.arrow, this.start.x + g, this.start.y + y), (f || v) && Ir(this.arrow, this.end.x + g, this.end.y + y), this.emit(
1157
+ Me,
1151
1158
  this.arrow,
1152
- d ? "line" : v ? "start" : "end"
1159
+ f ? "line" : m ? "start" : "end"
1153
1160
  ), this.refreshEditor(), this.layer.refresh();
1154
- }), this.minArrowHeight = o.minArrowHeight || 0, this.maxArrowHeight = o.maxArrowHeight || 1e6, this.handles = Array.prototype.slice.call(
1161
+ }), this.minArrowHeight = s.minArrowHeight || 0, this.maxArrowHeight = s.maxArrowHeight || 1e6, this.handles = Array.prototype.slice.call(
1155
1162
  this.editor.element.querySelectorAll(".arrow-handle>.handle")
1156
1163
  ), this.handles.forEach(
1157
1164
  (i) => i.addEventListener("mousedown", this.onHandleMouseDown)
@@ -1163,56 +1170,56 @@ class pn extends Br {
1163
1170
  * @param y
1164
1171
  * @param arrow
1165
1172
  */
1166
- startDrawing(e, o, i = tn(e, o, e, o, ge)) {
1173
+ startDrawing(e, s, i = tn(e, s, e, s, fe)) {
1167
1174
  var l;
1168
1175
  this.disableDragging(), this.add(i), this.hoveredId = i.id;
1169
- const c = this.ogma.view.graphToScreenCoordinates({ x: e, y: o }), f = ((l = this.ogma.getContainer()) == null ? void 0 : l.getBoundingClientRect()) || {
1176
+ const c = this.ogma.view.graphToScreenCoordinates({ x: e, y: s }), g = ((l = this.ogma.getContainer()) == null ? void 0 : l.getBoundingClientRect()) || {
1170
1177
  left: 0,
1171
1178
  top: 0
1172
1179
  };
1173
1180
  this.startDragging(
1174
1181
  this.getById(i.id),
1175
- c.x + (f == null ? void 0 : f.left),
1176
- c.y + f.top
1182
+ c.x + (g == null ? void 0 : g.left),
1183
+ c.y + g.top
1177
1184
  ), this.draggedHandle = 2;
1178
1185
  }
1179
1186
  cancelDrawing() {
1180
1187
  this.isDragging && (this.remove(this.arrow.id), this.emit(Vt, this.arrow), this.restoreDragging(), this.isDragging = !1, this.draggedHandle = Y);
1181
1188
  }
1182
- startDragging(e, o, i) {
1183
- this.selectedId !== e.id && this.select(this.hoveredId), this.arrow = e, this.startX = o, this.startY = i, this.start = fe(this.arrow), this.end = $e(this.arrow), this.disableDragging(), this.emit(Me, this.arrow), this.isDragging = !0;
1189
+ startDragging(e, s, i) {
1190
+ this.selectedId !== e.id && this.select(this.hoveredId), this.arrow = e, this.startX = s, this.startY = i, this.start = de(this.arrow), this.end = $e(this.arrow), this.disableDragging(), this.emit(ze, this.arrow), this.isDragging = !0;
1184
1191
  }
1185
- detect(e, o = 0) {
1192
+ detect(e, s = 0) {
1186
1193
  return this.elements.find((i) => {
1187
- const { start: l, end: c } = je(i), f = Ct(e, {
1194
+ const { start: l, end: c } = De(i), g = Ct(e, {
1188
1195
  x: (l.x + c.x) / 2,
1189
1196
  y: (l.y + c.y) / 2
1190
- }), g = Ct(c, l), d = Ut(g), v = $r(g), y = Dr(i);
1191
- return Math.abs(pr(v, f)) < d / 2 + o && Math.abs(pr(at(v, Math.PI / 2), f)) < y / 2 + o;
1197
+ }), y = Ct(c, l), f = Ut(y), m = jr(y), v = Dr(i);
1198
+ return Math.abs(pr(m, g)) < f / 2 + s && Math.abs(pr(at(m, Math.PI / 2), g)) < v / 2 + s;
1192
1199
  });
1193
1200
  }
1194
1201
  refreshEditor() {
1195
1202
  if (+this.selectedId < 0 && +this.hoveredId < 0)
1196
1203
  return;
1197
- const e = this.selectedId !== Y ? this.getById(this.selectedId) : this.getById(this.hoveredId), o = je(e), i = this.ogma.view.graphToScreenCoordinates(o.start), l = this.ogma.view.graphToScreenCoordinates(o.end), [c, f, g] = Array.prototype.slice.call(
1204
+ const e = this.selectedId !== Y ? this.getById(this.selectedId) : this.getById(this.hoveredId), s = De(e), i = this.ogma.view.graphToScreenCoordinates(s.start), l = this.ogma.view.graphToScreenCoordinates(s.end), [c, g, y] = Array.prototype.slice.call(
1198
1205
  this.editor.element.querySelectorAll(".handle")
1199
1206
  );
1200
- f.style.transform = `translate(${i.x}px, ${i.y}px) translate(-50%, -50%)`, g.style.transform = `translate(${l.x}px, ${l.y}px) translate(-50%, -50%)`;
1201
- const d = {
1207
+ g.style.transform = `translate(${i.x}px, ${i.y}px) translate(-50%, -50%)`, y.style.transform = `translate(${l.x}px, ${l.y}px) translate(-50%, -50%)`;
1208
+ const f = {
1202
1209
  x: (l.x + i.x) / 2,
1203
1210
  y: (l.y + i.y) / 2
1204
- }, v = Ct(l, i), y = jr(v, 1 / Ut(v)), _ = Math.atan2(y.y, y.x);
1205
- c.style.width = `${Ut(v)}px`, c.style.left = `${d.x}px`, c.style.top = `${d.y}px`, c.style.transform = `translate(-50%, -50%) rotate(${_}rad)`;
1211
+ }, m = Ct(l, i), v = $r(m, 1 / Ut(m)), k = Math.atan2(v.y, v.x);
1212
+ c.style.width = `${Ut(m)}px`, c.style.left = `${f.x}px`, c.style.top = `${f.y}px`, c.style.transform = `translate(-50%, -50%) rotate(${k}rad)`;
1206
1213
  }
1207
1214
  getDefaultOptions() {
1208
1215
  return gr;
1209
1216
  }
1210
1217
  draw(e) {
1211
1218
  e.innerHTML = "";
1212
- const o = de("g"), i = this.ogma.view.getAngle();
1213
- o.setAttribute("transform", `rotate(${-i * (180 / Math.PI)})`), this.elements.forEach(
1214
- (l) => ln(l, o, ge, this.minArrowHeight, this.maxArrowHeight)
1215
- ), e.appendChild(o);
1219
+ const s = ce("g"), i = this.ogma.view.getAngle();
1220
+ s.setAttribute("transform", `rotate(${-i * (180 / Math.PI)})`), this.elements.forEach(
1221
+ (l) => ln(l, s, fe, this.minArrowHeight, this.maxArrowHeight)
1222
+ ), e.appendChild(s);
1216
1223
  }
1217
1224
  refreshDrawing() {
1218
1225
  const e = this.ogma.view.getAngle();
@@ -1258,8 +1265,8 @@ const Wt = {
1258
1265
  }, wr = {
1259
1266
  handleSize: 3.5,
1260
1267
  placeholder: "Your text..."
1261
- }, yn = (u = 0, e = 0, o = 100, i = 50, l = "", c = { ...Wt }) => ({
1262
- id: ze(),
1268
+ }, yn = (h = 0, e = 0, s = 100, i = 50, l = "", c = { ...Wt }) => ({
1269
+ id: Ne(),
1263
1270
  type: "Feature",
1264
1271
  properties: {
1265
1272
  type: "text",
@@ -1270,23 +1277,23 @@ const Wt = {
1270
1277
  type: "Polygon",
1271
1278
  coordinates: [
1272
1279
  [
1273
- [u, e],
1274
- [u + o, e],
1275
- [u + o, e + i],
1276
- [u, e + i],
1277
- [u, e]
1280
+ [h, e],
1281
+ [h + s, e],
1282
+ [h + s, e + i],
1283
+ [h, e + i],
1284
+ [h, e]
1278
1285
  ]
1279
1286
  ]
1280
1287
  }
1281
1288
  });
1282
1289
  var Hr = { exports: {} };
1283
- (function(u, e) {
1284
- (function(o, i) {
1285
- u.exports = i();
1290
+ (function(h, e) {
1291
+ (function(s, i) {
1292
+ h.exports = i();
1286
1293
  })(fn, () => (() => {
1287
- var o = { d: (r, n) => {
1294
+ var s = { d: (r, n) => {
1288
1295
  for (var a in n)
1289
- o.o(n, a) && !o.o(r, a) && Object.defineProperty(r, a, { enumerable: !0, get: n[a] });
1296
+ s.o(n, a) && !s.o(r, a) && Object.defineProperty(r, a, { enumerable: !0, get: n[a] });
1290
1297
  }, o: (r, n) => Object.prototype.hasOwnProperty.call(r, n) }, i = {};
1291
1298
  function l(r) {
1292
1299
  return l = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
@@ -1295,67 +1302,67 @@ var Hr = { exports: {} };
1295
1302
  return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
1296
1303
  }, l(r);
1297
1304
  }
1298
- o.d(i, { default: () => Ke });
1299
- 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 };
1300
- function _(r) {
1305
+ s.d(i, { default: () => Pe });
1306
+ var c = /^((?:[a-z\d-]+\s+)*)([\d.]+(%|em|px)|(?:x+-)?large|(?:x+-)?small|medium)(?:\s*\/\s*(normal|[\d.]+(%|px|em)?))?(\s.+)?$/, g = /\bsmall-caps\b/, y = /\b(?:italic|oblique)\b/, f = /\bbold(?:er)?\b/, m = 13.3333333, v = { "xx-small": 9, "x-small": 10, smaller: 13.3333, small: 13, medium: 16, large: 18, larger: 19.2, "x-large": 24, "xx-large": 32 };
1307
+ function k(r) {
1301
1308
  var n = "", a = this;
1302
1309
  return a.style && a.style !== "normal" && (n += a.style), a.variant && a.variant !== "normal" && (n += (n ? " " : "") + a.variant), a.weight && a.weight !== "normal" && (n += (n ? " " : "") + a.weight), a.size && (n += (n ? " " : "") + a.size + "px", a.height !== a.size && (n += "/" + a.height + "px")), a.family && (n += (n ? " " : "") + a.family), r && (n += "::" + a.baseline), r && (n += "::" + a.color), n;
1303
1310
  }
1304
- var C = { id: "", family: "sans-serif", height: 14, size: 12, variant: "", style: "", weight: "", baseline: "", color: null, toString: _, valueOf: _ };
1305
- function E(r) {
1311
+ var C = { id: "", family: "sans-serif", height: 14, size: 12, variant: "", style: "", weight: "", baseline: "", color: null, toString: k, valueOf: k };
1312
+ function _(r) {
1306
1313
  var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, a = c.exec(r);
1307
1314
  n.family = (a[6] || "").trim();
1308
- var t = y[a[2]] || parseFloat(a[2]);
1309
- a[3] === "%" ? t *= 0.16 : a[3] === "em" ? t *= 16 : a[3] === "pt" && (t *= v), n.size = t;
1310
- var s = parseFloat(a[4]);
1311
- if (s !== "normal" && s !== "inherit" && s ? a[5] && a[5] !== "em" ? a[5] === "pt" ? n.height = s * v : a[5] === "%" ? n.height = 0.01 * t : n.height = s : n.height = s * t : n.height = Math.round(t * (7 / 6)), f.test(a[1]) && (n.variant = "small-caps"), g.test(a[1]) && (n.style = "italic"), d.test(a[1]))
1315
+ var o = v[a[2]] || parseFloat(a[2]);
1316
+ a[3] === "%" ? o *= 0.16 : a[3] === "em" ? o *= 16 : a[3] === "pt" && (o *= m), n.size = o;
1317
+ var t = parseFloat(a[4]);
1318
+ if (t !== "normal" && t !== "inherit" && t ? a[5] && a[5] !== "em" ? a[5] === "pt" ? n.height = t * m : a[5] === "%" ? n.height = 0.01 * o : n.height = t : n.height = t * o : n.height = Math.round(o * (7 / 6)), g.test(a[1]) && (n.variant = "small-caps"), y.test(a[1]) && (n.style = "italic"), f.test(a[1]))
1312
1319
  n.weight = "bold";
1313
1320
  else {
1314
- var h = parseInt(/\b(\d+)\b/.exec(a[1]), 10);
1315
- h >= 100 && h !== 400 && (n.weight = h);
1321
+ var u = parseInt(/\b(\d+)\b/.exec(a[1]), 10);
1322
+ u >= 100 && u !== 400 && (n.weight = u);
1316
1323
  }
1317
1324
  return n;
1318
1325
  }
1319
- function P() {
1320
- var r, n, 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] : {}, h = 14, p = 12, m = null, w = null, b = "";
1321
- if (t && t.nodeType) {
1322
- var A = t && (t.ownerDocument && t.ownerDocument.defaultView || t.document && t || t.defaultView), R = A.getComputedStyle(t, null);
1323
- r = R.getPropertyValue("font-family") || "", p = parseFloat(R.getPropertyValue("font-size")), h = R.getPropertyValue("line-height"), m = R.getPropertyValue("font-weight"), w = R.getPropertyValue("font-style"), b = R.getPropertyValue("font-variant") || "";
1324
- } else if (typeof t == "string") {
1325
- var k = E(t);
1326
- r = k.family, p = k.size, h = k.height, b = k.variant, w = k.style, m = k.weight;
1326
+ function R() {
1327
+ var r, n, a, o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "12px/14px sans-serif", t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, u = 14, d = 12, p = null, b = null, w = "";
1328
+ if (o && o.nodeType) {
1329
+ var A = o && (o.ownerDocument && o.ownerDocument.defaultView || o.document && o || o.defaultView), E = A.getComputedStyle(o, null);
1330
+ r = E.getPropertyValue("font-family") || "", d = parseFloat(E.getPropertyValue("font-size")), u = E.getPropertyValue("line-height"), p = E.getPropertyValue("font-weight"), b = E.getPropertyValue("font-style"), w = E.getPropertyValue("font-variant") || "";
1331
+ } else if (typeof o == "string") {
1332
+ var O = _(o);
1333
+ r = O.family, d = O.size, u = O.height, w = O.variant, b = O.style, p = O.weight;
1327
1334
  } else
1328
- l(t) === "object" && (r = t.family, p = t.size, h = t.height, b = t.variant, m = t.weight, w = t.style, n = t.baseline, a = t.color);
1329
- s.size && s.size < 3 && (p *= s.size), h = h !== "normal" && h ? parseFloat(h) : p * (7 / 6), s.height && s.height < 3 && (h *= s.height);
1330
- var O = Object.create(C);
1331
- return O.family = s.family || r || "sans-serif", O.height = h ?? 14, O.size = p ?? 12, O.variant = s.variant || b || "", O.style = s.style || w || "", O.weight = s.weight || m || "", O.baseline = n || 0, s.baseline != null && (O.baseline = s.baseline), O.color = s.color || a || "", O.id = _.call(O, !0), O;
1335
+ l(o) === "object" && (r = o.family, d = o.size, u = o.height, w = o.variant, p = o.weight, b = o.style, n = o.baseline, a = o.color);
1336
+ t.size && t.size < 3 && (d *= t.size), u = u !== "normal" && u ? parseFloat(u) : d * (7 / 6), t.height && t.height < 3 && (u *= t.height);
1337
+ var P = Object.create(C);
1338
+ return P.family = t.family || r || "sans-serif", P.height = u ?? 14, P.size = d ?? 12, P.variant = t.variant || w || "", P.style = t.style || b || "", P.weight = t.weight || p || "", P.baseline = n || 0, t.baseline != null && (P.baseline = t.baseline), P.color = t.color || a || "", P.id = k.call(P, !0), P;
1332
1339
  }
1333
1340
  const S = { "\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 };
1334
- var $, L = function(r) {
1341
+ var D, L = function(r) {
1335
1342
  var n = typeof OffscreenCanvas < "u" && new OffscreenCanvas(100, 100) || r && r.createElement("canvas");
1336
1343
  if (n && n.getContext) {
1337
1344
  var a = n.getContext("2d");
1338
1345
  if (a && typeof a.measureText == "function")
1339
- return function(t, s) {
1340
- return a.font = String(s), a.measureText(t).width;
1346
+ return function(o, t) {
1347
+ return a.font = String(t), a.measureText(o).width;
1341
1348
  };
1342
1349
  }
1343
- }(typeof document < "u" ? document : null) || ($ = {}, function(r, n) {
1344
- if (!$[n]) {
1345
- var a = P(n);
1346
- $[n] = a, /\bmonospace\b/.test(a.family) ? a.size *= 0.6 : (a.size *= 0.45, a.weight && (a.size *= 1.18));
1350
+ }(typeof document < "u" ? document : null) || (D = {}, function(r, n) {
1351
+ if (!D[n]) {
1352
+ var a = R(n);
1353
+ D[n] = a, /\bmonospace\b/.test(a.family) ? a.size *= 0.6 : (a.size *= 0.45, a.weight && (a.size *= 1.18));
1347
1354
  }
1348
- return r.length * $[n].size;
1349
- }), T = {}, B = { trim: !0, collapse: !0 };
1350
- function N(r, n, a) {
1351
- var t = Object.assign({}, B, a), s = String(r);
1352
- if (!s)
1355
+ return r.length * D[n].size;
1356
+ }), T = {}, U = { trim: !0, collapse: !0 };
1357
+ function H(r, n, a) {
1358
+ var o = Object.assign({}, U, a), t = String(r);
1359
+ if (!t)
1353
1360
  return 0;
1354
- if (s in S) {
1355
- var h = n.id + "/" + s;
1356
- return h in T || (T[h] = L("_".concat(s, "_"), n) - L("__", n)), T[h];
1361
+ if (t in S) {
1362
+ var u = n.id + "/" + t;
1363
+ return u in T || (T[u] = L("_".concat(t, "_"), n) - L("__", n)), T[u];
1357
1364
  }
1358
- return t.trim && t.collapse ? t.trim ? s = s.trim() : t.collapse && (s = s.replace(/\s+/g, " ")) : s = s.replace(/\n/g, " "), L(s, n) + n.size * (r.tracking || 0);
1365
+ return o.trim && o.collapse ? o.trim ? t = t.trim() : o.collapse && (t = t.replace(/\s+/g, " ")) : t = t.replace(/\n/g, " "), L(t, n) + n.size * (r.tracking || 0);
1359
1366
  }
1360
1367
  function it(r) {
1361
1368
  return it = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
@@ -1364,14 +1371,14 @@ var Hr = { exports: {} };
1364
1371
  return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
1365
1372
  }, it(r);
1366
1373
  }
1367
- function xt(r, n) {
1374
+ function At(r, n) {
1368
1375
  if (typeof n != "function" && n !== null)
1369
1376
  throw new TypeError("Super expression must either be null or a function");
1370
1377
  r.prototype = Object.create(n && n.prototype, { constructor: { value: r, writable: !0, configurable: !0 } }), Object.defineProperty(r, "prototype", { writable: !1 }), n && qt(r, n);
1371
1378
  }
1372
1379
  function qt(r, n) {
1373
- return qt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(a, t) {
1374
- return a.__proto__ = t, a;
1380
+ return qt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(a, o) {
1381
+ return a.__proto__ = o, a;
1375
1382
  }, qt(r, n);
1376
1383
  }
1377
1384
  function Yt(r) {
@@ -1388,16 +1395,16 @@ var Hr = { exports: {} };
1388
1395
  }
1389
1396
  }();
1390
1397
  return function() {
1391
- var a, t = Ot(r);
1398
+ var a, o = Ot(r);
1392
1399
  if (n) {
1393
- var s = Ot(this).constructor;
1394
- a = Reflect.construct(t, arguments, s);
1400
+ var t = Ot(this).constructor;
1401
+ a = Reflect.construct(o, arguments, t);
1395
1402
  } else
1396
- a = t.apply(this, arguments);
1397
- return pe(this, a);
1403
+ a = o.apply(this, arguments);
1404
+ return ge(this, a);
1398
1405
  };
1399
1406
  }
1400
- function pe(r, n) {
1407
+ function ge(r, n) {
1401
1408
  if (n && (it(n) === "object" || typeof n == "function"))
1402
1409
  return n;
1403
1410
  if (n !== void 0)
@@ -1417,28 +1424,28 @@ var Hr = { exports: {} };
1417
1424
  if (!(r instanceof n))
1418
1425
  throw new TypeError("Cannot call a class as a function");
1419
1426
  }
1420
- function Gt(r, n) {
1427
+ function pe(r, n) {
1421
1428
  for (var a = 0; a < n.length; a++) {
1422
- var t = n[a];
1423
- t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(r, (s = function(h, p) {
1424
- if (it(h) !== "object" || h === null)
1425
- return h;
1426
- var m = h[Symbol.toPrimitive];
1427
- if (m !== void 0) {
1428
- var w = m.call(h, p);
1429
- if (it(w) !== "object")
1430
- return w;
1429
+ var o = n[a];
1430
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(r, (t = function(u, d) {
1431
+ if (it(u) !== "object" || u === null)
1432
+ return u;
1433
+ var p = u[Symbol.toPrimitive];
1434
+ if (p !== void 0) {
1435
+ var b = p.call(u, d);
1436
+ if (it(b) !== "object")
1437
+ return b;
1431
1438
  throw new TypeError("@@toPrimitive must return a primitive value.");
1432
1439
  }
1433
- return String(h);
1434
- }(t.key, "string"), it(s) === "symbol" ? s : String(s)), t);
1440
+ return String(u);
1441
+ }(o.key, "string"), it(t) === "symbol" ? t : String(t)), o);
1435
1442
  }
1436
- var s;
1443
+ var t;
1437
1444
  }
1438
1445
  function tt(r, n, a) {
1439
- return n && Gt(r.prototype, n), a && Gt(r, a), Object.defineProperty(r, "prototype", { writable: !1 }), r;
1446
+ return n && pe(r.prototype, n), Object.defineProperty(r, "prototype", { writable: !1 }), r;
1440
1447
  }
1441
- var D = function() {
1448
+ var z = function() {
1442
1449
  function r() {
1443
1450
  var n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
1444
1451
  Pt(this, r), this.value = n, this.weight = null, this.style = null, this.font = null, this.href = null, this.sub = !1, this.sup = !1;
@@ -1452,42 +1459,42 @@ var Hr = { exports: {} };
1452
1459
  return this.value;
1453
1460
  } }]), r;
1454
1461
  }(), lt = function(r) {
1455
- xt(a, r);
1462
+ At(a, r);
1456
1463
  var n = Yt(a);
1457
1464
  function a() {
1458
1465
  return Pt(this, a), n.apply(this, arguments);
1459
1466
  }
1460
1467
  return tt(a);
1461
- }(D), G = function(r) {
1462
- xt(a, r);
1468
+ }(z), X = function(r) {
1469
+ At(a, r);
1463
1470
  var n = Yt(a);
1464
1471
  function a() {
1465
1472
  return Pt(this, a), n.apply(this, arguments);
1466
1473
  }
1467
1474
  return tt(a);
1468
- }(D), ut = function(r) {
1469
- xt(a, r);
1475
+ }(z), ut = function(r) {
1476
+ At(a, r);
1470
1477
  var n = Yt(a);
1471
1478
  function a() {
1472
1479
  return Pt(this, a), n.apply(this, arguments);
1473
1480
  }
1474
1481
  return tt(a);
1475
- }(D), Rt = /^[\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]/;
1476
- function At(r, n) {
1482
+ }(z), Rt = /^[\n\r\t\x20\xA0\u2000-\u200B\u205F\u3000]/, ye = /^[^\n\r\t\u0020\u2000-\u200B\u205F\u3000]{2,}/, Gt = /^[\xA0\u2011\u202F\u2060\uFEFF]/, ve = /^(?:[;\xAD%?…]|,(?!\d))/, me = /^[´±°¢£¤$¥\u2212]/;
1483
+ function Et(r, n) {
1477
1484
  n !== !1 && (r = r.trim());
1478
- for (var a, t, s = [], h = r.charAt(0), p = 0, m = 1, w = r.length; m < w; m++) {
1479
- a = r.charAt(m), t = r.charAt(m + 1);
1480
- var b = Rt.test(h), A = Rt.test(a), R = A || b, k = void 0;
1481
- if ((me.test(a) && !Xt.test(h) || ve.test(h + t) && !Xt.test(a)) && (R = !0), h !== "-" && h !== "‐" && h !== "–" && h !== "—" || ((k = Rt.test(r.charAt(m - 2))) && !A && (R = !1), !k && ye.test(a + t) && (R = !0)), R) {
1482
- var O = r.slice(p, m);
1483
- /\u00AD$/.test(O) ? (s.push(new D(O.slice(0, -1))), s.push(new ut())) : (s.push(new D(O)), s.push(new lt())), p = m;
1485
+ for (var a, o, t = [], u = r.charAt(0), d = 0, p = 1, b = r.length; p < b; p++) {
1486
+ a = r.charAt(p), o = r.charAt(p + 1);
1487
+ var w = Rt.test(u), A = Rt.test(a), E = A || w, O = void 0;
1488
+ if ((me.test(a) && !Gt.test(u) || ve.test(u + o) && !Gt.test(a)) && (E = !0), u !== "-" && u !== "‐" && u !== "–" && u !== "—" || ((O = Rt.test(r.charAt(p - 2))) && !A && (E = !1), !O && ye.test(a + o) && (E = !0)), E) {
1489
+ var P = r.slice(d, p);
1490
+ /\u00AD$/.test(P) ? (t.push(new z(P.slice(0, -1))), t.push(new ut())) : (t.push(new z(P)), t.push(new lt())), d = p;
1484
1491
  }
1485
- h = a;
1492
+ u = a;
1486
1493
  }
1487
- return s.push(new D(r.slice(p))), s;
1494
+ return t.push(new z(r.slice(d))), t;
1488
1495
  }
1489
1496
  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: "›" };
1490
- var Ne = /^[\n\r\x20\u2000-\u200B\u205F\u3000]/, Jt = /^<\/([a-zA-Z0-9]+)([^>]*)>/, Zt = /^<([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, Et = { b: function(r) {
1497
+ var Be = /^[\n\r\x20\u2000-\u200B\u205F\u3000]/, Xt = /^<\/([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) {
1491
1498
  r.weight = "bold";
1492
1499
  }, strong: function(r) {
1493
1500
  r.weight = "bold";
@@ -1513,27 +1520,27 @@ var Hr = { exports: {} };
1513
1520
  r.sub = !0;
1514
1521
  }, sup: function(r) {
1515
1522
  r.sup = !0;
1516
- } }, 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 };
1517
- function Qt(r) {
1518
- return r.replace(Kt, function(n, a, t, s) {
1519
- if (a || t) {
1520
- var h = a ? 10 : 16;
1521
- return String.fromCharCode(parseInt(a || t, h));
1523
+ } }, He = { 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 };
1524
+ function Zt(r) {
1525
+ return r.replace(Kt, function(n, a, o, t) {
1526
+ if (a || o) {
1527
+ var u = a ? 10 : 16;
1528
+ return String.fromCharCode(parseInt(a || o, u));
1522
1529
  }
1523
- return s in be ? be[s] : n;
1530
+ return t in be ? be[t] : n;
1524
1531
  });
1525
1532
  }
1526
- function He(r) {
1533
+ function Ue(r) {
1527
1534
  return r && r.length > 1 && (r[0] === '"' && r[r.length - 1] === '"' || r[0] === "'" && r[r.length - 1] === "'") ? r.slice(1, -1) : r;
1528
1535
  }
1529
- var Ue = /^\s*([^=\s&]+)(?:\s*=\s*("[^"]+"|'[^']+'|[^>\s]+))?/;
1536
+ var We = /^\s*([^=\s&]+)(?:\s*=\s*("[^"]+"|'[^']+'|[^>\s]+))?/;
1530
1537
  function Lt(r) {
1531
1538
  var n, a = {};
1532
1539
  if (r) {
1533
1540
  do
1534
- if (n = Ue.exec(r)) {
1535
- var t = Qt(He(n[2] || "")).replace(/[ \r\n\t]+/g, " ").trim();
1536
- if (a[n[1]] = t, (r = r.slice(n[0].length)).length && /^\S/.test(r[0]))
1541
+ if (n = We.exec(r)) {
1542
+ var o = Zt(Ue(n[2] || "")).replace(/[ \r\n\t]+/g, " ").trim();
1543
+ if (a[n[1]] = o, (r = r.slice(n[0].length)).length && /^\S/.test(r[0]))
1537
1544
  throw new Error("Attribute error");
1538
1545
  }
1539
1546
  while (n && r.length);
@@ -1542,8 +1549,8 @@ var Hr = { exports: {} };
1542
1549
  }
1543
1550
  return a;
1544
1551
  }
1545
- const _t = { 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: "Þ" };
1546
- var we = /^(\^|_|\\[^#$%&~_^\\{}()\s]+)(\{)?/, xe = /^%[^\n]+(?:\n|$)/, Ft = /^[^#$%&~_^\\{}]+/, We = /^\\([&{}$%#_])/, Ve = /(?:\\[\\@,!:;-]|-{2,3}|[!?]`|``?|,,|''?|~|<<|>>)/g, te = { "---": "—", "--": "–", "!`": "¡", "?`": "¿", "``": "“", ",,": "„", "''": "”", "`": "‘", "'": "’", "<<": "«", ">>": "»", "~": " ", "\\-": "­", "\\,": " ", "\\;": " ", "\\:": " ", "\\!": " ", "\\@": "\uFEFF", "\\\\": "\\newline{}" }, H = { bf: function(r) {
1552
+ 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: "Þ" };
1553
+ var we = /^(\^|_|\\[^#$%&~_^\\{}()\s]+)(\{)?/, xe = /^%[^\n]+(?:\n|$)/, Ft = /^[^#$%&~_^\\{}]+/, Ve = /^\\([&{}$%#_])/, qe = /(?:\\[\\@,!:;-]|-{2,3}|[!?]`|``?|,,|''?|~|<<|>>)/g, Qt = { "---": "—", "--": "–", "!`": "¡", "?`": "¿", "``": "“", ",,": "„", "''": "”", "`": "‘", "'": "’", "<<": "«", ">>": "»", "~": " ", "\\-": "­", "\\,": " ", "\\;": " ", "\\:": " ", "\\!": " ", "\\@": "\uFEFF", "\\\\": "\\newline{}" }, W = { bf: function(r) {
1547
1554
  r.weight = "bold";
1548
1555
  }, it: function(r) {
1549
1556
  r.style = "italic";
@@ -1558,23 +1565,23 @@ var Hr = { exports: {} };
1558
1565
  }, _: function(r) {
1559
1566
  r.sub = !0;
1560
1567
  }, par: function(r) {
1561
- this.tokens.push(new G(), new G());
1568
+ this.tokens.push(new X(), new X());
1562
1569
  }, newline: function(r) {
1563
- this.tokens.push(new G());
1570
+ this.tokens.push(new X());
1564
1571
  }, url: function(r, n) {
1565
- this.open_context().href = n, this.add_token(new D(n)), this.close_context();
1572
+ this.open_context().href = n, this.add_token(new z(n)), this.close_context();
1566
1573
  } };
1567
- H.textsuperscript = H["^"], H.textsubscript = H._, H.textsl = H.sl, H.mathbf = H.bf, H.mathit = H.it, H.textbf = H.bf, H.textit = H.it, H.textcolor = H.color;
1568
- var qe = /[\r\n\xA0]+/g;
1574
+ W.textsuperscript = W["^"], W.textsubscript = W._, W.textsl = W.sl, W.mathbf = W.bf, W.mathit = W.it, W.textbf = W.bf, W.textit = W.it, W.textcolor = W.color;
1575
+ var Ye = /[\r\n\xA0]+/g;
1569
1576
  function Ae(r, n) {
1570
1577
  r.sup && (r.baseline = 0.45, r.size = 0.7), r.sub && (r.baseline = -0.3, r.size = 0.7);
1571
1578
  var a = n;
1572
- return (r.style || r.weight || r.baseline || r.color || r.size || r.family) && (a = P(n, r)), a;
1579
+ return (r.style || r.weight || r.baseline || r.color || r.size || r.family) && (a = R(n, r)), a;
1573
1580
  }
1574
- function ee(r, n, a) {
1575
- for (var t, s, h = r.width; h + a.width > n && r.length; )
1576
- s = (t = r[r.length - 1]).width, t.width > a.width ? (t.value = t.value.slice(0, -1), t.width = N(t, t.font), h += t.width) : r.pop(), h -= s;
1577
- r[r.length - 1] instanceof ut && r.pop(), t = r[r.length - 1] || t || {}, a.font = P(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
+ function te(r, n, a) {
1582
+ for (var o, t, u = r.width; u + a.width > n && r.length; )
1583
+ t = (o = r[r.length - 1]).width, o.width > a.width ? (o.value = o.value.slice(0, -1), o.width = H(o, o.font), u += o.width) : r.pop(), u -= t;
1584
+ r[r.length - 1] instanceof ut && r.pop(), o = r[r.length - 1] || o || {}, a.font = R(a.font, o.bold, o.italic, ""), a.href = r.length ? o.href : null, a.rel = r.length ? o.rel : null, a.target = r.length ? o.target : null, r.push(a);
1578
1585
  }
1579
1586
  function ot(r) {
1580
1587
  return Math.round(1e6 * r) / 1e6;
@@ -1582,92 +1589,92 @@ var Hr = { exports: {} };
1582
1589
  function Ee(r) {
1583
1590
  return function(n) {
1584
1591
  if (Array.isArray(n))
1585
- return $t(n);
1592
+ return jt(n);
1586
1593
  }(r) || function(n) {
1587
1594
  if (typeof Symbol < "u" && n[Symbol.iterator] != null || n["@@iterator"] != null)
1588
1595
  return Array.from(n);
1589
1596
  }(r) || function(n, a) {
1590
1597
  if (n) {
1591
1598
  if (typeof n == "string")
1592
- return $t(n, a);
1593
- var t = Object.prototype.toString.call(n).slice(8, -1);
1594
- return t === "Object" && n.constructor && (t = n.constructor.name), t === "Map" || t === "Set" ? Array.from(n) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? $t(n, a) : void 0;
1599
+ return jt(n, a);
1600
+ var o = Object.prototype.toString.call(n).slice(8, -1);
1601
+ return o === "Object" && n.constructor && (o = n.constructor.name), o === "Map" || o === "Set" ? Array.from(n) : o === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o) ? jt(n, a) : void 0;
1595
1602
  }
1596
1603
  }(r) || function() {
1597
1604
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
1598
1605
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
1599
1606
  }();
1600
1607
  }
1601
- function $t(r, n) {
1608
+ function jt(r, n) {
1602
1609
  (n == null || n > r.length) && (n = r.length);
1603
- for (var a = 0, t = new Array(n); a < n; a++)
1604
- t[a] = r[a];
1605
- return t;
1610
+ for (var a = 0, o = new Array(n); a < n; a++)
1611
+ o[a] = r[a];
1612
+ return o;
1606
1613
  }
1607
- var _e = { center: "middle", right: "end" }, re = { middle: 0.5, center: 0.5, bottom: 1, end: 1 }, ne = function(r, n) {
1614
+ var _e = { center: "middle", right: "end" }, ee = { middle: 0.5, center: 0.5, bottom: 1, end: 1 }, re = function(r, n) {
1608
1615
  return !r && !n || r === n;
1609
1616
  };
1610
- function Ye(r, n) {
1611
- var a = [], t = n.font(), s = t.size, h = t.family, p = n.align(), m = n.createElement();
1617
+ function Ge(r, n) {
1618
+ var a = [], o = n.font(), t = o.size, u = o.family, d = n.align(), p = n.createElement();
1612
1619
  if (r.length) {
1613
- var w = t.height, b = n.valign(), A = n.height()(), R = n.width()(0), k = !isFinite(R) && r.length === 1, O = k ? null : n.x(), j = ot(w / s), U = k ? null : ot(w / (1.15 * s + (w - s) / 2));
1614
- if (re[b] && isFinite(A)) {
1615
- var M = b === "bottom" ? 1 : 0.5;
1616
- U += (A * M - w * r.length * M) / s;
1620
+ var b = o.height, w = n.valign(), A = n.height()(), E = n.width()(0), O = !isFinite(E) && r.length === 1, P = O ? null : n.x(), I = ot(b / t), B = O ? null : ot(b / (1.15 * t + (b - t) / 2));
1621
+ if (ee[w] && isFinite(A)) {
1622
+ var M = w === "bottom" ? 1 : 0.5;
1623
+ B += (A * M - b * r.length * M) / t;
1617
1624
  }
1618
- var I = p === "justify", W = 0;
1619
- p === "right" ? W = R : p === "center" && (W = R / 2);
1620
- for (var z = [], et = "tspan", J = null, V = "", F = function() {
1625
+ var F = d === "justify", $ = 0;
1626
+ d === "right" ? $ = E : d === "center" && ($ = E / 2);
1627
+ for (var N = [], K = "tspan", G = null, V = "", j = function() {
1621
1628
  if (V) {
1622
- var Tt = m(et, J, V);
1623
- z.push(Tt);
1629
+ var Tt = p(K, G, V);
1630
+ N.push(Tt);
1624
1631
  }
1625
- et = "tspan", J = null, V = "";
1632
+ K = "tspan", G = null, V = "";
1626
1633
  }, nt = 0, rt = r.length; nt < rt; nt++) {
1627
- var ft = "", bt = "", ct = 0, gt = r[nt];
1634
+ var ft = "", wt = "", ct = 0, gt = r[nt];
1628
1635
  if (gt.length) {
1629
- z = [];
1630
- for (var Mt = 0, le = 0, pt = void 0, Z = 0, Pe = gt.length; Z < Pe; Z++) {
1631
- var q = gt[Z], K = q.font;
1632
- q.whitespace && Mt++, le += q.width, Z && !q.tracking && !ct && ne(K.id, ft) && ne(q.class, bt) && ne(pt, q.href) ? V += q.value : (F(), V = q.value, J = { fontFamily: K.family !== h ? K.family : null, fontSize: K.size !== s ? K.size : null, fontWeight: K.weight || null, fontStyle: K.style || null, fontVariant: K.variant !== "normal" && K.variant || null, fill: K.color || null, baselineShift: K.baseline ? 100 * K.baseline + "%" : null, className: q.class || null }, ct && (J.dx = ot(ct), ct = 0), q.tracking && (ct = K.size * q.tracking), q.href && !pt ? (pt = q.href, et = "a", J.href = pt, J.rel = q.rel, J.target = q.target) : pt = null, ft = K.id, bt = q.class);
1636
+ N = [];
1637
+ for (var Mt = 0, ae = 0, pt = void 0, Z = 0, Re = gt.length; Z < Re; Z++) {
1638
+ var q = gt[Z], Q = q.font;
1639
+ q.whitespace && Mt++, ae += q.width, Z && !q.tracking && !ct && re(Q.id, ft) && re(q.class, wt) && re(pt, q.href) ? V += q.value : (j(), V = q.value, G = { fontFamily: Q.family !== u ? Q.family : null, fontSize: Q.size !== t ? 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: q.class || null }, ct && (G.dx = ot(ct), ct = 0), q.tracking && (ct = Q.size * q.tracking), q.href && !pt ? (pt = q.href, K = "a", G.href = pt, G.rel = q.rel, G.target = q.target) : pt = null, ft = Q.id, wt = q.class);
1633
1640
  }
1634
- if (F(), k)
1635
- a.push.apply(a, Ee(z));
1641
+ if (j(), O)
1642
+ a.push.apply(a, Ee(N));
1636
1643
  else {
1637
- var Re = null, ue = nt === rt - 1 || gt[gt.length - 1] instanceof G;
1638
- I && gt.length > 1 && !ue && (Re = ot((R - le) / Mt)), a.push(m.apply(void 0, ["tspan", { wordSpacing: Re, x: O(nt) + W, dy: ot(nt ? j : U) + "em" }].concat(Ee(z))));
1644
+ var Ie = null, le = nt === rt - 1 || gt[gt.length - 1] instanceof X;
1645
+ F && gt.length > 1 && !le && (Ie = ot((E - ae) / Mt)), a.push(p.apply(void 0, ["tspan", { wordSpacing: Ie, x: P(nt) + $, dy: ot(nt ? I : B) + "em" }].concat(Ee(N))));
1639
1646
  }
1640
1647
  } else
1641
- a.push(m("tspan", { x: O(nt), dy: ot(nt ? j : U) + "em" }, " "));
1648
+ a.push(p("tspan", { x: P(nt), dy: ot(nt ? I : B) + "em" }, " "));
1642
1649
  }
1643
1650
  }
1644
- return m.apply(void 0, ["text", { fontFamily: h, fontSize: s, textAnchor: _e[p] || "start" }].concat(a));
1651
+ return p.apply(void 0, ["text", { fontFamily: u, fontSize: t, textAnchor: _e[d] || "start" }].concat(a));
1645
1652
  }
1646
- var Ge = { middle: 0.5, center: 0.5, bottom: 1, end: 1 };
1647
- function Xe(r, n, a) {
1653
+ var Xe = { middle: 0.5, center: 0.5, bottom: 1, end: 1 };
1654
+ function Je(r, n, a) {
1648
1655
  if (r.length) {
1649
1656
  a.textBaseline = "middle";
1650
- var t = n.font(), s = t.height, h = t.size, p = n.valign(), m = n.height()(), w = n.width()(0), b = n.align(), A = b === "justify", R = 0.5 * s, k = Ge[p];
1651
- if (k && isFinite(m)) {
1652
- var O = r.length * s;
1653
- R += m * k - O * k;
1657
+ var o = n.font(), t = o.height, u = o.size, d = n.valign(), p = n.height()(), b = n.width()(0), w = n.align(), A = w === "justify", E = 0.5 * t, O = Xe[d];
1658
+ if (O && isFinite(p)) {
1659
+ var P = r.length * t;
1660
+ E += p * O - P * O;
1654
1661
  }
1655
- r.forEach(function(j, U) {
1656
- var M = n.x()(U), I = U * s + R, W = 0, z = 0;
1657
- j.forEach(function(V) {
1658
- V.whitespace && W++, z += V.width;
1662
+ r.forEach(function(I, B) {
1663
+ var M = n.x()(B), F = B * t + E, $ = 0, N = 0;
1664
+ I.forEach(function(V) {
1665
+ V.whitespace && $++, N += V.width;
1659
1666
  });
1660
- var et = 0, J = U === r.length - 1 || j[j.length - 1] instanceof G;
1661
- A && j.length > 1 && !J && (et = (w - z) / W), j.forEach(function(V) {
1667
+ var K = 0, G = B === r.length - 1 || I[I.length - 1] instanceof X;
1668
+ A && I.length > 1 && !G && (K = (b - N) / $), I.forEach(function(V) {
1662
1669
  a.font = V.font;
1663
- var F = V.font, nt = F.baseline ? h * -F.baseline + 0.15 * h : 0;
1664
- a.fillStyle = function(bt, ct) {
1665
- return bt.color ? bt.color : ct.href ? "#00C" : "#000";
1666
- }(F, V);
1670
+ var j = V.font, nt = j.baseline ? u * -j.baseline + 0.15 * u : 0;
1671
+ a.fillStyle = function(wt, ct) {
1672
+ return wt.color ? wt.color : ct.href ? "#00C" : "#000";
1673
+ }(j, V);
1667
1674
  var rt = 0;
1668
- if (b === "right" ? rt += w - z : b === "center" ? rt += w / 2 - z / 2 : b === "justify" && (V.whitespace || V instanceof G) && (M += et), a.fillText(V.value, M + rt, I + nt), V.href) {
1675
+ if (w === "right" ? rt += b - N : w === "center" ? rt += b / 2 - N / 2 : w === "justify" && (V.whitespace || V instanceof X) && (M += K), a.fillText(V.value, M + rt, F + nt), V.href) {
1669
1676
  a.beginPath(), a.strokeStyle = a.fillStyle;
1670
- var ft = Math.floor(I + 0.45 * h) + 0.5;
1677
+ var ft = Math.floor(F + 0.45 * u) + 0.5;
1671
1678
  a.moveTo(M + rt, ft), a.lineTo(M + rt + V.width, ft), a.stroke();
1672
1679
  }
1673
1680
  M += V.width;
@@ -1675,17 +1682,17 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1675
1682
  });
1676
1683
  }
1677
1684
  }
1678
- function ie(r) {
1679
- return ie = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
1685
+ function ne(r) {
1686
+ return ne = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
1680
1687
  return typeof n;
1681
1688
  } : function(n) {
1682
1689
  return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
1683
- }, ie(r);
1690
+ }, ne(r);
1684
1691
  }
1685
1692
  function ke(r) {
1686
1693
  for (var n = {}, a = 0; a < r.length; a++) {
1687
- var t = r[a];
1688
- typeof t != "number" && t != null && (typeof t == "string" ? n.text = t : typeof t == "function" ? n.fn = t : ie(t) === "object" && t._groups ? n.d3 = t : t && t.nodeType && t.getContext ? n.ctx = t.getContext("2d") : t && t.fillText && t.beginPath ? n.ctx = t : t && (n.text = t));
1694
+ var o = r[a];
1695
+ typeof o != "number" && o != null && (typeof o == "string" ? n.text = o : typeof o == "function" ? n.fn = o : ne(o) === "object" && o._groups ? n.d3 = o : o && o.nodeType && o.getContext ? n.ctx = o.getContext("2d") : o && o.fillText && o.beginPath ? n.ctx = o : o && (n.text = o));
1689
1696
  }
1690
1697
  return n;
1691
1698
  }
@@ -1696,32 +1703,32 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1696
1703
  return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
1697
1704
  }, kt(r);
1698
1705
  }
1699
- function oe(r, n) {
1706
+ function ie(r, n) {
1700
1707
  for (var a = 0; a < n.length; a++) {
1701
- var t = n[a];
1702
- t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(r, (s = function(h, p) {
1703
- if (kt(h) !== "object" || h === null)
1704
- return h;
1705
- var m = h[Symbol.toPrimitive];
1706
- if (m !== void 0) {
1707
- var w = m.call(h, p);
1708
- if (kt(w) !== "object")
1709
- return w;
1708
+ var o = n[a];
1709
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(r, (t = function(u, d) {
1710
+ if (kt(u) !== "object" || u === null)
1711
+ return u;
1712
+ var p = u[Symbol.toPrimitive];
1713
+ if (p !== void 0) {
1714
+ var b = p.call(u, d);
1715
+ if (kt(b) !== "object")
1716
+ return b;
1710
1717
  throw new TypeError("@@toPrimitive must return a primitive value.");
1711
1718
  }
1712
- return String(h);
1713
- }(t.key, "string"), kt(s) === "symbol" ? s : String(s)), t);
1719
+ return String(u);
1720
+ }(o.key, "string"), kt(t) === "symbol" ? t : String(t)), o);
1714
1721
  }
1715
- var s;
1722
+ var t;
1716
1723
  }
1717
- var Te = P(), ht = function(r) {
1724
+ var Te = R(), ht = function(r) {
1718
1725
  return typeof r == "function" ? r : function() {
1719
1726
  return r;
1720
1727
  };
1721
- }, X = function() {
1722
- function r(t) {
1723
- if (function(h, p) {
1724
- if (!(h instanceof p))
1728
+ }, J = function() {
1729
+ function r(o) {
1730
+ if (function(u, d) {
1731
+ if (!(u instanceof d))
1725
1732
  throw new TypeError("Cannot call a class as a function");
1726
1733
  }(this, r), this.props = { overflow: "ellipsis", lineclamp: null, align: "left", wordBreak: null, valign: "top", width: function() {
1727
1734
  return 1 / 0;
@@ -1729,124 +1736,124 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1729
1736
  return 1 / 0;
1730
1737
  }, x: function() {
1731
1738
  return 0;
1732
- }, font: null, tAnchor: 0, parser: r.defaultparser }, t)
1733
- for (var s in t)
1734
- typeof this[s] == "function" && this[s](t[s]);
1739
+ }, font: null, tAnchor: 0, parser: r.defaultparser }, o)
1740
+ for (var t in o)
1741
+ typeof this[t] == "function" && this[t](o[t]);
1735
1742
  }
1736
1743
  var n, a;
1737
- return n = r, a = [{ key: "linebreak", value: function(t) {
1738
- var s = this, h = this.props.parser(String(t)), p = this.font(), m = function(w, b, A) {
1739
- if (!w.length)
1744
+ return n = r, a = [{ key: "linebreak", value: function(o) {
1745
+ var t = this, u = this.props.parser(String(o)), d = this.font(), p = function(b, w, A) {
1746
+ if (!b.length)
1740
1747
  return [];
1741
- var R = b.height(), k = b.width(), O = b.overflowLine(), j = b.overflowWrap(), U = P(A, !0, !1), M = isFinite(R()) ? Math.floor(R() / A.height) : 1 / 0;
1742
- if (!R() && !k(0) || !M)
1748
+ var E = w.height(), O = w.width(), P = w.overflowLine(), I = w.overflowWrap(), B = R(A, !0, !1), M = isFinite(E()) ? Math.floor(E() / A.height) : 1 / 0;
1749
+ if (!E() && !O(0) || !M)
1743
1750
  return [];
1744
- for (var I = 0, W = 0, z = 0, et = [], J = [], V = !1; I < w.length && W < M; ) {
1745
- var F = w[I], nt = Ae(F, A);
1746
- if (F.width = N(F, nt), F.font = nt, F.line = W, F.whitespace = F.value in S, F.value && (F.value = F.value.replace(qe, " ")), !(!z && F.whitespace || V && F.whitespace))
1747
- if (F instanceof G)
1748
- z = 0, J = [], et.push(I + 1), W++;
1749
- else if (F instanceof lt || F instanceof ut)
1750
- J.push({ index: I, width: z });
1751
- else if (F.whitespace || z + F.width < k(W))
1752
- z += F.width;
1753
- else if (J.length) {
1751
+ for (var F = 0, $ = 0, N = 0, K = [], G = [], V = !1; F < b.length && $ < M; ) {
1752
+ var j = b[F], nt = Ae(j, A);
1753
+ if (j.width = H(j, nt), j.font = nt, j.line = $, j.whitespace = j.value in S, j.value && (j.value = j.value.replace(Ye, " ")), !(!N && j.whitespace || V && j.whitespace))
1754
+ if (j instanceof X)
1755
+ N = 0, G = [], K.push(F + 1), $++;
1756
+ else if (j instanceof lt || j instanceof ut)
1757
+ G.push({ index: F, width: N });
1758
+ else if (j.whitespace || N + j.width < O($))
1759
+ N += j.width;
1760
+ else if (G.length) {
1754
1761
  var rt = void 0, ft = void 0;
1755
1762
  do {
1756
- ft = !0, rt = J.pop();
1757
- var bt = w[rt.index], ct = void 0;
1758
- bt instanceof ut && (ct = N("-", bt.font), rt.width + ct > k(W) && (ft = !J.length));
1763
+ ft = !0, rt = G.pop();
1764
+ var wt = b[rt.index], ct = void 0;
1765
+ wt instanceof ut && (ct = H("-", wt.font), rt.width + ct > O($) && (ft = !G.length));
1759
1766
  } while (!ft);
1760
- et.push(rt.index + 1), z = 0, W++, I = rt.index, J = [];
1761
- } else if (j === "break-word") {
1762
- var gt = k(W);
1763
- if (z + F.width > gt) {
1764
- var Mt = F.clone();
1767
+ K.push(rt.index + 1), N = 0, $++, F = rt.index, G = [];
1768
+ } else if (I === "break-word") {
1769
+ var gt = O($);
1770
+ if (N + j.width > gt) {
1771
+ var Mt = j.clone();
1765
1772
  do
1766
- F.value = F.value.slice(0, -1), F.width = N(F, F.font), z += F.width;
1767
- while (F.value && F.width > gt);
1768
- Mt.value = Mt.value.slice(F.value.length), w.splice(I + 1, 0, new lt(), Mt);
1773
+ j.value = j.value.slice(0, -1), j.width = H(j, j.font), N += j.width;
1774
+ while (j.value && j.width > gt);
1775
+ Mt.value = Mt.value.slice(j.value.length), b.splice(F + 1, 0, new lt(), Mt);
1769
1776
  }
1770
- et.push(I + 1), z = 0, W++;
1777
+ K.push(F + 1), N = 0, $++;
1771
1778
  } else
1772
- z += F.width;
1773
- I++, V = F.whitespace;
1779
+ N += j.width;
1780
+ F++, V = j.whitespace;
1774
1781
  }
1775
- I !== et[et.length - 1] && et.push(I);
1776
- var le = 0, pt = 0, Z = et.map(function(Tt) {
1777
- for (var Q, St = le; (Q = w[St]) && (Q.whitespace || !Q.value); )
1782
+ F !== K[K.length - 1] && K.push(F);
1783
+ var ae = 0, pt = 0, Z = K.map(function(Tt) {
1784
+ for (var et, St = ae; (et = b[St]) && (et.whitespace || !et.value); )
1778
1785
  St++;
1779
- for (var wt = Tt, Qe = null; wt > St && (Q = w[wt - 1]) && (Q.whitespace || !(Q.value || Q instanceof ut)); )
1780
- Q instanceof G && (Qe = Q), wt--;
1781
- Q instanceof ut && (Q.value = "-", Q.width = N("-", Q.font)), le = Tt;
1782
- var zt = w.slice(St, wt).filter(function(tr) {
1786
+ for (var xt = Tt, Qe = null; xt > St && (et = b[xt - 1]) && (et.whitespace || !(et.value || et instanceof ut)); )
1787
+ et instanceof X && (Qe = et), xt--;
1788
+ et instanceof ut && (et.value = "-", et.width = H("-", et.font)), ae = Tt;
1789
+ var zt = b.slice(St, xt).filter(function(tr) {
1783
1790
  return tr.value;
1784
1791
  });
1785
1792
  return Qe && zt.push(Qe), zt.width = zt.reduce(function(tr, Vr) {
1786
1793
  return tr + Vr.width;
1787
1794
  }, 0), zt.width > pt && (pt = zt.width), zt;
1788
1795
  });
1789
- if (Z.hasLineOverflow = !1, O) {
1790
- var Pe = O === "ellipsis" ? "…" : O;
1791
- Z.forEach(function(Tt, Q) {
1792
- var St = k(Q);
1796
+ if (Z.hasLineOverflow = !1, P) {
1797
+ var Re = P === "ellipsis" ? "…" : P;
1798
+ Z.forEach(function(Tt, et) {
1799
+ var St = O(et);
1793
1800
  if (Tt.width > St) {
1794
- var wt = new D(Pe);
1795
- wt.font = A, wt.width = N(Pe, U), ee(Tt, St, wt), Z.hasLineOverflow = !0;
1801
+ var xt = new z(Re);
1802
+ xt.font = A, xt.width = H(Re, B), te(Tt, St, xt), Z.hasLineOverflow = !0;
1796
1803
  }
1797
1804
  });
1798
1805
  }
1799
- var q = b.overflow() === "ellipsis" ? "…" : b.overflow();
1800
- if (q && I !== w.length) {
1801
- var K = k(Z.length - 1), Re = Z[Z.length - 1], ue = new D(q);
1802
- ue.font = A, ue.width = N(q, U), ee(Re, K, ue), Z.hasOverflow = !0;
1806
+ var q = w.overflow() === "ellipsis" ? "…" : w.overflow();
1807
+ if (q && F !== b.length) {
1808
+ var Q = O(Z.length - 1), Ie = Z[Z.length - 1], le = new z(q);
1809
+ le.font = A, le.width = H(q, B), te(Ie, Q, le), Z.hasOverflow = !0;
1803
1810
  } else
1804
1811
  Z.hasOverflow = !1;
1805
1812
  return Z.font = A, Z.width = pt, Z;
1806
- }(h, this, p);
1807
- return m.height = m.length * p.height, m.render = function(w) {
1808
- return s.render(m, w);
1809
- }, m.svg = m.render, m.draw = m.render, m;
1810
- } }, { key: "font", value: function(t) {
1811
- return arguments.length ? (this.props.font = P(t), this) : this.props.font || P(Te);
1812
- } }, { key: "overflow", value: function(t) {
1813
- return arguments.length ? (this.props.overflow = String(t), this) : this.props.overflow;
1814
- } }, { key: "overflowLine", value: function(t) {
1815
- return arguments.length ? (this.props.lineclamp = String(t), this) : this.props.lineclamp;
1816
- } }, { key: "valign", value: function(t) {
1817
- return arguments.length ? (this.props.valign = t, this) : this.props.valign;
1818
- } }, { key: "align", value: function(t) {
1813
+ }(u, this, d);
1814
+ return p.height = p.length * d.height, p.render = function(b) {
1815
+ return t.render(p, b);
1816
+ }, p.svg = p.render, p.draw = p.render, p;
1817
+ } }, { key: "font", value: function(o) {
1818
+ return arguments.length ? (this.props.font = R(o), this) : this.props.font || R(Te);
1819
+ } }, { key: "overflow", value: function(o) {
1820
+ return arguments.length ? (this.props.overflow = String(o), this) : this.props.overflow;
1821
+ } }, { key: "overflowLine", value: function(o) {
1822
+ return arguments.length ? (this.props.lineclamp = String(o), this) : this.props.lineclamp;
1823
+ } }, { key: "valign", value: function(o) {
1824
+ return arguments.length ? (this.props.valign = o, this) : this.props.valign;
1825
+ } }, { key: "align", value: function(o) {
1819
1826
  if (!arguments.length)
1820
1827
  return this.props.align;
1821
- var s = String(t).toLowerCase();
1822
- 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;
1823
- } }, { key: "overflowWrap", value: function(t) {
1828
+ var t = String(o).toLowerCase();
1829
+ return t === "left" || t === "start" ? (this.props.align = "left", this.props.tAnchor = 0) : t === "center" || t === "middle" ? (this.props.align = "center", this.props.tAnchor = -0.5) : t === "end" || t === "right" ? (this.props.align = "right", this.props.tAnchor = -1) : t === "justify" && (this.props.align = o, this.props.tAnchor = 0), this;
1830
+ } }, { key: "overflowWrap", value: function(o) {
1824
1831
  if (!arguments.length)
1825
1832
  return this.props.overflowWrap || "normal";
1826
- var s = String(t).toLowerCase();
1827
- return s === "break-word" ? this.props.overflowWrap = "break-word" : s !== "normal" && t != null || (this.props.overflowWrap = null), this;
1828
- } }, { key: "width", value: function(t) {
1829
- return arguments.length ? (this.props.width = ht(t), this) : this.props.width;
1830
- } }, { key: "height", value: function(t) {
1831
- return arguments.length ? (this.props.height = ht(t), this) : this.props.height;
1832
- } }, { key: "x", value: function(t) {
1833
- return arguments.length ? (this.props.x = ht(t), this) : this.props.x;
1834
- } }, { key: "parser", value: function(t) {
1833
+ var t = String(o).toLowerCase();
1834
+ return t === "break-word" ? this.props.overflowWrap = "break-word" : t !== "normal" && o != null || (this.props.overflowWrap = null), this;
1835
+ } }, { key: "width", value: function(o) {
1836
+ return arguments.length ? (this.props.width = ht(o), this) : this.props.width;
1837
+ } }, { key: "height", value: function(o) {
1838
+ return arguments.length ? (this.props.height = ht(o), this) : this.props.height;
1839
+ } }, { key: "x", value: function(o) {
1840
+ return arguments.length ? (this.props.x = ht(o), this) : this.props.x;
1841
+ } }, { key: "parser", value: function(o) {
1835
1842
  if (!arguments.length)
1836
1843
  return this.props.parser;
1837
- if (typeof t == "string") {
1838
- var s = r[t] || r[t + "parser"];
1839
- typeof s == "function" && (t = s);
1844
+ if (typeof o == "string") {
1845
+ var t = r[o] || r[o + "parser"];
1846
+ typeof t == "function" && (o = t);
1840
1847
  }
1841
- if (typeof t != "function")
1842
- throw new Error("Unknown parser: " + t);
1843
- return this.props.parser = t, this;
1844
- } }, { key: "createElement", value: function(t) {
1845
- return arguments.length ? (this.props.createElement = t, this) : this.props.createElement || r.createElement;
1848
+ if (typeof o != "function")
1849
+ throw new Error("Unknown parser: " + o);
1850
+ return this.props.parser = o, this;
1851
+ } }, { key: "createElement", value: function(o) {
1852
+ return arguments.length ? (this.props.createElement = o, this) : this.props.createElement || r.createElement;
1846
1853
  } }, { key: "render", value: function() {
1847
- var t = ke(arguments);
1848
- return typeof t.text == "string" && (t.text = this.linebreak(t.text)), t.ctx ? Xe(t.text, this, t.ctx) : Ye(t.text, this);
1849
- } }], a && oe(n.prototype, a), Object.defineProperty(n, "prototype", { writable: !1 }), r;
1854
+ var o = ke(arguments);
1855
+ return typeof o.text == "string" && (o.text = this.linebreak(o.text)), o.ctx ? Je(o.text, this, o.ctx) : Ge(o.text, this);
1856
+ } }], a && ie(n.prototype, a), Object.defineProperty(n, "prototype", { writable: !1 }), r;
1850
1857
  }();
1851
1858
  function dt(r) {
1852
1859
  return dt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
@@ -1855,102 +1862,102 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1855
1862
  return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
1856
1863
  }, dt(r);
1857
1864
  }
1858
- function jt(r, n) {
1865
+ function $t(r, n) {
1859
1866
  (n == null || n > r.length) && (n = r.length);
1860
- for (var a = 0, t = new Array(n); a < n; a++)
1861
- t[a] = r[a];
1862
- return t;
1867
+ for (var a = 0, o = new Array(n); a < n; a++)
1868
+ o[a] = r[a];
1869
+ return o;
1863
1870
  }
1864
- function Je(r, n) {
1871
+ function Ke(r, n) {
1865
1872
  for (var a = 0; a < n.length; a++) {
1866
- var t = n[a];
1867
- t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(r, (s = function(h, p) {
1868
- if (dt(h) !== "object" || h === null)
1869
- return h;
1870
- var m = h[Symbol.toPrimitive];
1871
- if (m !== void 0) {
1872
- var w = m.call(h, p);
1873
- if (dt(w) !== "object")
1874
- return w;
1873
+ var o = n[a];
1874
+ o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(r, (t = function(u, d) {
1875
+ if (dt(u) !== "object" || u === null)
1876
+ return u;
1877
+ var p = u[Symbol.toPrimitive];
1878
+ if (p !== void 0) {
1879
+ var b = p.call(u, d);
1880
+ if (dt(b) !== "object")
1881
+ return b;
1875
1882
  throw new TypeError("@@toPrimitive must return a primitive value.");
1876
1883
  }
1877
- return String(h);
1878
- }(t.key, "string"), dt(s) === "symbol" ? s : String(s)), t);
1884
+ return String(u);
1885
+ }(o.key, "string"), dt(t) === "symbol" ? t : String(t)), o);
1879
1886
  }
1880
- var s;
1887
+ var t;
1881
1888
  }
1882
- var se = function(r) {
1889
+ var oe = function(r) {
1883
1890
  return typeof r == "function" ? r : function() {
1884
1891
  return r;
1885
1892
  };
1886
1893
  }, Se = function() {
1887
- function r(t) {
1888
- if (function(h, p) {
1889
- if (!(h instanceof p))
1894
+ function r(o) {
1895
+ if (function(u, d) {
1896
+ if (!(u instanceof d))
1890
1897
  throw new TypeError("Cannot call a class as a function");
1891
1898
  }(this, r), this.props = { width: function() {
1892
1899
  return 1 / 0;
1893
1900
  }, height: function() {
1894
1901
  return 1 / 0;
1895
- }, rotation: 0, vAnchor: 0, hAnchor: 0 }, t)
1896
- for (var s in t)
1897
- typeof this[s] == "function" && this[s](t[s]);
1902
+ }, rotation: 0, vAnchor: 0, hAnchor: 0 }, o)
1903
+ for (var t in o)
1904
+ typeof this[t] == "function" && this[t](o[t]);
1898
1905
  this.render = this.render.bind(this);
1899
1906
  }
1900
1907
  var n, a;
1901
- return n = r, a = [{ key: "anchor", value: function(t) {
1902
- var s = this.props, h = s.hAnchor, p = s.vAnchor, m = s.width, w = s.height;
1908
+ return n = r, a = [{ key: "anchor", value: function(o) {
1909
+ var t = this.props, u = t.hAnchor, d = t.vAnchor, p = t.width, b = t.height;
1903
1910
  if (!arguments.length)
1904
- return [h * m(0), p * w(0)];
1905
- if (typeof t == "string") {
1906
- var b = this.props;
1907
- t.toLowerCase().trim().split(/\s+/).forEach(function(A) {
1908
- A === "top" && (b.vAnchor = -0), A === "middle" && (b.vAnchor = -0.5), A === "bottom" && (b.vAnchor = -1), A === "left" && (b.hAnchor = -0), A === "center" && (b.hAnchor = -0.5), A === "right" && (b.hAnchor = -1);
1911
+ return [u * p(0), d * b(0)];
1912
+ if (typeof o == "string") {
1913
+ var w = this.props;
1914
+ o.toLowerCase().trim().split(/\s+/).forEach(function(A) {
1915
+ A === "top" && (w.vAnchor = -0), A === "middle" && (w.vAnchor = -0.5), A === "bottom" && (w.vAnchor = -1), A === "left" && (w.hAnchor = -0), A === "center" && (w.hAnchor = -0.5), A === "right" && (w.hAnchor = -1);
1909
1916
  });
1910
1917
  }
1911
1918
  return this;
1912
- } }, { key: "width", value: function(t) {
1913
- return arguments.length ? (this.props.width = se(t), this) : this.props.width;
1914
- } }, { key: "height", value: function(t) {
1915
- return arguments.length ? (this.props.height = se(t), this) : this.props.height;
1916
- } }, { key: "rotate", value: function(t) {
1917
- return arguments.length ? (this.props.rotation = t, this) : this.props.rotation;
1918
- } }, { key: "createElement", value: function(t) {
1919
- return arguments.length ? (this.props.createElement = t, this) : this.props.createElement || r.createElement;
1920
- } }, { key: "canvas", value: function(t, s) {
1921
- var h, p = t.getContext ? t.getContext("2d") : t;
1922
- return p.save(), p.rotate(this.rotate() * Math.PI / 180), p.translate.apply(p, function(m) {
1923
- if (Array.isArray(m))
1924
- return jt(m);
1925
- }(h = this.anchor()) || function(m) {
1926
- if (typeof Symbol < "u" && m[Symbol.iterator] != null || m["@@iterator"] != null)
1927
- return Array.from(m);
1928
- }(h) || function(m, w) {
1929
- if (m) {
1930
- if (typeof m == "string")
1931
- return jt(m, w);
1932
- var b = Object.prototype.toString.call(m).slice(8, -1);
1933
- 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) ? jt(m, w) : void 0;
1919
+ } }, { key: "width", value: function(o) {
1920
+ return arguments.length ? (this.props.width = oe(o), this) : this.props.width;
1921
+ } }, { key: "height", value: function(o) {
1922
+ return arguments.length ? (this.props.height = oe(o), this) : this.props.height;
1923
+ } }, { key: "rotate", value: function(o) {
1924
+ return arguments.length ? (this.props.rotation = o, this) : this.props.rotation;
1925
+ } }, { key: "createElement", value: function(o) {
1926
+ return arguments.length ? (this.props.createElement = o, this) : this.props.createElement || r.createElement;
1927
+ } }, { key: "canvas", value: function(o, t) {
1928
+ var u, d = o.getContext ? o.getContext("2d") : o;
1929
+ return d.save(), d.rotate(this.rotate() * Math.PI / 180), d.translate.apply(d, function(p) {
1930
+ if (Array.isArray(p))
1931
+ return $t(p);
1932
+ }(u = this.anchor()) || function(p) {
1933
+ if (typeof Symbol < "u" && p[Symbol.iterator] != null || p["@@iterator"] != null)
1934
+ return Array.from(p);
1935
+ }(u) || function(p, b) {
1936
+ if (p) {
1937
+ if (typeof p == "string")
1938
+ return $t(p, b);
1939
+ var w = Object.prototype.toString.call(p).slice(8, -1);
1940
+ return w === "Object" && p.constructor && (w = p.constructor.name), w === "Map" || w === "Set" ? Array.from(p) : w === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(w) ? $t(p, b) : void 0;
1934
1941
  }
1935
- }(h) || function() {
1942
+ }(u) || function() {
1936
1943
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
1937
1944
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
1938
- }()), s(p), p.restore(), p;
1945
+ }()), t(d), d.restore(), d;
1939
1946
  } }, { key: "render", value: function() {
1940
- var t = ke(arguments);
1941
- if (t.d3)
1942
- return t.d3.attr("transform", "rotate(".concat(this.rotate(), ") translate(").concat(this.anchor(), ")"));
1943
- if (t.ctx)
1944
- return this.canvas(t.ctx, t.fn);
1945
- if (t.text) {
1946
- var s = typeof t.text.render == "function" ? t.text.render() : t.text;
1947
- return this.createElement()("g", { transform: "rotate(".concat(this.rotate(), ") translate(").concat(this.anchor(), ")") }, s);
1947
+ var o = ke(arguments);
1948
+ if (o.d3)
1949
+ return o.d3.attr("transform", "rotate(".concat(this.rotate(), ") translate(").concat(this.anchor(), ")"));
1950
+ if (o.ctx)
1951
+ return this.canvas(o.ctx, o.fn);
1952
+ if (o.text) {
1953
+ var t = typeof o.text.render == "function" ? o.text.render() : o.text;
1954
+ return this.createElement()("g", { transform: "rotate(".concat(this.rotate(), ") translate(").concat(this.anchor(), ")") }, t);
1948
1955
  }
1949
- } }], a && Je(n.prototype, a), Object.defineProperty(n, "prototype", { writable: !1 }), r;
1956
+ } }], a && Ke(n.prototype, a), Object.defineProperty(n, "prototype", { writable: !1 }), r;
1950
1957
  }(), Ce = Object.prototype.hasOwnProperty, Dt = {};
1951
1958
  function Ze(r) {
1952
- return Dt[r] || (Dt[r] = r.replace(/([a-z])([A-Z])/g, function(n, a, t) {
1953
- return a + "-" + t.toLowerCase();
1959
+ return Dt[r] || (Dt[r] = r.replace(/([a-z])([A-Z])/g, function(n, a, o) {
1960
+ return a + "-" + o.toLowerCase();
1954
1961
  })), Dt[r];
1955
1962
  }
1956
1963
  function Oe(r, n) {
@@ -1960,144 +1967,144 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1960
1967
  });
1961
1968
  typeof n == "string" && (n = document.createTextNode(n)), r.appendChild(n);
1962
1969
  }
1963
- function ae(r, n) {
1970
+ function se(r, n) {
1964
1971
  if (typeof document < "u") {
1965
1972
  var a = typeof r == "string" ? document.createElementNS("http://www.w3.org/2000/svg", r) : r;
1966
1973
  if (n && a.setAttribute)
1967
- for (var t in n)
1968
- Ce.call(n, t) && n[t] != null && a.setAttribute(t === "className" ? "class" : Ze(t), n[t]);
1969
- for (var s = arguments.length, h = new Array(s > 2 ? s - 2 : 0), p = 2; p < s; p++)
1970
- h[p - 2] = arguments[p];
1971
- return h != null && h.length && h.forEach(function(m) {
1972
- Oe(a, m);
1974
+ for (var o in n)
1975
+ Ce.call(n, o) && n[o] != null && a.setAttribute(o === "className" ? "class" : Ze(o), n[o]);
1976
+ for (var t = arguments.length, u = new Array(t > 2 ? t - 2 : 0), d = 2; d < t; d++)
1977
+ u[d - 2] = arguments[d];
1978
+ return u != null && u.length && u.forEach(function(p) {
1979
+ Oe(a, p);
1973
1980
  }), a;
1974
1981
  }
1975
1982
  }
1976
- X.createElement = ae, X.textparser = At, X.defaultparser = At, X.htmlparser = function(r) {
1983
+ J.createElement = se, J.textparser = Et, J.defaultparser = Et, J.htmlparser = function(r) {
1977
1984
  r = String(r || "").trim();
1978
- for (var n, a, t = { weight: null, style: null, sub: !1, sup: !1, href: null, color: null, rel: null, target: null }, s = [], h = [], p = function(R) {
1979
- for (var k in t)
1980
- t[k] && (R[k] = t[k]);
1981
- s.push(R);
1982
- }, m = function(R) {
1983
- var k = s.length, O = Be[R];
1984
- if (k && O) {
1985
- for (var j = k - 1; s[j] && (s[j] instanceof lt || Ne.test(s[j].value)); )
1986
- j--;
1987
- for (; O && s[j] && s[j] instanceof G; )
1988
- j--, O--;
1989
- for (; O-- > 0; )
1990
- s.push(new G());
1985
+ for (var n, a, o = { weight: null, style: null, sub: !1, sup: !1, href: null, color: null, rel: null, target: null }, t = [], u = [], d = function(E) {
1986
+ for (var O in o)
1987
+ o[O] && (E[O] = o[O]);
1988
+ t.push(E);
1989
+ }, p = function(E) {
1990
+ var O = t.length, P = He[E];
1991
+ if (O && P) {
1992
+ for (var I = O - 1; t[I] && (t[I] instanceof lt || Be.test(t[I].value)); )
1993
+ I--;
1994
+ for (; P && t[I] && t[I] instanceof X; )
1995
+ I--, P--;
1996
+ for (; P-- > 0; )
1997
+ t.push(new X());
1991
1998
  }
1992
1999
  }; r.length; ) {
1993
2000
  if (n = /^[^<]+/.exec(r))
1994
- At(Qt(n[0]), !1).forEach(p);
2001
+ Et(Zt(n[0]), !1).forEach(d);
1995
2002
  else if (!(n = It.exec(r)))
1996
- if (n = Jt.exec(r))
1997
- h.length && (t = h.pop()), m(n[1]);
1998
- else if (n = Zt.exec(r)) {
1999
- var w = n[1];
2000
- m(w), h.push(t), t = Object.create(t), Et[w] && Et[w](t, "");
2001
- var b = Lt(n[2]);
2002
- 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 G());
2003
+ if (n = Xt.exec(r))
2004
+ u.length && (o = u.pop()), p(n[1]);
2005
+ else if (n = Jt.exec(r)) {
2006
+ var b = n[1];
2007
+ p(b), u.push(o), o = Object.create(o), _t[b] && _t[b](o, "");
2008
+ var w = Lt(n[2]);
2009
+ b === "a" && (w.href && (o.href = w.href), w.rel && (o.rel = w.rel), w.target && (o.target = w.target)), w.class && (o.class = o.class ? o.class + " " + w.class : w.class), w.style && (a = /(?:^|\s|;)color\s*:\s*([^;\s"']+)/.exec(w.style)) && a[1] && (o.color = a[1]), b === "br" && t.push(new X());
2003
2010
  } else
2004
- n = [r.slice(0, 1)], p(new D(n[0]));
2011
+ n = [r.slice(0, 1)], d(new z(n[0]));
2005
2012
  r = r.slice(n[0].length);
2006
2013
  }
2007
- for (var A = s[s.length - 1]; A instanceof G; )
2008
- s.pop(), A = s[s.length - 1];
2009
- return s;
2010
- }, X.latexparser = function(r) {
2014
+ for (var A = t[t.length - 1]; A instanceof X; )
2015
+ t.pop(), A = t[t.length - 1];
2016
+ return t;
2017
+ }, J.latexparser = function(r) {
2011
2018
  r = String(r || "").trim();
2012
2019
  var n = [0];
2013
- r = r.replace(/\\verb,(.*?),/, function(M, I) {
2014
- return n.push(I), "\\verb," + (n.length - 1) + ",";
2020
+ r = r.replace(/\\verb,(.*?),/, function(M, F) {
2021
+ return n.push(F), "\\verb," + (n.length - 1) + ",";
2015
2022
  }).replace(/\\\\\n/g, function() {
2016
2023
  return "\\\\";
2017
- }).replace(Ve, function(M, I, W) {
2018
- return W.charAt(I - 1) === "\\" ? M : te[M];
2024
+ }).replace(qe, function(M, F, $) {
2025
+ return $.charAt(F - 1) === "\\" ? M : Qt[M];
2019
2026
  }).replace(/\n\s+/g, function(M) {
2020
2027
  return /\n/.test(M.slice(1)) ? "\\par " : M;
2021
- }).replace(/\\symbol\{(\d+)\}/, function(M, I, W, z) {
2022
- return z.charAt(W - 1) === "\\" ? M : String.fromCharCode(1 * I);
2023
- }).replace(/(^|[^\\])(\^|_)(\d|[^{]\S*)/g, function(M, I, W, z) {
2024
- return I + W + "{" + z + "}";
2025
- }).replace(/\\verb,(.*?),/, function(M, I) {
2026
- return "\\verb,".concat(n[+I], ",");
2028
+ }).replace(/\\symbol\{(\d+)\}/, function(M, F, $, N) {
2029
+ return N.charAt($ - 1) === "\\" ? M : String.fromCharCode(1 * F);
2030
+ }).replace(/(^|[^\\])(\^|_)(\d|[^{]\S*)/g, function(M, F, $, N) {
2031
+ return F + $ + "{" + N + "}";
2032
+ }).replace(/\\verb,(.*?),/, function(M, F) {
2033
+ return "\\verb,".concat(n[+F], ",");
2027
2034
  });
2028
- for (var a, t = { weight: null, italic: null, variant: null, sub: !1, sup: !1, href: null }, s = [], h = [], p = function(M) {
2029
- for (var I in t)
2030
- t[I] && (M[I] = t[I]);
2031
- return s.push(M), M;
2032
- }, m = function() {
2033
- h.push(t), t = Object.create(t);
2034
- }, w = function() {
2035
- if (!h.length)
2035
+ for (var a, o = { weight: null, italic: null, variant: null, sub: !1, sup: !1, href: null }, t = [], u = [], d = function(M) {
2036
+ for (var F in o)
2037
+ o[F] && (M[F] = o[F]);
2038
+ return t.push(M), M;
2039
+ }, p = function() {
2040
+ u.push(o), o = Object.create(o);
2041
+ }, b = function() {
2042
+ if (!u.length)
2036
2043
  throw new Error("Unexpected }");
2037
- t = h.pop();
2038
- }, b = { tokens: s, open_context: m, close_context: w, add_token: p }; r.length; ) {
2044
+ o = u.pop();
2045
+ }, w = { tokens: t, open_context: p, close_context: b, add_token: d }; r.length; ) {
2039
2046
  if (a = Ft.exec(r))
2040
- At(a[0], !1).forEach(p);
2041
- else if (a = We.exec(r))
2042
- p(new D(a[1]));
2047
+ Et(a[0], !1).forEach(d);
2048
+ else if (a = Ve.exec(r))
2049
+ d(new z(a[1]));
2043
2050
  else if (!(a = xe.exec(r))) {
2044
2051
  if (a = /^\{/.exec(r))
2045
- m();
2052
+ p();
2046
2053
  else if (a = /^\}/.exec(r))
2047
- w();
2054
+ b();
2048
2055
  else if (!(a = /^\$/.exec(r)))
2049
2056
  if (a = /^\\verb,([^,]+),/.exec(r))
2050
- p(new D(a[1]));
2057
+ d(new z(a[1]));
2051
2058
  else if (a = we.exec(r)) {
2052
- var A = a[1].slice(1) || a[1], R = !!a[2];
2059
+ var A = a[1].slice(1) || a[1], E = !!a[2];
2053
2060
  if (/^(La)?TeX$/i.test(A)) {
2054
- m(), t.family = "serif";
2055
- var k = void 0;
2056
- A === "LaTeX" && ((k = p(new D("L"))).tracking = -0.25, (k = p(new D("A"))).size = 0.7, k.baseline = 0.3, k.tracking = -0.1), (k = p(new D("T"))).tracking = -0.17, (k = p(new D("E"))).baseline = -0.22, k.tracking = -0.13, k = p(new D("X")), w();
2057
- } else if (A in _t)
2058
- p(new D(_t[A])), R && m();
2059
- else if (A in H) {
2060
- var O = [], j = H[A].length - 1, U = void 0;
2061
- if (j) {
2062
- for (R = !1, r = r.slice(a[0].length - 1); j--; ) {
2063
- if (!(U = /^\{([^}]+)\}/.exec(r)))
2061
+ p(), o.family = "serif";
2062
+ var O = void 0;
2063
+ A === "LaTeX" && ((O = d(new z("L"))).tracking = -0.25, (O = d(new z("A"))).size = 0.7, O.baseline = 0.3, O.tracking = -0.1), (O = d(new z("T"))).tracking = -0.17, (O = d(new z("E"))).baseline = -0.22, O.tracking = -0.13, O = d(new z("X")), b();
2064
+ } else if (A in bt)
2065
+ d(new z(bt[A])), E && p();
2066
+ else if (A in W) {
2067
+ var P = [], I = W[A].length - 1, B = void 0;
2068
+ if (I) {
2069
+ for (E = !1, r = r.slice(a[0].length - 1); I--; ) {
2070
+ if (!(B = /^\{([^}]+)\}/.exec(r)))
2064
2071
  throw new Error(A + " is missing an argument");
2065
- O.push(U[1]), r = r.slice(U[0].length);
2072
+ P.push(B[1]), r = r.slice(B[0].length);
2066
2073
  }
2067
- a[0] = /^\{/.exec(r) ? "{" : "", R = !!a[0];
2074
+ a[0] = /^\{/.exec(r) ? "{" : "", E = !!a[0];
2068
2075
  }
2069
- R && m(), H[A].apply(b, [t].concat(O));
2076
+ E && p(), W[A].apply(w, [o].concat(P));
2070
2077
  } else
2071
- console.warn("unknown latex command", A), p(new D(a[1])), R && m();
2078
+ console.warn("unknown latex command", A), d(new z(a[1])), E && p();
2072
2079
  } else
2073
- a = [r.slice(0, 1)], p(new D(a[0]));
2080
+ a = [r.slice(0, 1)], d(new z(a[0]));
2074
2081
  }
2075
2082
  r = r.slice(a[0].length);
2076
2083
  }
2077
- return s;
2078
- }, X.measureText = function(r, n, a) {
2079
- return N(r, P(n), a);
2080
- }, X.Token = D, X.Break = lt, X.LineBreak = G, X.SoftHyphen = ut, X.Rotator = Se, Se.createElement = ae;
2081
- const Ke = X;
2084
+ return t;
2085
+ }, J.measureText = function(r, n, a) {
2086
+ return H(r, R(n), a);
2087
+ }, J.Token = z, J.Break = lt, J.LineBreak = X, J.SoftHyphen = ut, J.Rotator = Se, Se.createElement = se;
2088
+ const Pe = J;
2082
2089
  return i.default;
2083
2090
  })());
2084
2091
  })(Hr);
2085
2092
  var vn = Hr.exports;
2086
2093
  const xr = /* @__PURE__ */ Mr(vn);
2087
- function nr(u) {
2088
- return u.replace(/…$/, "");
2094
+ function nr(h) {
2095
+ return h.replace(/…$/, "");
2089
2096
  }
2090
- function ir(u) {
2091
- return u.children[0].innerHTML;
2097
+ function ir(h) {
2098
+ return h.children[0].innerHTML;
2092
2099
  }
2093
- function mn(u, e) {
2094
- const o = mt(u), { fontSize: i, font: l, padding: c = 0 } = u.properties.style || {};
2095
- if (o.width === o.height && o.width === 0)
2100
+ function mn(h, e) {
2101
+ const s = mt(h), { fontSize: i, font: l, padding: c = 0 } = h.properties.style || {};
2102
+ if (s.width === s.height && s.width === 0)
2096
2103
  return;
2097
- const f = new xr({
2104
+ const g = new xr({
2098
2105
  font: `${i}px/${i}px ${l}`.replace(/(px)+/g, "px"),
2099
- width: o.width - c * 2,
2100
- height: o.height - c * 2,
2106
+ width: s.width - c * 2,
2107
+ height: s.height - c * 2,
2101
2108
  align: "left",
2102
2109
  valign: "top",
2103
2110
  x: 0,
@@ -2105,49 +2112,49 @@ function mn(u, e) {
2105
2112
  parser: "html",
2106
2113
  createElement: xr.createElement
2107
2114
  });
2108
- f.overflowWrap("break-word");
2109
- const g = f.linebreak(
2110
- u.properties.content.replaceAll(`
2115
+ g.overflowWrap("break-word");
2116
+ const y = g.linebreak(
2117
+ h.properties.content.replaceAll(`
2111
2118
  `, "<br>")
2112
- ).render(), d = [...g.children];
2113
- let v = 0;
2114
- const y = [];
2115
- u.properties.content.split(`
2116
- `).forEach((E) => {
2117
- let P = E;
2118
- for (; P.length && v < d.length; ) {
2119
- if (d[v].innerHTML === "&nbsp;") {
2120
- P.startsWith(`
2121
- `) || y.push(v), v++;
2119
+ ).render(), f = [...y.children];
2120
+ let m = 0;
2121
+ const v = [];
2122
+ h.properties.content.split(`
2123
+ `).forEach((_) => {
2124
+ let R = _;
2125
+ for (; R.length && m < f.length; ) {
2126
+ if (f[m].innerHTML === "&nbsp;") {
2127
+ R.startsWith(`
2128
+ `) || v.push(m), m++;
2122
2129
  break;
2123
2130
  }
2124
- const S = nr(ir(d[v]));
2125
- P.startsWith(S) && (P = P.slice(S.length).trim()), v++;
2131
+ const S = nr(ir(f[m]));
2132
+ R.startsWith(S) && (R = R.slice(S.length).trim()), m++;
2126
2133
  }
2127
- }), y.forEach((E) => g.removeChild(d[E]));
2128
- const _ = u.properties.content.match(/(https?:\/\/.*)/gm), C = _ ? _.map((E) => E.split(" ")[0]) : [];
2129
- g.setAttribute("transform", `translate(${c}, ${c})`), C.forEach((E) => {
2130
- let P = E;
2134
+ }), v.forEach((_) => y.removeChild(f[_]));
2135
+ const k = h.properties.content.match(/(https?:\/\/.*)/gm), C = k ? k.map((_) => _.split(" ")[0]) : [];
2136
+ y.setAttribute("transform", `translate(${c}, ${c})`), C.forEach((_) => {
2137
+ let R = _;
2131
2138
  const S = [];
2132
- for (; P.length > 0; ) {
2133
- const $ = d.find((T) => !!T.children[0] && T.children[0].tagName === "tspan" && P.startsWith(nr(ir(T))));
2134
- if (!$)
2139
+ for (; R.length > 0; ) {
2140
+ const D = f.find((T) => !!T.children[0] && T.children[0].tagName === "tspan" && R.startsWith(nr(ir(T))));
2141
+ if (!D)
2135
2142
  break;
2136
- S.push($);
2137
- const L = nr($.children[0].innerHTML).length;
2143
+ S.push(D);
2144
+ const L = nr(D.children[0].innerHTML).length;
2138
2145
  if (!L)
2139
2146
  break;
2140
- P = P.slice(L);
2147
+ R = R.slice(L);
2141
2148
  }
2142
- S.forEach(($) => {
2149
+ S.forEach((D) => {
2143
2150
  const L = document.createElementNS("http://www.w3.org/2000/svg", "a");
2144
- L.setAttribute("href", E), L.setAttribute("target", "_blank"), L.innerHTML = ir($), $.children[0].innerHTML = "", $.children[0].appendChild(L);
2151
+ L.setAttribute("href", _), L.setAttribute("target", "_blank"), L.innerHTML = ir(D), D.children[0].innerHTML = "", D.children[0].appendChild(L);
2145
2152
  });
2146
- }), e.appendChild(g);
2153
+ }), e.appendChild(y);
2147
2154
  }
2148
2155
  const Ar = 20;
2149
2156
  class bn extends Br {
2150
- constructor(e, o = {}) {
2157
+ constructor(e, s = {}) {
2151
2158
  super(
2152
2159
  e,
2153
2160
  `
@@ -2167,42 +2174,42 @@ class bn extends Br {
2167
2174
  this.textArea.value === this.placeholder && (this.textArea.value = ""), this.isFocused = !0;
2168
2175
  }), x(this, "_onBlur", () => {
2169
2176
  this.isFocused = !1;
2170
- }), x(this, "startDrawing", (l, c, f = yn(l, c, 0, 0, "", Wt)) => {
2171
- this.add(f);
2172
- const g = this.ogma.view.graphToScreenCoordinates({ x: l, y: c });
2173
- this.select(f.id), this.startDragging(this.getById(f.id), g.x, g.y), this.draggedHandle = 6;
2177
+ }), x(this, "startDrawing", (l, c, g = yn(l, c, 0, 0, "", Wt)) => {
2178
+ this.add(g);
2179
+ const y = this.ogma.view.graphToScreenCoordinates({ x: l, y: c });
2180
+ this.select(g.id), this.startDragging(this.getById(g.id), y.x, y.y), this.draggedHandle = 6;
2174
2181
  }), x(this, "cancelDrawing", () => {
2175
2182
  this.isDragging && (this.remove(this.annotation.id), this.annotation = { ...rr }, this.draggedHandle = Y, this.isDragging = !1, this.emit(Vt, this.annotation));
2176
- }), x(this, "startDragging", (l, c, f) => {
2183
+ }), x(this, "startDragging", (l, c, g) => {
2177
2184
  this.annotation = l;
2178
- const g = vt(this.annotation), d = mt(this.annotation);
2179
- 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(Me, this.annotation), this.isDragging = !0;
2185
+ const y = vt(this.annotation), f = mt(this.annotation);
2186
+ this.rect.x = y.x, this.rect.y = y.y, this.rect.width = f.width, this.rect.height = f.height, this.startX = c, this.startY = g, this.disableDragging(), this.textArea.classList.add("noevents"), this.textArea.setAttribute("disabled", "disabled"), this.emit(ze, this.annotation), this.isDragging = !0;
2180
2187
  }), x(this, "onHandleMouseDown", (l) => {
2181
2188
  const c = this.getById(this.selectedId) || this.getById(this.hoveredId);
2182
2189
  if (!c)
2183
2190
  return;
2184
2191
  this.selectedId !== c.id && this.select(this.hoveredId);
2185
- const { x: f, y: g } = sr(l, this.ogma.getContainer());
2186
- this.startDragging(c, f, g), this.draggedHandle = Lr(l.target);
2192
+ const { x: g, y } = sr(l, this.ogma.getContainer());
2193
+ this.startDragging(c, g, y), this.draggedHandle = Lr(l.target);
2187
2194
  }), x(this, "onMouseMove", (l) => {
2188
2195
  requestAnimationFrame(() => this._onMouseMove(l));
2189
2196
  }), x(this, "_onMouseMove", (l) => {
2190
2197
  if (!this.isDragging)
2191
2198
  return;
2192
2199
  l.stopPropagation(), l.preventDefault();
2193
- const c = this.handles[this.draggedHandle], f = c.classList.contains("top"), g = c.classList.contains("left"), d = c.classList.contains("right"), v = c.classList.contains("bottom"), y = c.classList.contains("line-handle"), { x: _, y: C } = sr(
2200
+ const c = this.handles[this.draggedHandle], g = c.classList.contains("top"), y = c.classList.contains("left"), f = c.classList.contains("right"), m = c.classList.contains("bottom"), v = c.classList.contains("line-handle"), { x: k, y: C } = sr(
2194
2201
  l,
2195
2202
  this.ogma.getContainer()
2196
- ), E = this.ogma.view.getZoom(), P = (_ - this.startX) / E, S = (C - this.startY) / E, $ = this.ogma.view.getAngle(), L = at({ x: P, y: S }, $);
2197
- (v && g || f && d) && (L.y = 0, L.x = 0);
2198
- const T = g || y ? this.rect.x + L.x : this.rect.x, B = f || y ? this.rect.y + L.y : this.rect.y, N = Math.max(
2199
- this.rect.width + P * (y || g ? 0 : 1),
2203
+ ), _ = this.ogma.view.getZoom(), R = (k - this.startX) / _, S = (C - this.startY) / _, D = this.ogma.view.getAngle(), L = at({ x: R, y: S }, D);
2204
+ (m && y || g && f) && (L.y = 0, L.x = 0);
2205
+ const T = y || v ? this.rect.x + L.x : this.rect.x, U = g || v ? this.rect.y + L.y : this.rect.y, H = Math.max(
2206
+ this.rect.width + R * (v || y ? 0 : 1),
2200
2207
  Ar
2201
2208
  ), it = Math.max(
2202
- this.rect.height + S * (y || f ? 0 : 1),
2209
+ this.rect.height + S * (v || g ? 0 : 1),
2203
2210
  Ar
2204
2211
  );
2205
- nn(this.annotation, T, B, N, it), this.emit(De, this.annotation, "text"), this.refreshEditor(), this.layer.refresh();
2212
+ nn(this.annotation, T, U, H, it), this.emit(Me, this.annotation, "text"), this.refreshEditor(), this.layer.refresh();
2206
2213
  }), x(this, "onMouseUp", () => {
2207
2214
  !this.isDragging || this.draggedHandle === Y || (this.restoreDragging(), this.textArea.classList.remove("noevents"), this.textArea.removeAttribute("disabled"), this.emit(Vt, this.annotation), this.isDragging = !1, this.draggedHandle = Y);
2208
2215
  }), x(this, "_onMousedown", (l) => {
@@ -2224,47 +2231,47 @@ class bn extends Br {
2224
2231
  _canRemove() {
2225
2232
  return !this.isFocused;
2226
2233
  }
2227
- detect({ x: e, y: o }, i = 0) {
2228
- const l = { x: e, y: o }, c = this.ogma.view.getAngle();
2229
- return this.elements.find((f) => {
2230
- const { x: g, y: d } = vt(f), { width: v, height: y } = mt(f), _ = { x: g, y: d }, { x: C, y: E } = at(Ct(l, _), -c);
2231
- return C > -i && C < v + i && E > -i && E < y + i;
2234
+ detect({ x: e, y: s }, i = 0) {
2235
+ const l = { x: e, y: s }, c = this.ogma.view.getAngle();
2236
+ return this.elements.find((g) => {
2237
+ const { x: y, y: f } = vt(g), { width: m, height: v } = mt(g), k = { x: y, y: f }, { x: C, y: _ } = at(Ct(l, k), -c);
2238
+ return C > -i && C < m + i && _ > -i && _ < v + i;
2232
2239
  });
2233
2240
  }
2234
2241
  draw(e) {
2235
2242
  e.innerHTML = "";
2236
- const o = "", i = this.ogma.view.getAngle();
2237
- this.elements.forEach((c, f) => {
2238
- const g = `class${f}`, d = mt(c), v = vt(c), y = c.id, {
2239
- color: _,
2243
+ const s = "", i = this.ogma.view.getAngle();
2244
+ this.elements.forEach((c, g) => {
2245
+ const y = `class${g}`, f = mt(c), m = vt(c), v = c.id, {
2246
+ color: k,
2240
2247
  fontSize: C,
2241
- font: E,
2242
- strokeColor: P,
2248
+ font: _,
2249
+ strokeColor: R,
2243
2250
  strokeWidth: S,
2244
- strokeType: $,
2251
+ strokeType: D,
2245
2252
  background: L
2246
2253
  } = c.properties.style || Wt;
2247
- if (y === this.selectedId)
2254
+ if (v === this.selectedId)
2248
2255
  return;
2249
- const T = de("g");
2250
- T.classList.add("annotation-text"), T.setAttribute("fill", `${_}`), T.setAttribute("font-size", `${C}px`), T.setAttribute("font-family", `${E}`);
2251
- const B = de("rect");
2252
- let N = !1;
2253
- $ && $ !== "none" && (N = !0, B.setAttribute("stroke", P || "black"), B.setAttribute("stroke-width", `${S}`), $ === "dashed" && B.setAttribute("stroke-dasharray", "5,5")), (L && L.length || N) && (N = !0, B.setAttribute("fill", L || "transparent")), N && (B.setAttribute("width", `${d.width}`), B.setAttribute("height", `${d.height}`)), T.appendChild(B), mn(c, T);
2254
- const { x: it, y: xt } = at(v, -i);
2255
- T.setAttribute("transform", `translate(${it},${xt})`), T.classList.add(g), T.setAttribute("data-annotation", `${c.id}`), T.setAttribute("data-annotation-type", "text"), e.appendChild(T);
2256
+ const T = ce("g");
2257
+ T.classList.add("annotation-text"), T.setAttribute("fill", `${k}`), T.setAttribute("font-size", `${C}px`), T.setAttribute("font-family", `${_}`);
2258
+ const U = ce("rect");
2259
+ let H = !1;
2260
+ D && D !== "none" && (H = !0, U.setAttribute("stroke", R || "black"), U.setAttribute("stroke-width", `${S}`), D === "dashed" && U.setAttribute("stroke-dasharray", "5,5")), (L && L.length || H) && (H = !0, U.setAttribute("fill", L || "transparent")), H && (U.setAttribute("width", `${f.width}`), U.setAttribute("height", `${f.height}`)), T.appendChild(U), mn(c, T);
2261
+ const { x: it, y: At } = at(m, -i);
2262
+ T.setAttribute("transform", `translate(${it},${At})`), T.classList.add(y), T.setAttribute("data-annotation", `${c.id}`), T.setAttribute("data-annotation-type", "text"), e.appendChild(T);
2256
2263
  });
2257
- const l = de("style");
2258
- l.innerHTML = o, e.firstChild && e.insertBefore(l, e.firstChild);
2264
+ const l = ce("style");
2265
+ l.innerHTML = s, e.firstChild && e.insertBefore(l, e.firstChild);
2259
2266
  }
2260
2267
  refreshDrawing() {
2261
2268
  const e = this.ogma.view.getAngle();
2262
- [...this.layer.element.children].forEach((o) => {
2263
- const i = o.getAttribute("data-annotation");
2269
+ [...this.layer.element.children].forEach((s) => {
2270
+ const i = s.getAttribute("data-annotation");
2264
2271
  if (!i)
2265
2272
  return;
2266
- const l = vt(this.getById(i)), { x: c, y: f } = at(l, -e);
2267
- o.setAttribute("transform", `translate(${c},${f})`);
2273
+ const l = vt(this.getById(i)), { x: c, y: g } = at(l, -e);
2274
+ s.setAttribute("transform", `translate(${c},${g})`);
2268
2275
  });
2269
2276
  }
2270
2277
  getDefaultOptions() {
@@ -2273,16 +2280,16 @@ class bn extends Br {
2273
2280
  refreshEditor() {
2274
2281
  if (+this.selectedId < 0 && +this.hoveredId < 0)
2275
2282
  return;
2276
- const e = this.getById(this.selectedId) || this.getById(this.hoveredId), o = mt(e), i = this.ogma.view.graphToScreenCoordinates(
2283
+ const e = this.getById(this.selectedId) || this.getById(this.hoveredId), s = mt(e), i = this.ogma.view.graphToScreenCoordinates(
2277
2284
  vt(e)
2278
2285
  ), l = this.ogma.view.getZoom(), {
2279
2286
  font: c,
2280
- fontSize: f,
2281
- color: g,
2282
- background: d,
2283
- padding: v = 0
2284
- } = e.properties.style || Wt, y = (f || 1) * l;
2285
- this.textArea.value = e.properties.content, this.editor.element.style.transform = `translate(${i.x}px, ${i.y}px)translate(-50%, -50%)translate(${o.width / 2 * l}px, ${o.height / 2 * l}px)`, this.editor.element.style.width = `${o.width * l}px`, this.editor.element.style.height = `${o.height * l}px`, this.textArea.style.font = `${y} ${c}`, this.textArea.style.fontFamily = c || "sans-serif", this.textArea.style.fontSize = `${y}px`, this.textArea.style.padding = `${l * v}px`, this.textArea.style.lineHeight = `${y}px`, this.textArea.style.boxSizing = "border-box", this.textArea.style.color = g || "black", this.textArea.style.background = d || "transparent", this.textArea.placeholder = this.placeholder, this.layer.refresh();
2287
+ fontSize: g,
2288
+ color: y,
2289
+ background: f,
2290
+ padding: m = 0
2291
+ } = e.properties.style || Wt, v = (g || 1) * l;
2292
+ this.textArea.value = e.properties.content, this.editor.element.style.transform = `translate(${i.x}px, ${i.y}px)translate(-50%, -50%)translate(${s.width / 2 * l}px, ${s.height / 2 * l}px)`, this.editor.element.style.width = `${s.width * l}px`, this.editor.element.style.height = `${s.height * l}px`, this.textArea.style.font = `${v} ${c}`, this.textArea.style.fontFamily = c || "sans-serif", this.textArea.style.fontSize = `${v}px`, this.textArea.style.padding = `${l * m}px`, this.textArea.style.lineHeight = `${v}px`, this.textArea.style.boxSizing = "border-box", this.textArea.style.color = y || "black", this.textArea.style.background = f || "transparent", this.textArea.placeholder = this.placeholder, this.layer.refresh();
2286
2293
  }
2287
2294
  select(e) {
2288
2295
  super.select(e), this.textArea.focus();
@@ -2295,56 +2302,56 @@ class wn {
2295
2302
  constructor() {
2296
2303
  x(this, "links", {}), x(this, "linksByTargetId", {}), x(this, "linksByArrowId", {});
2297
2304
  }
2298
- add(e, o, i, l, c) {
2299
- const f = ze(), g = e.id, d = {
2300
- id: f,
2301
- arrow: g,
2305
+ add(e, s, i, l, c) {
2306
+ const g = Ne(), y = e.id, f = {
2307
+ id: g,
2308
+ arrow: y,
2302
2309
  target: i,
2303
2310
  targetType: l,
2304
2311
  connectionPoint: c,
2305
- side: o
2312
+ side: s
2306
2313
  };
2307
- return this.links[f] = d, this.linksByTargetId[i] || (this.linksByTargetId[i] = []), this.linksByTargetId[i].push(f), this.linksByArrowId[g] || (this.linksByArrowId[g] = {}), this.linksByArrowId[g][o] = f, e.properties.link = e.properties.link || {}, e.properties.link[o] = {
2314
+ return this.links[g] = f, this.linksByTargetId[i] || (this.linksByTargetId[i] = []), this.linksByTargetId[i].push(g), this.linksByArrowId[y] || (this.linksByArrowId[y] = {}), this.linksByArrowId[y][s] = g, e.properties.link = e.properties.link || {}, e.properties.link[s] = {
2308
2315
  id: i,
2309
- side: o,
2316
+ side: s,
2310
2317
  type: l,
2311
2318
  magnet: c
2312
2319
  }, this;
2313
2320
  }
2314
- arrowIsLinked(e, o) {
2321
+ arrowIsLinked(e, s) {
2315
2322
  var i;
2316
- return !!((i = this.linksByArrowId[e]) != null && i[o]);
2323
+ return !!((i = this.linksByArrowId[e]) != null && i[s]);
2317
2324
  }
2318
2325
  // remove the link between the arrow and the target by arrow id and side
2319
- remove(e, o) {
2326
+ remove(e, s) {
2320
2327
  var i, l;
2321
- const c = e.id, f = (i = this.linksByArrowId[c]) == null ? void 0 : i[o];
2322
- if ((l = e.properties.link) == null || delete l[o], !f)
2328
+ const c = e.id, g = (i = this.linksByArrowId[c]) == null ? void 0 : i[s];
2329
+ if ((l = e.properties.link) == null || delete l[s], !g)
2323
2330
  return this;
2324
- const g = this.links[f];
2325
- delete this.links[f];
2326
- const d = this.linksByTargetId[g.target];
2327
- for (let v = 0; v < d.length; v++)
2328
- if (d[v] === f) {
2329
- d.splice(v, 1);
2331
+ const y = this.links[g];
2332
+ delete this.links[g];
2333
+ const f = this.linksByTargetId[y.target];
2334
+ for (let m = 0; m < f.length; m++)
2335
+ if (f[m] === g) {
2336
+ f.splice(m, 1);
2330
2337
  break;
2331
2338
  }
2332
- return delete this.linksByArrowId[c][o], this;
2339
+ return delete this.linksByArrowId[c][s], this;
2333
2340
  }
2334
- getArrowLink(e, o) {
2341
+ getArrowLink(e, s) {
2335
2342
  var i;
2336
- const l = (i = this.linksByArrowId[e]) == null ? void 0 : i[o];
2343
+ const l = (i = this.linksByArrowId[e]) == null ? void 0 : i[s];
2337
2344
  return l ? this.links[l] : null;
2338
2345
  }
2339
- getTargetLinks(e, o) {
2346
+ getTargetLinks(e, s) {
2340
2347
  var i;
2341
- return ((i = this.linksByTargetId[e]) == null ? void 0 : i.map((l) => this.links[l]).filter((l) => l.targetType === o)) ?? [];
2348
+ return ((i = this.linksByTargetId[e]) == null ? void 0 : i.map((l) => this.links[l]).filter((l) => l.targetType === s)) ?? [];
2342
2349
  }
2343
2350
  forEach(e) {
2344
2351
  Object.values(this.links).forEach(e);
2345
2352
  }
2346
2353
  }
2347
- const st = (u) => u.properties.type === "arrow", yt = (u) => u.properties.type === "text", Er = (u) => u.type === "FeatureCollection", xn = {
2354
+ const st = (h) => h.properties.type === "arrow", yt = (h) => h.properties.type === "text", Er = (h) => h.type === "FeatureCollection", xn = {
2348
2355
  magnetColor: "#3e8",
2349
2356
  detectMargin: 20,
2350
2357
  magnetHandleRadius: 5,
@@ -2365,7 +2372,7 @@ const st = (u) => u.properties.type === "arrow", yt = (u) => u.properties.type =
2365
2372
  { x: 1, y: 1 }
2366
2373
  ];
2367
2374
  class An extends Nr {
2368
- constructor(e, o = {}) {
2375
+ constructor(e, s = {}) {
2369
2376
  super(), x(this, "arrows"), x(this, "texts"), x(this, "links", new wn()), 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", (i) => {
2370
2377
  if (!this.dragged || this.textToMagnet === void 0)
2371
2378
  return;
@@ -2374,27 +2381,27 @@ class An extends Nr {
2374
2381
  kr.forEach((c) => {
2375
2382
  if (!this.textToMagnet)
2376
2383
  return;
2377
- const f = mt(this.textToMagnet), g = vt(this.textToMagnet), d = Fe(c, { x: f.width, y: f.height }), v = at(d, this.ogma.view.getAngle()), { x: y, y: _ } = Ht(v, g);
2378
- i.moveTo(y, _), i.arc(y, _, this.options.magnetHandleRadius / l, 0, Math.PI * 2);
2384
+ const g = mt(this.textToMagnet), y = vt(this.textToMagnet), f = je(c, { x: g.width, y: g.height }), m = at(f, this.ogma.view.getAngle()), { x: v, y: k } = Ht(m, y);
2385
+ i.moveTo(v, k), i.arc(v, k, this.options.magnetHandleRadius / l, 0, Math.PI * 2);
2379
2386
  }), i.fill(), i.closePath();
2380
2387
  }), x(this, "_onFeatureDrag", (i, l) => {
2381
2388
  const c = l;
2382
2389
  if (st(i) && c === "line")
2383
- ["start", "end"].find((f) => {
2384
- const g = f === "start" ? fe(i) : $e(i);
2385
- return this._snapToText(i, c, g) || this._findAndSnapToNode(i, f, g);
2390
+ ["start", "end"].find((g) => {
2391
+ const y = g === "start" ? de(i) : $e(i);
2392
+ return this._snapToText(i, c, y) || this._findAndSnapToNode(i, g, y);
2386
2393
  });
2387
2394
  else if (st(i) && c !== "line") {
2388
- const f = c === "start" ? fe(i) : $e(i);
2389
- this._snapToText(i, c, f) || this._findAndSnapToNode(i, c, f);
2395
+ const g = c === "start" ? de(i) : $e(i);
2396
+ this._snapToText(i, c, g) || this._findAndSnapToNode(i, c, g);
2390
2397
  } else
2391
- yt(i) && (this.activeLinks.forEach(({ arrow: f, side: g, connectionPoint: d }) => {
2392
- const v = this.getAnnotation(f), y = mt(i), _ = vt(i), C = Fe(d, { x: y.width, y: y.height }), E = at(C, this.ogma.view.getAngle()), P = Ht(E, _);
2393
- v.geometry.coordinates[g === "start" ? 0 : 1] = [P.x, P.y];
2398
+ yt(i) && (this.activeLinks.forEach(({ arrow: g, side: y, connectionPoint: f }) => {
2399
+ const m = this.getAnnotation(g), v = mt(i), k = vt(i), C = je(f, { x: v.width, y: v.height }), _ = at(C, this.ogma.view.getAngle()), R = Ht(_, k);
2400
+ m.geometry.coordinates[y === "start" ? 0 : 1] = [R.x, R.y];
2394
2401
  }), this.activeLinks.length && this.arrows.refreshLayer());
2395
- this.layer.refresh(), this.emit(De, i, l);
2402
+ this.layer.refresh(), this.emit(Me, i, l);
2396
2403
  }), x(this, "_onFeatureDragEnd", (i) => {
2397
- this.dragged !== null && st(i) && fe(this.dragged) && _r.forEach((l) => {
2404
+ this.dragged !== null && st(i) && de(this.dragged) && _r.forEach((l) => {
2398
2405
  this.links.getArrowLink(i.id, l) && this.emit(dn, {
2399
2406
  arrow: i,
2400
2407
  link: this.links.getArrowLink(i.id, l)
@@ -2404,7 +2411,7 @@ class An extends Nr {
2404
2411
  this.textToMagnet = void 0, st(i) ? this.dragged = i : yt(i) && this.activeLinks.push(...this.links.getTargetLinks(i.id, "text")), this.annotations.forEach((l) => {
2405
2412
  const c = l.getSelectedFeature();
2406
2413
  c && c !== i && l.unhover().unselect(), l.disableDetection();
2407
- }), this.emit(Me, i);
2414
+ }), this.emit(ze, i);
2408
2415
  }), x(this, "_onNodesDragStart", () => {
2409
2416
  this.arrows.unhover().unselect(), this.texts.unhover().unselect();
2410
2417
  }), x(this, "_onNodesDrag", (i) => {
@@ -2412,12 +2419,12 @@ class An extends Nr {
2412
2419
  this._moveNodes(i.nodes, l, c);
2413
2420
  }), x(this, "_onLayoutEnd", (i) => {
2414
2421
  i.ids.forEach((l, c) => {
2415
- this.links.getTargetLinks(l, "node").forEach((f) => {
2416
- const g = this.getAnnotation(f.arrow), d = f.side, v = Ie(
2417
- g,
2418
- d === "start" ? "end" : "start"
2419
- ), y = i.positions.current[c], _ = this.ogma.getNode(l).getAttribute("radius"), C = Le(v, y, +_);
2420
- Bt(g, d, C.x, C.y);
2422
+ this.links.getTargetLinks(l, "node").forEach((g) => {
2423
+ const y = this.getAnnotation(g.arrow), f = g.side, m = Le(
2424
+ y,
2425
+ f === "start" ? "end" : "start"
2426
+ ), v = i.positions.current[c], k = this.ogma.getNode(l).getAttribute("radius"), C = Fe(m, v, +k);
2427
+ Bt(y, f, C.x, C.y);
2421
2428
  });
2422
2429
  }), this.arrows.refreshLayer(), this.texts.refreshLayer();
2423
2430
  }), x(this, "_onAdded", (i) => {
@@ -2434,59 +2441,59 @@ class An extends Nr {
2434
2441
  );
2435
2442
  }), x(this, "_onUpdate", (i) => {
2436
2443
  this.emit(cr, i);
2437
- }), this.options = this.setOptions({ ...xn, ...o }), this.ogma = e, this.arrows = new pn(e, this.options), this.texts = new bn(e, this.options), this.annotations = [this.arrows, this.texts], this.annotations.forEach((i) => {
2438
- i.on(Me, this._onFeatureDragStart).on(De, this._onFeatureDrag).on(Vt, this._onFeatureDragEnd).on(cr, this.onUpdate).on(lr, this._onUnselect).on(ar, this._onSelect).on(hr, this._onAdded).on(ur, this._onRemoved);
2444
+ }), this.options = this.setOptions({ ...xn, ...s }), this.ogma = e, this.arrows = new pn(e, this.options), this.texts = new bn(e, this.options), this.annotations = [this.arrows, this.texts], this.annotations.forEach((i) => {
2445
+ i.on(ze, this._onFeatureDragStart).on(Me, this._onFeatureDrag).on(Vt, this._onFeatureDragEnd).on(cr, this.onUpdate).on(lr, this._onUnselect).on(ar, this._onSelect).on(hr, this._onAdded).on(ur, this._onRemoved);
2439
2446
  }), this.ogma.events.on("nodesDragStart", this._onNodesDragStart).on("nodesDragProgress", this._onNodesDrag).on("layoutEnd", this._onLayoutEnd).on(["viewChanged", "rotate"], () => {
2440
2447
  this.refreshTextLinks();
2441
2448
  }), this.layer = e.layers.addCanvasLayer(this._render), this.layer.moveToBottom();
2442
2449
  }
2443
- _moveNodes(e, o, i) {
2450
+ _moveNodes(e, s, i) {
2444
2451
  e.forEach((l) => {
2445
- const c = this.links.getTargetLinks(l.getId(), "node"), f = l.getPosition();
2446
- c.forEach((g) => {
2447
- const d = this.getAnnotation(g.arrow), v = g.side, y = Ie(
2448
- d,
2449
- v === "start" ? "end" : "start"
2452
+ const c = this.links.getTargetLinks(l.getId(), "node"), g = l.getPosition();
2453
+ c.forEach((y) => {
2454
+ const f = this.getAnnotation(y.arrow), m = y.side, v = Le(
2455
+ f,
2456
+ m === "start" ? "end" : "start"
2450
2457
  );
2451
- let _ = f;
2452
- const C = +l.getAttribute("radius"), E = 1e-6;
2453
- (g.connectionPoint.x - (f.x - o) > E || g.connectionPoint.y - (f.y - i) > E) && (_ = Le(y, f, C)), Bt(d, v, _.x, _.y);
2458
+ let k = g;
2459
+ const C = +l.getAttribute("radius"), _ = 1e-6;
2460
+ (y.connectionPoint.x - (g.x - s) > _ || y.connectionPoint.y - (g.y - i) > _) && (k = Fe(v, g, C)), Bt(f, m, k.x, k.y);
2454
2461
  });
2455
2462
  }), this.arrows.refreshLayer();
2456
2463
  }
2457
- _snapToText(e, o, i) {
2464
+ _snapToText(e, s, i) {
2458
2465
  const l = this.texts.detect(i, this.options.detectMargin);
2459
- if (this.links.remove(e, o), !l)
2466
+ if (this.links.remove(e, s), !l)
2460
2467
  return !1;
2461
2468
  this.textToMagnet = l;
2462
2469
  const c = this.findMagnetPoint(kr, l, i);
2463
- return c ? (Bt(e, o, c.point.x, c.point.y), this.links.add(e, o, l.id, "text", c.magnet), !0) : !1;
2470
+ return c ? (Bt(e, s, c.point.x, c.point.y), this.links.add(e, s, l.id, "text", c.magnet), !0) : !1;
2464
2471
  }
2465
- _findAndSnapToNode(e, o, i) {
2472
+ _findAndSnapToNode(e, s, i) {
2466
2473
  var l, c;
2467
- const f = this.ogma.view.graphToScreenCoordinates(i), g = this.ogma.view.getElementAt(f);
2468
- 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, f)) : ((c = this.hoveredNode) == null || c.setSelected(!1), this.hoveredNode = null);
2469
- }
2470
- _snapToNode(e, o, i, l) {
2471
- const c = i.getPositionOnScreen(), f = +i.getAttribute("radius"), g = f * this.ogma.view.getZoom(), d = l.x - c.x, v = l.y - c.y, y = Math.sqrt(d * d + v * v), _ = i.getPosition();
2472
- if (y < g + this.options.detectMargin) {
2473
- let C = _;
2474
- if (y > g / 2) {
2475
- const E = Ie(e, o === "end" ? "start" : "end");
2476
- C = Le(E, C, f);
2474
+ const g = this.ogma.view.graphToScreenCoordinates(i), y = this.ogma.view.getElementAt(g);
2475
+ this.links.remove(e, s), y && y.isNode ? ((l = this.hoveredNode) == null || l.setSelected(!1), this.hoveredNode = y, y.setSelected(!0), this._snapToNode(e, s, y, g)) : ((c = this.hoveredNode) == null || c.setSelected(!1), this.hoveredNode = null);
2476
+ }
2477
+ _snapToNode(e, s, i, l) {
2478
+ const c = i.getPositionOnScreen(), g = +i.getAttribute("radius"), y = g * this.ogma.view.getZoom(), f = l.x - c.x, m = l.y - c.y, v = Math.sqrt(f * f + m * m), k = i.getPosition();
2479
+ if (v < y + this.options.detectMargin) {
2480
+ let C = k;
2481
+ if (v > y / 2) {
2482
+ const _ = Le(e, s === "end" ? "start" : "end");
2483
+ C = Fe(_, C, g);
2477
2484
  }
2478
- Bt(e, o, C.x, C.y), this.links.add(e, o, i.getId(), "node", C);
2485
+ Bt(e, s, C.x, C.y), this.links.add(e, s, i.getId(), "node", C);
2479
2486
  }
2480
2487
  }
2481
2488
  refreshTextLinks() {
2482
2489
  let e = !1;
2483
2490
  this.links.forEach(
2484
- ({ connectionPoint: o, targetType: i, target: l, arrow: c, side: f }) => {
2491
+ ({ connectionPoint: s, targetType: i, target: l, arrow: c, side: g }) => {
2485
2492
  if (i !== "text")
2486
2493
  return;
2487
2494
  e = !0;
2488
- const g = this.getAnnotation(l), d = this.getAnnotation(c), v = mt(g), y = vt(g), _ = Fe(o, { x: v.width, y: v.height }), C = at(_, this.ogma.view.getAngle()), E = Ht(C, y);
2489
- Bt(d, f, E.x, E.y);
2495
+ const y = this.getAnnotation(l), f = this.getAnnotation(c), m = mt(y), v = vt(y), k = je(s, { x: m.width, y: m.height }), C = at(k, this.ogma.view.getAngle()), _ = Ht(C, v);
2496
+ Bt(f, g, _.x, _.y);
2490
2497
  }
2491
2498
  ), e && this.arrows.refreshLayer();
2492
2499
  }
@@ -2496,18 +2503,18 @@ class An extends Nr {
2496
2503
  getSelected() {
2497
2504
  return this.selected;
2498
2505
  }
2499
- findMagnetPoint(e, o, i) {
2506
+ findMagnetPoint(e, s, i) {
2500
2507
  let l;
2501
2508
  for (const c of e) {
2502
- const f = mt(o), g = vt(o), d = Fe(c, { x: f.width, y: f.height }), v = at(d, this.ogma.view.getAngle()), y = Ht(v, g), _ = Ut(Ct(y, i)), C = Math.min(
2509
+ const g = mt(s), y = vt(s), f = je(c, { x: g.width, y: g.height }), m = at(f, this.ogma.view.getAngle()), v = Ht(m, y), k = Ut(Ct(v, i)), C = Math.min(
2503
2510
  this.options.magnetRadius * this.ogma.view.getZoom(),
2504
2511
  // when really zoomed in: avoid to snap on too far away magnets
2505
- f.width / 2,
2506
- f.height / 2
2512
+ g.width / 2,
2513
+ g.height / 2
2507
2514
  );
2508
- if (_ < Math.max(C, this.options.magnetHandleRadius)) {
2515
+ if (k < Math.max(C, this.options.magnetHandleRadius)) {
2509
2516
  l = {
2510
- point: y,
2517
+ point: v,
2511
2518
  magnet: c
2512
2519
  };
2513
2520
  break;
@@ -2531,8 +2538,8 @@ class An extends Nr {
2531
2538
  * @param id the id of the annotation to select
2532
2539
  */
2533
2540
  select(e) {
2534
- const o = this.getAnnotations().features.find((i) => i.id === e);
2535
- return o ? (st(o) ? this.arrows.select(o.id) : yt(o) && this.texts.select(o.id), this) : this;
2541
+ const s = this.getAnnotations().features.find((i) => i.id === e);
2542
+ return s ? (st(s) ? this.arrows.select(s.id) : yt(s) && this.texts.select(s.id), this) : this;
2536
2543
  }
2537
2544
  /**
2538
2545
  * Unselects the currently selected annotation
@@ -2546,11 +2553,11 @@ class An extends Nr {
2546
2553
  */
2547
2554
  add(e) {
2548
2555
  if (Er(e)) {
2549
- const [o, i] = e.features.reduce(
2556
+ const [s, i] = e.features.reduce(
2550
2557
  (l, c) => (st(c) ? l[1].push(c) : yt(c) && l[0].push(c), l),
2551
2558
  [[], []]
2552
2559
  );
2553
- return o.forEach((l) => this.add(l)), i.forEach((l) => this.add(l)), this.arrows.refreshLayer(), this;
2560
+ return s.forEach((l) => this.add(l)), i.forEach((l) => this.add(l)), this.arrows.refreshLayer(), this;
2554
2561
  }
2555
2562
  switch (e.properties.type) {
2556
2563
  case "text":
@@ -2568,28 +2575,28 @@ class An extends Nr {
2568
2575
  */
2569
2576
  remove(e) {
2570
2577
  return Er(e) ? (e.features.forEach(
2571
- (o) => this.remove(o)
2578
+ (s) => this.remove(s)
2572
2579
  ), this) : (st(e) ? (this.links.remove(e, "start"), this.links.remove(e, "end"), this.arrows.remove(e.id)) : this.texts.remove(e.id), this);
2573
2580
  }
2574
2581
  loadLink(e) {
2575
2582
  if (e.properties.link)
2576
- for (const o of _r) {
2577
- const i = e.properties.link[o];
2583
+ for (const s of _r) {
2584
+ const i = e.properties.link[s];
2578
2585
  if (!i)
2579
2586
  continue;
2580
2587
  const l = this.getAnnotation(i.id);
2581
2588
  if (i.type === "text" && l)
2582
- this.links.add(e, o, i.id, i.type, i.magnet);
2589
+ this.links.add(e, s, i.id, i.type, i.magnet);
2583
2590
  else if (i.type === "node") {
2584
2591
  const c = this.ogma.getNode(i.id);
2585
2592
  if (!c)
2586
2593
  continue;
2587
- this.links.add(e, o, i.id, i.type, i.magnet);
2588
- const f = c.getPosition(), g = c.getAttribute("radius") || 0, d = Ie(
2594
+ this.links.add(e, s, i.id, i.type, i.magnet);
2595
+ const g = c.getPosition(), y = c.getAttribute("radius") || 0, f = Le(
2589
2596
  e,
2590
- o === "start" ? "end" : "start"
2591
- ), v = Le(d, f, +g);
2592
- Bt(e, o, v.x, v.y);
2597
+ s === "start" ? "end" : "start"
2598
+ ), m = Fe(f, g, +y);
2599
+ Bt(e, s, m.x, m.y);
2593
2600
  }
2594
2601
  }
2595
2602
  }
@@ -2599,8 +2606,8 @@ class An extends Nr {
2599
2606
  * @param y coord of the first point
2600
2607
  * @param arrow The arrow to add
2601
2608
  */
2602
- startArrow(e, o, i) {
2603
- this.cancelDrawing(), this.arrows.startDrawing(e, o, i);
2609
+ startArrow(e, s, i) {
2610
+ this.cancelDrawing(), this.arrows.startDrawing(e, s, i);
2604
2611
  }
2605
2612
  /**
2606
2613
  * Start adding a text (add it, and give control to the user)
@@ -2608,8 +2615,8 @@ class An extends Nr {
2608
2615
  * @param y coord of the top left point
2609
2616
  * @param text The text to add
2610
2617
  */
2611
- startText(e, o, i) {
2612
- this.cancelDrawing(), this.texts.startDrawing(e, o, i);
2618
+ startText(e, s, i) {
2619
+ this.cancelDrawing(), this.texts.startDrawing(e, s, i);
2613
2620
  }
2614
2621
  /**
2615
2622
  * Cancel drawing on the current frame
@@ -2622,13 +2629,13 @@ class An extends Nr {
2622
2629
  * @param id The id of the annotation to update
2623
2630
  * @param style The new style
2624
2631
  */
2625
- updateStyle(e, o) {
2632
+ updateStyle(e, s) {
2626
2633
  const i = this.getAnnotations().features.find((l) => l.id === e);
2627
- return i ? (st(i) ? this.arrows.updateStyle(i, o) : yt(i) && this.texts.updateStyle(i, o), this.onUpdate(i), this) : this;
2634
+ return i ? (st(i) ? this.arrows.updateStyle(i, s) : yt(i) && this.texts.updateStyle(i, s), this.onUpdate(i), this) : this;
2628
2635
  }
2629
- setScale(e, o, i, l) {
2630
- const c = this.getAnnotations().features.find((f) => f.id === e);
2631
- return c ? (st(c) ? this.arrows.scale(c, o, i, l) : yt(c) && this.texts.scale(c, o, i, l), this.onUpdate(c), this) : this;
2636
+ setScale(e, s, i, l) {
2637
+ const c = this.getAnnotations().features.find((g) => g.id === e);
2638
+ return c ? (st(c) ? this.arrows.scale(c, s, i, l) : yt(c) && this.texts.scale(c, s, i, l), this.onUpdate(c), this) : this;
2632
2639
  }
2633
2640
  /**
2634
2641
  *
@@ -2639,8 +2646,8 @@ class An extends Nr {
2639
2646
  type: "FeatureCollection",
2640
2647
  features: []
2641
2648
  };
2642
- return this.annotations.forEach((o) => {
2643
- e.features = [...e.features, ...o.getElements()];
2649
+ return this.annotations.forEach((s) => {
2650
+ e.features = [...e.features, ...s.getElements()];
2644
2651
  }), e;
2645
2652
  }
2646
2653
  /**
@@ -2649,7 +2656,7 @@ class An extends Nr {
2649
2656
  * @returns The annotation with the given id
2650
2657
  */
2651
2658
  getAnnotation(e) {
2652
- return this.getAnnotations().features.find((o) => o.id === e);
2659
+ return this.getAnnotations().features.find((s) => s.id === e);
2653
2660
  }
2654
2661
  /**
2655
2662
  * Destroy the controller and its elements
@@ -2683,7 +2690,7 @@ const Tr = [8, 10, 12, 14, 16, 24, 32, 48, 64, 72], Sr = "none", Ur = "#333333",
2683
2690
  "Consolas",
2684
2691
  "Courier New",
2685
2692
  "monospace"
2686
- ].sort((u, e) => u.toLocaleLowerCase().localeCompare(e.toLocaleLowerCase())), En = {
2693
+ ].sort((h, e) => h.toLocaleLowerCase().localeCompare(e.toLocaleLowerCase())), En = {
2687
2694
  head: "arrow",
2688
2695
  strokeColor: Ur,
2689
2696
  strokeWidth: 5
@@ -2695,97 +2702,97 @@ const Tr = [8, 10, 12, 14, 16, 24, 32, 48, 64, 72], Sr = "none", Ur = "#333333",
2695
2702
  strokeType: Sr,
2696
2703
  background: Sr
2697
2704
  };
2698
- function Tn(u) {
2699
- return u.reduce((e, o) => e + o, 0) / u.length;
2705
+ function Tn(h) {
2706
+ return h.reduce((e, s) => e + s, 0) / h.length;
2700
2707
  }
2701
- function In(u, e = 0, o = 1) {
2702
- return e + (o - e) * u;
2708
+ function In(h, e = 0, s = 1) {
2709
+ return e + (s - e) * h;
2703
2710
  }
2704
- function Ln(u, e = 0, o = 1) {
2705
- return (u - e) / (o - e);
2711
+ function Ln(h, e = 0, s = 1) {
2712
+ return (h - e) / (s - e);
2706
2713
  }
2707
2714
  function Fn() {
2708
2715
  return Or(null);
2709
2716
  }
2710
2717
  const Wr = Or(
2711
2718
  void 0
2712
- ), $n = () => qr(Wr), Sn = (u, e) => {
2719
+ ), jn = () => qr(Wr), Sn = (h, e) => {
2713
2720
  switch (e.type) {
2714
2721
  case "add":
2715
2722
  return {
2716
- ...u,
2717
- features: [...u.features, e.payload]
2723
+ ...h,
2724
+ features: [...h.features, e.payload]
2718
2725
  };
2719
2726
  case "remove":
2720
2727
  return {
2721
- ...u,
2722
- features: u.features.filter((o) => o.id !== e.payload.id)
2728
+ ...h,
2729
+ features: h.features.filter((s) => s.id !== e.payload.id)
2723
2730
  };
2724
2731
  case "update":
2725
2732
  return {
2726
- ...u,
2727
- features: u.features.map(
2728
- (o) => o.id === e.payload.id ? e.payload : o
2733
+ ...h,
2734
+ features: h.features.map(
2735
+ (s) => s.id === e.payload.id ? e.payload : s
2729
2736
  )
2730
2737
  };
2731
2738
  default:
2732
- return u;
2739
+ return h;
2733
2740
  }
2734
- }, jn = ({ children: u }) => {
2735
- const e = Gr(), [o, i] = Yr(Sn, {
2741
+ }, $n = ({ children: h }) => {
2742
+ const e = Gr(), [s, i] = Yr(Sn, {
2736
2743
  type: "FeatureCollection",
2737
2744
  features: []
2738
- }), [l, c] = Nt(null), [f, g] = Nt(En), [d, v] = Nt(kn), [y, _] = Nt(), [C, E] = Nt(1), [P, S] = Nt(1);
2745
+ }), [l, c] = Nt(null), [g, y] = Nt(En), [f, m] = Nt(kn), [v, k] = Nt(), [C, _] = Nt(1), [R, S] = Nt(1);
2739
2746
  return er(() => {
2740
2747
  if (!e)
2741
2748
  return;
2742
- const $ = new An(e, {
2749
+ const D = new An(e, {
2743
2750
  minArrowHeight: 1
2744
2751
  }), L = Tn(e.getNodes().getAttribute("radius")) / 5, T = C;
2745
- return g({
2746
- ...f,
2747
- strokeWidth: (f.strokeWidth || 1) * T
2748
- }), E(T), S(L), $.on("select", (B) => {
2749
- st(B) ? g({
2750
- ...B.properties.style || {}
2751
- }) : yt(B) && v({
2752
- ...B.properties.style || {}
2753
- }), c(B);
2752
+ return y({
2753
+ ...g,
2754
+ strokeWidth: (g.strokeWidth || 1) * T
2755
+ }), _(T), S(L), D.on("select", (U) => {
2756
+ st(U) ? y({
2757
+ ...U.properties.style || {}
2758
+ }) : yt(U) && m({
2759
+ ...U.properties.style || {}
2760
+ }), c(U);
2754
2761
  }).on("unselect", () => {
2755
2762
  c(null);
2756
- }), _($), () => {
2757
- y == null || y.destroy();
2763
+ }), k(D), () => {
2764
+ v == null || v.destroy();
2758
2765
  };
2759
2766
  }, [e]), er(() => {
2760
- y && l && (l == null ? void 0 : l.properties.type) === "arrow" && y.updateStyle(l.id, f);
2761
- }, [y, f, l]), er(() => {
2762
- y && l && (l == null ? void 0 : l.properties.type) === "text" && y.updateStyle(l.id, d);
2763
- }, [y, d, l]), /* @__PURE__ */ Zr.jsx(
2767
+ v && l && (l == null ? void 0 : l.properties.type) === "arrow" && v.updateStyle(l.id, g);
2768
+ }, [v, g, l]), er(() => {
2769
+ v && l && (l == null ? void 0 : l.properties.type) === "text" && v.updateStyle(l.id, f);
2770
+ }, [v, f, l]), /* @__PURE__ */ Kr.jsx(
2764
2771
  Wr.Provider,
2765
2772
  {
2766
2773
  value: {
2767
- annotations: o,
2774
+ annotations: s,
2768
2775
  updateAnnotations: i,
2769
2776
  currentAnnotation: l,
2770
2777
  setCurrentAnnotation: c,
2771
- textStyle: d,
2772
- setTextStyle: v,
2773
- arrowStyle: f,
2774
- setArrowStyle: g,
2778
+ textStyle: f,
2779
+ setTextStyle: m,
2780
+ arrowStyle: g,
2781
+ setArrowStyle: y,
2775
2782
  arrowWidthFactor: C,
2776
- setArrowWidthFactor: E,
2777
- textSizeFactor: P,
2783
+ setArrowWidthFactor: _,
2784
+ textSizeFactor: R,
2778
2785
  setTextSizeFactor: S,
2779
- editor: y,
2780
- setEditor: _
2786
+ editor: v,
2787
+ setEditor: k
2781
2788
  },
2782
- children: u
2789
+ children: h
2783
2790
  }
2784
2791
  );
2785
2792
  };
2786
2793
  export {
2787
2794
  Wr as AnnotationsContext,
2788
- jn as AnnotationsContextProvider,
2795
+ $n as AnnotationsContextProvider,
2789
2796
  Ur as BLACK,
2790
2797
  _n as RELATIVE_PADDING,
2791
2798
  Sr as TRANSPARENT,
@@ -2798,5 +2805,5 @@ export {
2798
2805
  In as interpolate,
2799
2806
  Tn as mean,
2800
2807
  Ln as normalize,
2801
- $n as useAnnotationsContext
2808
+ jn as useAnnotationsContext
2802
2809
  };