@linkurious/ogma-annotations 1.1.13 → 1.1.15

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,498 +1,14 @@
1
- var In = Object.defineProperty;
2
- var Mn = (u, l, t) => l in u ? In(u, l, { enumerable: !0, configurable: !0, writable: !0, value: t }) : u[l] = t;
3
- var v = (u, l, t) => (Mn(u, typeof l != "symbol" ? l + "" : l, t), t);
4
- var Dn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
5
- function fe(u) {
6
- return u && u.__esModule && Object.prototype.hasOwnProperty.call(u, "default") ? u.default : u;
7
- }
8
- var Re = { exports: {} };
9
- (function(u) {
10
- (function(l, t) {
11
- u.exports = t();
12
- })("Vector", function() {
13
- var l = function() {
14
- var t = Math.PI * 2, r = 180 / Math.PI, a = Math.PI / 180;
15
- function h(s) {
16
- return Math.round(s * 1e8) / 1e8;
17
- }
18
- function f(s, d) {
19
- var m = d.x - s.x, A = d.y - s.y;
20
- return Math.sqrt(m * m + A * A);
21
- }
22
- function g(s, d, m) {
23
- var A = d.y - s.y, T = d.x - s.x, b = Math.atan2(A, T);
24
- if (m)
25
- for (; b < 0; )
26
- b += t;
27
- return b;
28
- }
29
- function p(s, d) {
30
- this.x = s !== void 0 ? s : 0, this.y = d !== void 0 ? d : 0;
31
- }
32
- return p.fromRadians = function(s) {
33
- var d = Math.cos(s), m = Math.sin(s);
34
- return new p(d, m);
35
- }, p.fromDegrees = function(s) {
36
- var d = s * (Math.PI / 180);
37
- return p.fromRadians(d);
38
- }, p.fromString = function(s) {
39
- var d = s.split(",");
40
- return new p(parseFloat(d[0]), parseFloat(d[1]));
41
- }, p.fromArray = function(s) {
42
- return new p(s[0], s[1]);
43
- }, p.prototype = {
44
- // version
45
- version: "2.0.1",
46
- // [API]
47
- // [chainable, clone]
48
- // clone the vector and return the cloned instance.
49
- // @return cloned vector.
50
- clone: function() {
51
- return new p(this.x, this.y);
52
- },
53
- // [API]
54
- // []
55
- // Get if equal to another vector
56
- // @param vector - other vector to compare with.
57
- // @return if vectors are equal.
58
- equals: function(s) {
59
- return this.prototype === s.prototype && this.x === s.x && this.y === s.y;
60
- },
61
- // [API]
62
- // [chainable, changeSelf]
63
- // set values from another vector. this changes value of self.
64
- // @param vector - other vector to get values from.
65
- // @return self.
66
- copy: function(s) {
67
- return this.x = s.x, this.y = s.y, this;
68
- },
69
- // [API]
70
- // [chainable, changeSelf]
71
- // set only the x component from another vector.
72
- // @return self.
73
- copyX: function(s) {
74
- return this.x = s.x, this;
75
- },
76
- // [API]
77
- // [chainable, changeSelf]
78
- // set only the y component from another vector.
79
- // @return self.
80
- copyY: function(s) {
81
- return this.y = s.y, this;
82
- },
83
- // [API]
84
- // []
85
- // convert to a dictionary with {x, y}.
86
- // @return a dictionary representation of the vector.
87
- toDict: function() {
88
- return { x: this.x, y: this.y };
89
- },
90
- // [API]
91
- // []
92
- // convert to array with [x, y].
93
- // @return an array representation of the vector.
94
- toArray: function() {
95
- return [this.x, this.y];
96
- },
97
- // [API]
98
- // [chainable, changeSelf]
99
- // set values from x, y.
100
- // @param x - optional x component to set.
101
- // @param y - optional y component to set.
102
- // @return self.
103
- set: function(s, d) {
104
- return s !== void 0 && (this.x = s), d !== void 0 && (this.y = d), this;
105
- },
106
- // [API]
107
- // [chainable, clone]
108
- // clone and flip between x and y values.
109
- // @return cloned vector with flipped x and y components.
110
- flipXY: function() {
111
- return new p(this.y, this.x);
112
- },
113
- // [API]
114
- // [chainable, changeSelf]
115
- // flip between x and y values.
116
- // @return self.
117
- flipXYSelf: function() {
118
- return this.y = [this.x, this.x = this.y][0], this;
119
- },
120
- // [API]
121
- // [chainable, clone]
122
- // clone and invert x and y values (like multiply with -1, eg x, y => -x, -y)
123
- // @return cloned vector with inverted values.
124
- invert: function() {
125
- return this.mulScalar(-1);
126
- },
127
- // [API]
128
- // [chainable, changeSelf]
129
- // invert x and y values (like multiply with -1, eg x, y => -x, -y)
130
- // @return self.
131
- invertSelf: function() {
132
- return this.mulScalarSelf(-1), this;
133
- },
134
- // [API]
135
- // []
136
- // get the distance from another vector.
137
- // @param other - vector to get distance from.
138
- // @return distance between vectors.
139
- distanceFrom: function(s) {
140
- return f(this, s);
141
- },
142
- // [API]
143
- // []
144
- // get angle from another vector in radians.
145
- // @return angle in radians from this to other.
146
- radiansTo: function(s) {
147
- return g(this, s, !0);
148
- },
149
- // [API]
150
- // []
151
- // get degrees from another vector in degrees.
152
- // @return angle in degrees from this to other.
153
- degreesTo: function(s) {
154
- return g(this, s, !0) * r;
155
- },
156
- // [API]
157
- // []
158
- // convert this vector to a radian angle.
159
- // this is equivalent to doing Vector.zero.radiansTo(this).
160
- // @return angle in radians.
161
- toRadians: function(s) {
162
- return g(p.zero, this, !0);
163
- },
164
- // [API]
165
- // []
166
- // convert this vector to degree.
167
- // this is equivalent to doing Vector.zero.degreeTo(this).
168
- // @return angle in degrees (0-360).
169
- toDegrees: function(s) {
170
- return this.toRadians() * r;
171
- },
172
- // [API]
173
- // [chainable, changeSelf]
174
- // rotate this vector by a given degree.
175
- // @param degrees - degrees to rotate this vector by (can be positive or negative).
176
- // @return self.
177
- rotateDegreesSelf: function(s) {
178
- return this.rotateRadiansSelf(s * a);
179
- },
180
- // [API]
181
- // [chainable]
182
- // clone and rotate the vector by a given degree.
183
- // @param degrees - degree to rotate this vector by (can be positive or negative).
184
- // @return cloned rotated vector.
185
- rotateDegrees: function(s) {
186
- return this.clone().rotateDegreesSelf(s);
187
- },
188
- // [API]
189
- // [chainable, changeSelf]
190
- // rotate this vector by a given radian.
191
- // @param radians - radians to rotate this vector by (can be positive or negative).
192
- // @return self.
193
- rotateRadiansSelf: function(s) {
194
- var d = Math.cos(s), m = Math.sin(s), A = this.x * d - this.y * m, T = this.x * m + this.y * d;
195
- return this.x = h(A), this.y = h(T), this;
196
- },
197
- // [API]
198
- // [chainable]
199
- // clone and rotate the vector by a given degree.
200
- // @param radians - radians to rotate this vector by (can be positive or negative).
201
- // @return cloned rotated vector.
202
- rotateRadians: function(s) {
203
- return this.clone().rotateRadiansSelf(s);
204
- },
205
- // [API]
206
- // []
207
- // calculate the length of this vector (aka magnitude).
208
- // @return vector length.
209
- length: function() {
210
- return Math.sqrt(this.x * this.x + this.y * this.y);
211
- },
212
- // [API]
213
- // [chainable, changeSelf]
214
- // normalize this vector, eg make length equal 1.
215
- // @return self.
216
- normalizeSelf: function() {
217
- var s = Math.sqrt(this.x * this.x + this.y * this.y);
218
- return s === 0 ? this : (this.x /= s, this.y /= s, this);
219
- },
220
- // [API]
221
- // [chainable, clone]
222
- // clone and normalize the vector.
223
- // @return normalized vector.
224
- normalize: function() {
225
- return this.clone().normalizeSelf();
226
- },
227
- // [API]
228
- // [chainable, changeSelf]
229
- // add other vector to self.
230
- // for example, v(10, 11) + v(5, 6) = v(15, 17).
231
- // @param other - vector to add components to self.
232
- // @return self.
233
- addSelf: function(s) {
234
- return typeof s == "number" ? this.addScalarSelf(s) : (this.x += s.x, this.y += s.y, this);
235
- },
236
- // [API]
237
- // [chainable, changeSelf]
238
- // subtract other vector from self.
239
- // for example, v(10, 10) - v(2, 3) = v(8, 7).
240
- // @param other - vector to subtract components from self.
241
- // @return self.
242
- subSelf: function(s) {
243
- return typeof s == "number" ? this.subScalarSelf(s) : (this.x -= s.x, this.y -= s.y, this);
244
- },
245
- // [API]
246
- // [chainable, changeSelf]
247
- // divide self by other vector.
248
- // for example, v(10, 20) / v(2, 5) = v(5, 4).
249
- // @param other - vector to divide components from self.
250
- // @return self.
251
- divSelf: function(s) {
252
- return typeof s == "number" ? this.divScalarSelf(s) : (this.x /= s.x, this.y /= s.y, this);
253
- },
254
- // [API]
255
- // [chainable, changeSelf]
256
- // multiply self vector by other vector.
257
- // for example, v(2, 3) * v(3, 4) = v(6, 12).
258
- // @param other - vector to multiply components with self.
259
- // @return self.
260
- mulSelf: function(s) {
261
- return typeof s == "number" ? this.mulScalarSelf(s) : (this.x *= s.x, this.y *= s.y, this);
262
- },
263
- // [API]
264
- // [chainable, changeSelf]
265
- // add scalar value to self.
266
- // for example, v(2, 3) + 5 = v(7, 8).
267
- // @param val - value to add to components.
268
- // @return self.
269
- addScalarSelf: function(s) {
270
- return this.x += s, this.y += s, this;
271
- },
272
- // [API]
273
- // [chainable, changeSelf]
274
- // subtract scalar from self.
275
- // for example, v(7, 9) - 5 = v(3, 4).
276
- // @param val - value to subtract from components.
277
- // @return self.
278
- subScalarSelf: function(s) {
279
- return this.x -= s, this.y -= s, this;
280
- },
281
- // [API]
282
- // [chainable, changeSelf]
283
- // divide self by scalar.
284
- // for example, v(6, 8) / 5 = v(3, 4).
285
- // @param val - value to divide components by.
286
- // @return self.
287
- divScalarSelf: function(s) {
288
- return this.x /= s, this.y /= s, this;
289
- },
290
- // [API]
291
- // [chainable, changeSelf]
292
- // multiply self by scalar.
293
- // for example, v(2, 3) * 2 = v(4, 6).
294
- // @param val - value to multiply components with.
295
- // @return self.
296
- mulScalarSelf: function(s) {
297
- return this.x *= s, this.y *= s, this;
298
- },
299
- // [API]
300
- // [chainable, clone]
301
- // clone self and add other vector to it.
302
- // @param other - vector to add with.
303
- // @return cloned vector.
304
- add: function(s) {
305
- return this.clone().addSelf(s);
306
- },
307
- // [API]
308
- // [chainable, clone]
309
- // clone self and subtract other vector from it.
310
- // @param other - vector to subtract with.
311
- // @return cloned vector.
312
- sub: function(s) {
313
- return this.clone().subSelf(s);
314
- },
315
- // [API]
316
- // [chainable, clone]
317
- // clone self and multiply by other vector.
318
- // @param other - vector to multiply with.
319
- // @return cloned vector.
320
- mul: function(s) {
321
- return this.clone().mulSelf(s);
322
- },
323
- // [API]
324
- // [chainable, clone]
325
- // clone self and divide by other vector.
326
- // @param other - vector to divide with.
327
- // @param scalar - value to divide by.
328
- // @return cloned vector.
329
- div: function(s) {
330
- return this.clone().divSelf(s);
331
- },
332
- // [API]
333
- // [chainable, clone]
334
- // clone self and add scalar to it.
335
- // @param scalar - value to add.
336
- // @return cloned vector.
337
- addScalar: function(s) {
338
- return this.clone().addScalarSelf(s);
339
- },
340
- // [API]
341
- // [chainable, clone]
342
- // clone self and substract scalar from it.
343
- // @param scalar - value to subtract.
344
- // @return cloned vector.
345
- subScalar: function(s) {
346
- return this.clone().subScalarSelf(s);
347
- },
348
- // [API]
349
- // [chainable, clone]
350
- // clone self and multiply by scalar.
351
- // @param scalar - value to multiply with.
352
- // @return cloned vector.
353
- mulScalar: function(s) {
354
- return this.clone().mulScalarSelf(s);
355
- },
356
- // [API]
357
- // [chainable, clone]
358
- // clone self and divide by scalar.
359
- // @param scalar - value to divide by.
360
- // @return cloned vector.
361
- divScalar: function(s) {
362
- return this.clone().divScalarSelf(s);
363
- },
364
- // [API]
365
- // [chainable, changeSelf]
366
- // clamp vector values into range.
367
- // note: this function does not validate that min < max.
368
- // @param min - min value for x, y components.
369
- // @param max - max value for x, y components.
370
- // @return self.
371
- clampSelf: function(s, d) {
372
- return this.x < s.x && (this.x = s.x), this.y < s.y && (this.y = s.y), this.x > d.x && (this.x = d.x), this.y > d.y && (this.y = d.y), this;
373
- },
374
- // [API]
375
- // [chainable, clone]
376
- // clone vector and clamp its values.
377
- // note: this function does not validate that min < max.
378
- // @param min - min value for x, y components.
379
- // @param max - max value for x, y components.
380
- // @return cloned vector in range.
381
- clamp: function(s, d) {
382
- return this.clone().clampSelf(s, d);
383
- },
384
- // [API]
385
- // [chainable, changeSelf]
386
- // apply a function on x and y components of the vector.
387
- // for example, you can use Math.round to round the vector x, y values.
388
- // @param func - function to apply on components.
389
- // @return self.
390
- applySelf: function(s) {
391
- return this.x = s(this.x), this.y = s(this.y), this;
392
- },
393
- // [API]
394
- // [chainable, clone]
395
- // clone self and apply a function on x and y components of the clone vector.
396
- // for example, you can use Math.round to round the vector x, y values.
397
- // @param func - function to apply on components.
398
- // @return cloned vector.
399
- apply: function(s) {
400
- return this.clone().applySelf(s);
401
- },
402
- // [API]
403
- // [chainable, changeSelf]
404
- // turn self to absolute values (eg turn x, y positive).
405
- // @return self.
406
- absSelf: function() {
407
- return this.applySelf(Math.abs);
408
- },
409
- // [API]
410
- // [chainable, clone]
411
- // clone and turn to absolute values (eg turn x, y positive).
412
- // @return cloned vector.
413
- abs: function() {
414
- return this.clone().absSelf();
415
- },
416
- // [API]
417
- // [chainable, changeSelf]
418
- // turn self to round values (eg turn x, y positive).
419
- // @return self.
420
- roundSelf: function() {
421
- return this.applySelf(Math.round);
422
- },
423
- // [API]
424
- // [chainable, clone]
425
- // clone and turn to round values (eg turn x, y positive).
426
- // @return cloned vector.
427
- round: function() {
428
- return this.clone().roundSelf();
429
- },
430
- // [API]
431
- // []
432
- // calculate dot-product of this vector with another vector.
433
- // @param other - other vector to calculate dot-product with.
434
- // @return dot product.
435
- dot: function(s) {
436
- return this.x * s.x + this.y * s.y;
437
- },
438
- // [API]
439
- // []
440
- // calculate cross-product of this vector with another vector.
441
- // @param other - other vector to calculate cross-product with.
442
- // @return dot product.
443
- cross: function(s) {
444
- return this.x * s.y - this.y * s.x;
445
- },
446
- // [API]
447
- // [chainable, changeSelf]
448
- // if any of the components of this vector are NaN, null, undefined, etc. set them to defaults.
449
- // note: 0's are considered to be a valid number and will not be replaced with a default value.
450
- // @param x - default value for x if undefined (0 if not defined).
451
- // @param y - default value for y if undefined (0 if not defined).
452
- // @return self.
453
- repairSelf: function(s, d) {
454
- return (typeof this.x != "number" || isNaN(this.x + 1)) && (this.x = s || 0), (typeof this.y != "number" || isNaN(this.y + 1)) && (this.y = d || 0), this;
455
- },
456
- // [API]
457
- // [chainable, clone]
458
- // create a clone and if any of the components of the vector are NaN, null, undefined, etc. set them to default.
459
- // note: 0's are considered to be a valid number and will not be replaced with a default value.
460
- // @param x - default value for x if undefined (0 if not defined).
461
- // @param y - default value for y if undefined (0 if not defined).
462
- // @return repaired clone.
463
- repair: function(s, d) {
464
- return this.clone().repairSelf(s, d);
465
- },
466
- // [API]
467
- // []
468
- // convert to string in the form of "x,y".
469
- // @return string representation of the vector.
470
- toString: function() {
471
- return this.x + "," + this.y;
472
- },
473
- // [API]
474
- // []
475
- // convert to a string with a given format.
476
- // @param format - a string in which %x and %y will be replaced with the vector values.
477
- // @return formatted string representing the vector.
478
- format: function(s) {
479
- return s = s || "%x,%y", s = s.replace(new RegExp("%x", "g"), this.x), s = s.replace(new RegExp("%y", "g"), this.y), s;
480
- }
481
- }, p;
482
- }();
483
- return l.zero = new l(0, 0), l.one = new l(1, 1), l.up = new l(0, -1), l.down = new l(0, 1), l.left = new l(-1, 0), l.right = new l(1, 0), l.upLeft = new l(-1, -1), l.downLeft = new l(-1, 1), l.upRight = new l(1, -1), l.downRight = new l(1, 1), l.prototype.magnitude = l.prototype.length, Object.freeze && (Object.freeze(l.zero), Object.freeze(l.one), Object.freeze(l.up), Object.freeze(l.down), Object.freeze(l.left), Object.freeze(l.right), Object.freeze(l.upLeft), Object.freeze(l.downLeft), Object.freeze(l.upRight), Object.freeze(l.downRight)), l;
484
- });
485
- })(Re);
486
- var On = Re.exports;
487
- const Y = /* @__PURE__ */ fe(On);
488
- let Xt = (u = 21) => crypto.getRandomValues(new Uint8Array(u)).reduce((l, t) => (t &= 63, t < 36 ? l += t.toString(36) : t < 62 ? l += (t - 26).toString(36).toUpperCase() : t > 62 ? l += "-" : l += "_", l), "");
1
+ var $n = Object.defineProperty;
2
+ var zn = (a, h, t) => h in a ? $n(a, h, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[h] = t;
3
+ var m = (a, h, t) => (zn(a, typeof h != "symbol" ? h + "" : h, t), t);
4
+ let Kt = (a = 21) => crypto.getRandomValues(new Uint8Array(a)).reduce((h, t) => (t &= 63, t < 36 ? h += t.toString(36) : t < 62 ? h += (t - 26).toString(36).toUpperCase() : t > 62 ? h += "-" : h += "_", h), "");
489
5
  const zt = {
490
6
  strokeType: "plain",
491
7
  strokeColor: "black",
492
8
  strokeWidth: 1,
493
9
  head: "none",
494
10
  tail: "none"
495
- }, _e = {
11
+ }, Me = {
496
12
  id: 0,
497
13
  type: "Feature",
498
14
  properties: {
@@ -518,84 +34,84 @@ const zt = {
518
34
  // tail: 'arrow-plain',
519
35
  // start: { x: 0, y: 0 },
520
36
  // end: { x: 100, y: 100 }
521
- }, Ln = (u = 0, l = 0, t = 0, r = 0, a = { ...zt }) => ({
522
- id: Xt(),
37
+ }, Nn = (a = 0, h = 0, t = 0, r = 0, o = { ...zt }) => ({
38
+ id: Kt(),
523
39
  type: "Feature",
524
40
  properties: {
525
41
  type: "arrow",
526
42
  style: {
527
43
  ...zt,
528
- ...a
44
+ ...o
529
45
  }
530
46
  },
531
47
  geometry: {
532
48
  type: "LineString",
533
49
  coordinates: [
534
- [u, l],
50
+ [a, h],
535
51
  [t, r]
536
52
  ]
537
53
  }
538
- }), zn = "http://www.w3.org/2000/svg";
539
- function Ot(u) {
540
- return document.createElementNS(zn, u);
54
+ }), Hn = "http://www.w3.org/2000/svg";
55
+ function Pt(a) {
56
+ return document.createElementNS(Hn, a);
541
57
  }
542
- function He(u) {
543
- return u.geometry.bbox || Cn(u), u.geometry.bbox;
58
+ function qe(a) {
59
+ return a.geometry.bbox || Fn(a), a.geometry.bbox;
544
60
  }
545
- function ut(u) {
546
- const l = He(u);
61
+ function ut(a) {
62
+ const h = qe(a);
547
63
  return {
548
- width: l[2] - l[0],
549
- height: l[3] - l[1]
64
+ width: h[2] - h[0],
65
+ height: h[3] - h[1]
550
66
  };
551
67
  }
552
- function ct(u) {
553
- const l = He(u);
554
- return { x: l[0], y: l[1] };
68
+ function ct(a) {
69
+ const h = qe(a);
70
+ return { x: h[0], y: h[1] };
555
71
  }
556
- function Cn(u) {
557
- const [l, t] = u.geometry.coordinates[0][0], [r, a] = u.geometry.coordinates[0][2];
558
- u.geometry.bbox = [l, t, r, a];
72
+ function Fn(a) {
73
+ const [h, t] = a.geometry.coordinates[0][0], [r, o] = a.geometry.coordinates[0][2];
74
+ a.geometry.bbox = [h, t, r, o];
559
75
  }
560
- function Pn(u, l, t, r, a) {
561
- u.geometry.bbox = [l, t, l + r, t + a], u.geometry.coordinates = [
76
+ function Bn(a, h, t, r, o) {
77
+ a.geometry.bbox = [h, t, h + r, t + o], a.geometry.coordinates = [
562
78
  [
563
- [l, t],
564
- [l + r, t],
565
- [l + r, t + a],
566
- [l, t + a],
567
- [l, t]
79
+ [h, t],
80
+ [h + r, t],
81
+ [h + r, t + o],
82
+ [h, t + o],
83
+ [h, t]
568
84
  ]
569
85
  ];
570
86
  }
571
- function Lt(u) {
572
- const [l, t] = u.geometry.coordinates[0];
573
- return { x: l, y: t };
87
+ function $t(a) {
88
+ const [h, t] = a.geometry.coordinates[0];
89
+ return { x: h, y: t };
574
90
  }
575
- function jt(u, l) {
576
- const [t, r] = u.geometry.coordinates[l === "start" ? 0 : 1];
91
+ function Rt(a, h) {
92
+ const [t, r] = a.geometry.coordinates[h === "start" ? 0 : 1];
577
93
  return { x: t, y: r };
578
94
  }
579
- function Bt(u) {
580
- const [l, t] = u.geometry.coordinates[1];
581
- return { x: l, y: t };
95
+ function Wt(a) {
96
+ const [h, t] = a.geometry.coordinates[1];
97
+ return { x: h, y: t };
582
98
  }
583
- function je(u, l, t) {
584
- u.geometry.coordinates[0] = [l, t];
99
+ function Re(a, h, t) {
100
+ a.geometry.coordinates[0] = [h, t];
585
101
  }
586
- function Fe(u, l, t) {
587
- u.geometry.coordinates[1] = [l, t];
102
+ function Ve(a, h, t) {
103
+ a.geometry.coordinates[1] = [h, t];
588
104
  }
589
- function Vt(u) {
590
- return { start: Lt(u), end: Bt(u) };
105
+ function Yt(a) {
106
+ return { start: $t(a), end: Wt(a) };
591
107
  }
592
- function bt(u, l, t, r) {
593
- l === "start" ? je(u, t, r) : Fe(u, t, r);
108
+ function At(a, h, t, r) {
109
+ h === "start" ? Re(a, t, r) : Ve(a, t, r);
594
110
  }
595
- const qe = (u) => parseInt(u.getAttribute("data-handle-id") || "-1");
596
- function Zn(u) {
597
- return qt(u).reduce(
598
- (l, t) => (l[0] = Math.min(t[0], l[0]), l[1] = Math.min(t[1], l[1]), l[2] = Math.max(t[0], l[2]), l[3] = Math.max(t[1], l[3]), l),
111
+ const Ue = (a) => parseInt(a.getAttribute("data-handle-id") || "-1");
112
+ function si(a) {
113
+ return Gt(a).reduce(
114
+ (h, t) => (h[0] = Math.min(t[0], h[0]), h[1] = Math.min(t[1], h[1]), h[2] = Math.max(t[0], h[2]), h[3] = Math.max(t[1], h[3]), h),
599
115
  [
600
116
  Number.POSITIVE_INFINITY,
601
117
  Number.POSITIVE_INFINITY,
@@ -604,200 +120,250 @@ function Zn(u) {
604
120
  ]
605
121
  );
606
122
  }
607
- function qt(u) {
608
- let l = [];
609
- return u.type == "Point" ? l = [u.coordinates] : u.type == "LineString" || u.type == "MultiPoint" ? l = u.coordinates : u.type == "Polygon" || u.type == "MultiLineString" ? l = u.coordinates.reduce(function(t, r) {
123
+ function jn(a) {
124
+ return Array.isArray(a) && a.length === 2 && a.every(isFinite);
125
+ }
126
+ function qn(a, h, t, r) {
127
+ for (let o = 0; o < a.coordinates.length; o++) {
128
+ const l = a.coordinates[o];
129
+ if (jn(l))
130
+ l[0] = t + (l[0] - t) * h, l[1] = r + (l[1] - r) * h;
131
+ else
132
+ for (let u = 0; u < l.length; u++) {
133
+ const d = l[u];
134
+ d[0] = t + (d[0] - t) * h, d[1] = r + (d[1] - r) * h;
135
+ }
136
+ }
137
+ return a;
138
+ }
139
+ function Gt(a) {
140
+ let h = [];
141
+ return a.type == "Point" ? h = [a.coordinates] : a.type == "LineString" || a.type == "MultiPoint" ? h = a.coordinates : a.type == "Polygon" || a.type == "MultiLineString" ? h = a.coordinates.reduce(function(t, r) {
610
142
  return t.concat(r);
611
- }, []) : u.type == "MultiPolygon" ? l = u.coordinates.reduce(
612
- (t, r) => t.concat(r.reduce((a, h) => a.concat(h), [])),
143
+ }, []) : a.type == "MultiPolygon" ? h = a.coordinates.reduce(
144
+ (t, r) => t.concat(r.reduce((o, l) => o.concat(l), [])),
613
145
  []
614
- ) : u.type == "Feature" ? l = qt(u.geometry) : u.type == "GeometryCollection" ? l = u.geometries.reduce(
615
- (t, r) => t.concat(qt(r)),
146
+ ) : a.type == "Feature" ? h = Gt(a.geometry) : a.type == "GeometryCollection" ? h = a.geometries.reduce(
147
+ (t, r) => t.concat(Gt(r)),
616
148
  []
617
- ) : u.type == "FeatureCollection" && (l = u.features.reduce(
618
- (t, r) => t.concat(qt(r)),
149
+ ) : a.type == "FeatureCollection" && (h = a.features.reduce(
150
+ (t, r) => t.concat(Gt(r)),
619
151
  []
620
- )), l;
152
+ )), h;
621
153
  }
622
- function Ft(u, l, t) {
623
- const r = Math.atan2(u.y - l.y, u.x - l.x);
154
+ function Vt(a, h, t) {
155
+ const r = Math.atan2(a.y - h.y, a.x - h.x);
624
156
  return {
625
- x: l.x + t * Math.cos(r),
626
- y: l.y + t * Math.sin(r)
157
+ x: h.x + t * Math.cos(r),
158
+ y: h.y + t * Math.sin(r)
627
159
  };
628
160
  }
629
- function ae(u, l) {
630
- if (!l)
631
- return { x: u.clientX, y: u.clientY };
632
- const t = l.getBoundingClientRect();
161
+ function ue(a, h) {
162
+ if (!h)
163
+ return { x: a.clientX, y: a.clientY };
164
+ const t = h.getBoundingClientRect();
633
165
  return {
634
- x: u.clientX - t.left - l.clientLeft,
635
- y: u.clientY - t.top - l.clientTop
166
+ x: a.clientX - t.left - h.clientLeft,
167
+ y: a.clientY - t.top - h.clientTop
636
168
  };
637
169
  }
638
- function Be(u, l = 5, t = 30) {
639
- var s;
640
- const { start: r, end: a } = Vt(u), h = new Y(r.x, r.y), g = new Y(a.x, a.y).sub(h), p = u.properties.style && u.properties.style.strokeWidth ? (s = u.properties.style) == null ? void 0 : s.strokeWidth : 0;
641
- return Math.min(t, Math.max(3 * p, g.length() * 0.1, l));
170
+ const vt = (a, h) => ({
171
+ x: a.x - h.x,
172
+ y: a.y - h.y
173
+ }), kt = (a) => Math.sqrt(a.x * a.x + a.y * a.y), Ge = (a) => ({
174
+ x: -a.x,
175
+ y: -a.y
176
+ }), We = (a) => {
177
+ const h = kt(a);
178
+ return h === 0 ? { x: 0, y: 0 } : {
179
+ x: a.x / h,
180
+ y: a.y / h
181
+ };
182
+ }, Et = (a, h) => ({
183
+ x: a.x + h.x,
184
+ y: a.y + h.y
185
+ }), Ye = (a, h) => ({
186
+ x: a.x * h,
187
+ y: a.y * h
188
+ }), Ut = (a, h) => ({
189
+ x: a.x * h.x,
190
+ y: a.y * h.y
191
+ }), rt = (a, h) => {
192
+ const t = Math.sin(h), r = Math.cos(h);
193
+ return {
194
+ x: a.x * r - a.y * t,
195
+ y: a.x * t + a.y * r
196
+ };
197
+ }, Rn = (a, h) => ({
198
+ x: a.x / h,
199
+ y: a.y / h
200
+ }), Oe = (a, h) => a.x * h.x + a.y * h.y;
201
+ function Xe(a, h = 5, t = 30) {
202
+ var d;
203
+ const { start: r, end: o } = Yt(a), l = vt(o, r), u = a.properties.style && a.properties.style.strokeWidth ? (d = a.properties.style) == null ? void 0 : d.strokeWidth : 0;
204
+ return Math.min(t, Math.max(3 * u, kt(l) * 0.1, h));
642
205
  }
643
- function Ie(u, l, t, r) {
644
- const a = l.clone().normalize().invert().mul(r);
206
+ function Le(a, h, t, r) {
207
+ const o = Ye(Ge(We(h)), r);
645
208
  if (!t || t === "none")
646
209
  return "";
647
- const h = u.clone().add(a.rotateRadians(Math.PI / 8)), f = u.clone().add(a.rotateRadians(-Math.PI / 8)), g = `${u.x} ${u.y}`;
648
- return `M ${h.x} ${h.y} L ${g} ${f.x} ${f.y} ${t === "arrow" ? "" : `${h.x} ${h.y}`}`;
210
+ const l = Et(a, rt(o, Math.PI / 8)), u = Et(a, rt(o, -Math.PI / 8)), d = `${a.x} ${a.y}`;
211
+ return `M ${l.x} ${l.y} L ${d} ${u.x} ${u.y} ${t === "arrow" ? "" : `${l.x} ${l.y}`}`;
212
+ }
213
+ function Vn(a, h, t, r, o) {
214
+ const { start: l, end: u } = Yt(a), { tail: d, head: g, strokeColor: f, strokeWidth: y } = a.properties.style || t, v = vt(u, l), T = Xe(a, r, o), A = Pt("path");
215
+ A.setAttribute("data-annotation", `${a.id}`), A.setAttribute("data-annotation-type", "arrow");
216
+ const b = g === "arrow-plain" || d === "arrow";
217
+ A.setAttribute("stroke", f || "none"), A.setAttribute("stroke-width", `${y}`), A.setAttribute("fill", b ? f || "" : "none"), A.setAttribute("stroke-linecap", "round"), A.setAttribute("stroke-linejoin", "round");
218
+ const C = Le(l, Ge(v), d, T), E = Le(u, v, g, T), $ = C + `M ${l.x} ${l.y} ${u.x} ${u.y}` + E;
219
+ A.setAttribute("d", $), h.appendChild(A);
649
220
  }
650
- function $n(u, l, t, r, a) {
651
- const { start: h, end: f } = Vt(u), { tail: g, head: p, strokeColor: s, strokeWidth: d } = u.properties.style || t, m = new Y(h.x, h.y), A = new Y(f.x, f.y), T = A.clone().sub(m), b = Be(u, r, a), I = Ot("path");
652
- I.setAttribute("data-annotation", `${u.id}`), I.setAttribute("data-annotation-type", "arrow");
653
- const S = p === "arrow-plain" || g === "arrow";
654
- I.setAttribute("stroke", s || "none"), I.setAttribute("stroke-width", `${d}`), I.setAttribute("fill", S ? s || "" : "none"), I.setAttribute("stroke-linecap", "round"), I.setAttribute("stroke-linejoin", "round");
655
- const P = Ie(m, T.clone().invert(), g, b), $ = Ie(A, T, p, b), _ = P + `M ${m.x} ${m.y} ${A.x} ${A.y}` + $;
656
- I.setAttribute("d", _), l.appendChild(I);
221
+ const V = -1, Xt = "dragging", Zt = "dragstart", Tt = "dragend", de = "select", fe = "unselect", Un = "hover", Gn = "unhover", pe = "remove", ge = "add", Wn = "cancelDrawing", ye = "update", Yn = "link";
222
+ var Xn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
223
+ function Ze(a) {
224
+ return a && a.__esModule && Object.prototype.hasOwnProperty.call(a, "default") ? a.default : a;
657
225
  }
658
- const V = -1, Ut = "dragging", Yt = "dragstart", St = "dragend", le = "select", he = "unselect", Nn = "hover", Rn = "unhover", ce = "remove", ue = "add", Hn = "cancelDrawing", de = "update", jn = "link";
659
- var Ve = { exports: {} };
660
- (function(u) {
661
- var l = Object.prototype.hasOwnProperty, t = "~";
226
+ var Ke = { exports: {} };
227
+ (function(a) {
228
+ var h = Object.prototype.hasOwnProperty, t = "~";
662
229
  function r() {
663
230
  }
664
231
  Object.create && (r.prototype = /* @__PURE__ */ Object.create(null), new r().__proto__ || (t = !1));
665
- function a(p, s, d) {
666
- this.fn = p, this.context = s, this.once = d || !1;
232
+ function o(g, f, y) {
233
+ this.fn = g, this.context = f, this.once = y || !1;
667
234
  }
668
- function h(p, s, d, m, A) {
669
- if (typeof d != "function")
235
+ function l(g, f, y, v, T) {
236
+ if (typeof y != "function")
670
237
  throw new TypeError("The listener must be a function");
671
- var T = new a(d, m || p, A), b = t ? t + s : s;
672
- return p._events[b] ? p._events[b].fn ? p._events[b] = [p._events[b], T] : p._events[b].push(T) : (p._events[b] = T, p._eventsCount++), p;
238
+ var A = new o(y, v || g, T), b = t ? t + f : f;
239
+ return g._events[b] ? g._events[b].fn ? g._events[b] = [g._events[b], A] : g._events[b].push(A) : (g._events[b] = A, g._eventsCount++), g;
673
240
  }
674
- function f(p, s) {
675
- --p._eventsCount === 0 ? p._events = new r() : delete p._events[s];
241
+ function u(g, f) {
242
+ --g._eventsCount === 0 ? g._events = new r() : delete g._events[f];
676
243
  }
677
- function g() {
244
+ function d() {
678
245
  this._events = new r(), this._eventsCount = 0;
679
246
  }
680
- g.prototype.eventNames = function() {
681
- var s = [], d, m;
247
+ d.prototype.eventNames = function() {
248
+ var f = [], y, v;
682
249
  if (this._eventsCount === 0)
683
- return s;
684
- for (m in d = this._events)
685
- l.call(d, m) && s.push(t ? m.slice(1) : m);
686
- return Object.getOwnPropertySymbols ? s.concat(Object.getOwnPropertySymbols(d)) : s;
687
- }, g.prototype.listeners = function(s) {
688
- var d = t ? t + s : s, m = this._events[d];
689
- if (!m)
250
+ return f;
251
+ for (v in y = this._events)
252
+ h.call(y, v) && f.push(t ? v.slice(1) : v);
253
+ return Object.getOwnPropertySymbols ? f.concat(Object.getOwnPropertySymbols(y)) : f;
254
+ }, d.prototype.listeners = function(f) {
255
+ var y = t ? t + f : f, v = this._events[y];
256
+ if (!v)
690
257
  return [];
691
- if (m.fn)
692
- return [m.fn];
693
- for (var A = 0, T = m.length, b = new Array(T); A < T; A++)
694
- b[A] = m[A].fn;
258
+ if (v.fn)
259
+ return [v.fn];
260
+ for (var T = 0, A = v.length, b = new Array(A); T < A; T++)
261
+ b[T] = v[T].fn;
695
262
  return b;
696
- }, g.prototype.listenerCount = function(s) {
697
- var d = t ? t + s : s, m = this._events[d];
698
- return m ? m.fn ? 1 : m.length : 0;
699
- }, g.prototype.emit = function(s, d, m, A, T, b) {
700
- var I = t ? t + s : s;
701
- if (!this._events[I])
263
+ }, d.prototype.listenerCount = function(f) {
264
+ var y = t ? t + f : f, v = this._events[y];
265
+ return v ? v.fn ? 1 : v.length : 0;
266
+ }, d.prototype.emit = function(f, y, v, T, A, b) {
267
+ var C = t ? t + f : f;
268
+ if (!this._events[C])
702
269
  return !1;
703
- var S = this._events[I], P = arguments.length, $, _;
704
- if (S.fn) {
705
- switch (S.once && this.removeListener(s, S.fn, void 0, !0), P) {
270
+ var E = this._events[C], $ = arguments.length, N, _;
271
+ if (E.fn) {
272
+ switch (E.once && this.removeListener(f, E.fn, void 0, !0), $) {
706
273
  case 1:
707
- return S.fn.call(S.context), !0;
274
+ return E.fn.call(E.context), !0;
708
275
  case 2:
709
- return S.fn.call(S.context, d), !0;
276
+ return E.fn.call(E.context, y), !0;
710
277
  case 3:
711
- return S.fn.call(S.context, d, m), !0;
278
+ return E.fn.call(E.context, y, v), !0;
712
279
  case 4:
713
- return S.fn.call(S.context, d, m, A), !0;
280
+ return E.fn.call(E.context, y, v, T), !0;
714
281
  case 5:
715
- return S.fn.call(S.context, d, m, A, T), !0;
282
+ return E.fn.call(E.context, y, v, T, A), !0;
716
283
  case 6:
717
- return S.fn.call(S.context, d, m, A, T, b), !0;
284
+ return E.fn.call(E.context, y, v, T, A, b), !0;
718
285
  }
719
- for (_ = 1, $ = new Array(P - 1); _ < P; _++)
720
- $[_ - 1] = arguments[_];
721
- S.fn.apply(S.context, $);
286
+ for (_ = 1, N = new Array($ - 1); _ < $; _++)
287
+ N[_ - 1] = arguments[_];
288
+ E.fn.apply(E.context, N);
722
289
  } else {
723
- var X = S.length, W;
724
- for (_ = 0; _ < X; _++)
725
- switch (S[_].once && this.removeListener(s, S[_].fn, void 0, !0), P) {
290
+ var G = E.length, W;
291
+ for (_ = 0; _ < G; _++)
292
+ switch (E[_].once && this.removeListener(f, E[_].fn, void 0, !0), $) {
726
293
  case 1:
727
- S[_].fn.call(S[_].context);
294
+ E[_].fn.call(E[_].context);
728
295
  break;
729
296
  case 2:
730
- S[_].fn.call(S[_].context, d);
297
+ E[_].fn.call(E[_].context, y);
731
298
  break;
732
299
  case 3:
733
- S[_].fn.call(S[_].context, d, m);
300
+ E[_].fn.call(E[_].context, y, v);
734
301
  break;
735
302
  case 4:
736
- S[_].fn.call(S[_].context, d, m, A);
303
+ E[_].fn.call(E[_].context, y, v, T);
737
304
  break;
738
305
  default:
739
- if (!$)
740
- for (W = 1, $ = new Array(P - 1); W < P; W++)
741
- $[W - 1] = arguments[W];
742
- S[_].fn.apply(S[_].context, $);
306
+ if (!N)
307
+ for (W = 1, N = new Array($ - 1); W < $; W++)
308
+ N[W - 1] = arguments[W];
309
+ E[_].fn.apply(E[_].context, N);
743
310
  }
744
311
  }
745
312
  return !0;
746
- }, g.prototype.on = function(s, d, m) {
747
- return h(this, s, d, m, !1);
748
- }, g.prototype.once = function(s, d, m) {
749
- return h(this, s, d, m, !0);
750
- }, g.prototype.removeListener = function(s, d, m, A) {
751
- var T = t ? t + s : s;
752
- if (!this._events[T])
313
+ }, d.prototype.on = function(f, y, v) {
314
+ return l(this, f, y, v, !1);
315
+ }, d.prototype.once = function(f, y, v) {
316
+ return l(this, f, y, v, !0);
317
+ }, d.prototype.removeListener = function(f, y, v, T) {
318
+ var A = t ? t + f : f;
319
+ if (!this._events[A])
753
320
  return this;
754
- if (!d)
755
- return f(this, T), this;
756
- var b = this._events[T];
321
+ if (!y)
322
+ return u(this, A), this;
323
+ var b = this._events[A];
757
324
  if (b.fn)
758
- b.fn === d && (!A || b.once) && (!m || b.context === m) && f(this, T);
325
+ b.fn === y && (!T || b.once) && (!v || b.context === v) && u(this, A);
759
326
  else {
760
- for (var I = 0, S = [], P = b.length; I < P; I++)
761
- (b[I].fn !== d || A && !b[I].once || m && b[I].context !== m) && S.push(b[I]);
762
- S.length ? this._events[T] = S.length === 1 ? S[0] : S : f(this, T);
327
+ for (var C = 0, E = [], $ = b.length; C < $; C++)
328
+ (b[C].fn !== y || T && !b[C].once || v && b[C].context !== v) && E.push(b[C]);
329
+ E.length ? this._events[A] = E.length === 1 ? E[0] : E : u(this, A);
763
330
  }
764
331
  return this;
765
- }, g.prototype.removeAllListeners = function(s) {
766
- var d;
767
- return s ? (d = t ? t + s : s, this._events[d] && f(this, d)) : (this._events = new r(), this._eventsCount = 0), this;
768
- }, g.prototype.off = g.prototype.removeListener, g.prototype.addListener = g.prototype.on, g.prefixed = t, g.EventEmitter = g, u.exports = g;
769
- })(Ve);
770
- var Fn = Ve.exports;
771
- const Ue = /* @__PURE__ */ fe(Fn);
772
- class Ye extends Ue {
332
+ }, d.prototype.removeAllListeners = function(f) {
333
+ var y;
334
+ return f ? (y = t ? t + f : f, this._events[y] && u(this, y)) : (this._events = new r(), this._eventsCount = 0), this;
335
+ }, d.prototype.off = d.prototype.removeListener, d.prototype.addListener = d.prototype.on, d.prefixed = t, d.EventEmitter = d, a.exports = d;
336
+ })(Ke);
337
+ var Zn = Ke.exports;
338
+ const Je = /* @__PURE__ */ Ze(Zn);
339
+ class Qe extends Je {
773
340
  constructor(t, r) {
774
341
  super();
775
- v(this, "ogma");
776
- v(this, "elements");
342
+ m(this, "ogma");
343
+ m(this, "elements");
777
344
  // layer to draw elements
778
- v(this, "layer");
779
- v(this, "editor");
780
- v(this, "selectedId", V);
781
- v(this, "hoveredId", V);
345
+ m(this, "layer");
346
+ m(this, "editor");
347
+ m(this, "selectedId", V);
348
+ m(this, "hoveredId", V);
782
349
  // used to remember ogma options before we change them
783
- v(this, "ogmaOptions");
784
- v(this, "shouldDetect");
785
- v(this, "isDragging");
786
- v(this, "showeditorOnHover");
787
- v(this, "maxHandleScale", 1.5);
788
- v(this, "_onKeyUp", (t) => {
350
+ m(this, "ogmaOptions");
351
+ m(this, "shouldDetect");
352
+ m(this, "isDragging");
353
+ m(this, "showeditorOnHover");
354
+ m(this, "_onKeyUp", (t) => {
789
355
  t.code === 27 && this.selectedId !== V ? this.unselect() : (t.code === 46 || t.code === 8) && this.selectedId !== V && this._canRemove() && this.remove(this.selectedId);
790
356
  });
791
- v(this, "_onClickMouseMove", (t) => {
357
+ m(this, "_onClickMouseMove", (t) => {
792
358
  if (!t.domEvent || this.isDragging || !this.shouldDetect || t.domEvent.type !== "mousemove" && t.domEvent.target && t.domEvent.target.tagName === "a")
793
359
  return;
794
- const r = this.ogma.view.screenToGraphCoordinates(t), a = this.shouldDetect || !this.shouldDetect && +this.selectedId > -1 ? this.detect(r, 0) : void 0;
795
- t.domEvent.type === "mousemove" ? a ? this.hover(a.id) : this.hoveredId !== V && this.unhover() : a ? this.select(a.id) : this.selectedId !== V && this.unselect();
360
+ const r = this.ogma.view.screenToGraphCoordinates(t), o = this.shouldDetect || !this.shouldDetect && +this.selectedId > -1 ? this.detect(r, 0) : void 0;
361
+ t.domEvent.type === "mousemove" ? o ? this.hover(o.id) : this.hoveredId !== V && this.unhover() : o ? this.select(o.id) : this.selectedId !== V && this.unselect();
796
362
  });
797
363
  this.ogma = t, this.elements = [], this.shouldDetect = !0, this.isDragging = !1, this.showeditorOnHover = !0, this.ogmaOptions = t.getOptions(), t.events.on(["click", "mousemove"], this._onClickMouseMove).on("keyup", this._onKeyUp).on("frame", () => {
798
364
  this.refreshEditor(), this.refreshDrawing();
799
365
  }), this.layer = t.layers.addSVGLayer({
800
- draw: (a) => this.draw(a)
366
+ draw: (o) => this.draw(o)
801
367
  }), this.layer.moveToTop(), this.editor = t.layers.addLayer(r), this.editor.hide();
802
368
  }
803
369
  _canRemove() {
@@ -809,8 +375,8 @@ class Ye extends Ue {
809
375
  * @returns the added annotation
810
376
  */
811
377
  add(t) {
812
- const r = this.getDefaultOptions(), a = Object.assign(t, {
813
- id: t.id === void 0 ? Xt() : t.id,
378
+ const r = this.getDefaultOptions(), o = Object.assign(t, {
379
+ id: t.id === void 0 ? Kt() : t.id,
814
380
  type: t.type,
815
381
  properties: {
816
382
  ...r.properties,
@@ -823,7 +389,7 @@ class Ye extends Ue {
823
389
  ...t.geometry
824
390
  }
825
391
  });
826
- return this.elements.push(a), this.layer.refresh(), this.emit(ue, a), a;
392
+ return this.elements.push(o), this.layer.refresh(), this.emit(ge, o), o;
827
393
  }
828
394
  updateStyle(t, r) {
829
395
  this.updateAnnotation(t, {
@@ -837,6 +403,12 @@ class Ye extends Ue {
837
403
  geometry: r
838
404
  });
839
405
  }
406
+ scale(t, r, o, l) {
407
+ this.updateGeometry(
408
+ t,
409
+ qn(t.geometry, r, o, l)
410
+ );
411
+ }
840
412
  /**
841
413
  * @method update
842
414
  * Updates an annotation (position, color etc)
@@ -844,38 +416,38 @@ class Ye extends Ue {
844
416
  * @param element params of the annotation
845
417
  */
846
418
  update(t, r) {
847
- const a = this.getById(t);
848
- this.updateAnnotation(a, r);
419
+ const o = this.getById(t);
420
+ this.updateAnnotation(o, r);
849
421
  }
850
422
  updateAnnotation(t, r) {
851
423
  if (!t)
852
424
  return;
853
- const a = t.id;
854
- Object.keys(r).forEach((h) => {
855
- if (h !== "id")
856
- if (h === "properties") {
857
- const f = r.properties || { style: {} };
425
+ const o = t.id;
426
+ Object.keys(r).forEach((l) => {
427
+ if (l !== "id")
428
+ if (l === "properties") {
429
+ const u = r.properties || { style: {} };
858
430
  t.properties = {
859
431
  ...t.properties || {},
860
- ...f || {},
432
+ ...u || {},
861
433
  style: {
862
434
  ...t.properties.style || {},
863
- ...f.style || {}
435
+ ...u.style || {}
864
436
  }
865
437
  };
866
438
  } else
867
- h === "geometry" ? t.geometry = {
439
+ l === "geometry" ? t.geometry = {
868
440
  ...t.geometry,
869
441
  ...r.geometry
870
- } : t[h] = r[h];
871
- }), a === this.selectedId && this.refreshEditor(), this.layer.refresh();
442
+ } : t[l] = r[l];
443
+ }), o === this.selectedId && this.refreshEditor(), this.layer.refresh();
872
444
  }
873
445
  getById(t) {
874
446
  const r = Number(t);
875
- for (let a = 0; a < this.elements.length; a++) {
876
- const h = this.elements[a];
877
- if (!(h.id !== t && h.id !== r))
878
- return h;
447
+ for (let o = 0; o < this.elements.length; o++) {
448
+ const l = this.elements[o];
449
+ if (!(l.id !== t && l.id !== r))
450
+ return l;
879
451
  }
880
452
  }
881
453
  /**
@@ -885,22 +457,22 @@ class Ye extends Ue {
885
457
  */
886
458
  select(t) {
887
459
  const r = this.getById(t);
888
- r && (this.editor.show(), this.selectedId = t, this.refreshEditor(), this.layer.refresh(), this.emit(le, r));
460
+ r && (this.editor.show(), this.selectedId = t, this.refreshEditor(), this.layer.refresh(), this.emit(de, r));
889
461
  }
890
462
  hover(t) {
891
463
  const r = this.getById(t);
892
- r && (this.showeditorOnHover && this.editor.show(), this.hoveredId = t, this.refreshEditor(), this.layer.refresh(), this.emit(Nn, r));
464
+ r && (this.showeditorOnHover && this.editor.show(), this.hoveredId = t, this.refreshEditor(), this.layer.refresh(), this.emit(Un, r));
893
465
  }
894
466
  getSelectedFeature() {
895
467
  return this.selectedId === V ? null : this.getById(this.selectedId);
896
468
  }
897
469
  unselect() {
898
470
  const t = this.getById(this.selectedId);
899
- return t && this.emit(he, t), this.selectedId = V, this.hoveredId === V && this.editor.hide(), this.layer.refresh(), this;
471
+ return t && this.emit(fe, t), this.selectedId = V, this.hoveredId === V && this.editor.hide(), this.layer.refresh(), this;
900
472
  }
901
473
  unhover() {
902
474
  const t = this.getById(this.hoveredId);
903
- return this.emit(Rn, t), this.hoveredId = V, this.selectedId === V && this.editor.hide(), this.layer.refresh(), this;
475
+ return this.emit(Gn, t), this.hoveredId = V, this.selectedId === V && this.editor.hide(), this.layer.refresh(), this;
904
476
  }
905
477
  /**
906
478
  * @method remove
@@ -909,7 +481,7 @@ class Ye extends Ue {
909
481
  */
910
482
  remove(t) {
911
483
  const r = this.getById(t);
912
- t === this.hoveredId && this.unhover(), t === this.selectedId && this.unselect(), this.elements = this.elements.filter((a) => a.id !== t), r && this.emit(ce, r), this.layer.refresh();
484
+ t === this.hoveredId && this.unhover(), t === this.selectedId && this.unselect(), this.elements = this.elements.filter((o) => o.id !== t), r && this.emit(pe, r), this.layer.refresh();
913
485
  }
914
486
  /**
915
487
  * @method disableDragging
@@ -959,56 +531,59 @@ class Ye extends Ue {
959
531
  this.ogma.events.off(this._onClickMouseMove).off(this._onKeyUp), this.layer.destroy();
960
532
  }
961
533
  }
962
- const Me = "handle-line", De = "handle-start", Oe = "handle-end";
963
- class qn extends Ye {
534
+ const Ce = "handle-line", Pe = "handle-start", $e = "handle-end";
535
+ class Kn extends Qe {
964
536
  constructor(t, r = {}) {
965
537
  super(
966
538
  t,
967
539
  `
968
540
  <div class="arrow-handle">
969
- <div id="${Me}" data-handle-id="0" class="handle line"></div>
970
- <div id="${De}" data-handle-id="1" class="handle"></div>
971
- <div id="${Oe}" data-handle-id="2" class="handle"></div>
541
+ <div id="${Ce}" data-handle-id="0" class="handle line"></div>
542
+ <div id="${Pe}" data-handle-id="1" class="handle point"></div>
543
+ <div id="${$e}" data-handle-id="2" class="handle point"></div>
972
544
  </div>
973
545
  `
974
546
  );
975
547
  // active handle id
976
- v(this, "draggedHandle", V);
977
- v(this, "start", { x: 0, y: 0 });
978
- v(this, "end", { x: 0, y: 0 });
979
- v(this, "arrow", { ..._e });
980
- v(this, "startX", 0);
981
- v(this, "startY", 0);
982
- v(this, "minArrowHeight", 0);
983
- v(this, "maxArrowHeight", 0);
984
- v(this, "handles", []);
985
- v(this, "onHandleMouseDown", (t) => {
548
+ m(this, "draggedHandle", V);
549
+ m(this, "start", { x: 0, y: 0 });
550
+ m(this, "end", { x: 0, y: 0 });
551
+ m(this, "arrow", { ...Me });
552
+ m(this, "startX", 0);
553
+ m(this, "startY", 0);
554
+ m(this, "minArrowHeight", 0);
555
+ m(this, "maxArrowHeight", 0);
556
+ m(this, "handles", []);
557
+ m(this, "onHandleMouseDown", (t) => {
986
558
  const r = this.getById(this.selectedId) || this.getById(this.hoveredId);
987
559
  if (!r)
988
560
  return;
989
- const { x: a, y: h } = ae(t, this.ogma.getContainer());
990
- this.startDragging(r, a, h), this.draggedHandle = qe(t.target);
561
+ const { x: o, y: l } = ue(t, this.ogma.getContainer());
562
+ this.startDragging(r, o, l), this.draggedHandle = Ue(t.target);
991
563
  });
992
- v(this, "onMouseUp", () => {
993
- this.draggedHandle !== -1 && (this.restoreDragging(), this.isDragging = !1, this.draggedHandle = V, this.emit(St, this.arrow));
564
+ m(this, "onMouseUp", () => {
565
+ this.draggedHandle !== -1 && (this.restoreDragging(), this.isDragging = !1, this.draggedHandle = V, this.emit(Tt, this.arrow));
994
566
  });
995
- v(this, "onMouseMove", (t) => {
567
+ m(this, "onMouseMove", (t) => {
996
568
  if (!this.isDragging || this.draggedHandle === V)
997
569
  return;
998
- const r = this.handles[this.draggedHandle], a = this.ogma.view.getAngle(), { x: h, y: f } = new Y(
999
- t.clientX - this.startX,
1000
- t.clientY - this.startY
1001
- ).divScalar(this.ogma.view.getZoom()).rotateRadians(a), g = r.id === Me, p = r.id === De, s = r.id === Oe;
1002
- (g || p) && je(this.arrow, this.start.x + h, this.start.y + f), (g || s) && Fe(this.arrow, this.end.x + h, this.end.y + f), this.emit(
1003
- Ut,
570
+ const r = this.handles[this.draggedHandle], o = this.ogma.view.getAngle(), { x: l, y: u } = rt(
571
+ Rn(
572
+ { x: t.clientX - this.startX, y: t.clientY - this.startY },
573
+ this.ogma.view.getZoom()
574
+ ),
575
+ o
576
+ ), d = r.id === Ce, g = r.id === Pe, f = r.id === $e;
577
+ (d || g) && Re(this.arrow, this.start.x + l, this.start.y + u), (d || f) && Ve(this.arrow, this.end.x + l, this.end.y + u), this.emit(
578
+ Xt,
1004
579
  this.arrow,
1005
- g ? "line" : p ? "start" : "end"
580
+ d ? "line" : g ? "start" : "end"
1006
581
  ), this.refreshEditor(), this.layer.refresh();
1007
582
  });
1008
583
  this.minArrowHeight = r.minArrowHeight || 0, this.maxArrowHeight = r.maxArrowHeight || 1e6, this.handles = Array.prototype.slice.call(
1009
584
  this.editor.element.querySelectorAll(".arrow-handle>.handle")
1010
585
  ), this.handles.forEach(
1011
- (a) => a.addEventListener("mousedown", this.onHandleMouseDown)
586
+ (o) => o.addEventListener("mousedown", this.onHandleMouseDown)
1012
587
  ), document.addEventListener("mousemove", this.onMouseMove, !0), document.addEventListener("mouseup", this.onMouseUp);
1013
588
  }
1014
589
  /**
@@ -1017,59 +592,60 @@ class qn extends Ye {
1017
592
  * @param y
1018
593
  * @param arrow
1019
594
  */
1020
- startDrawing(t, r, a = Ln(t, r, t, r, zt)) {
1021
- var g;
1022
- this.disableDragging(), this.add(a), this.hoveredId = a.id;
1023
- const h = this.ogma.view.graphToScreenCoordinates({ x: t, y: r }), f = ((g = this.ogma.getContainer()) == null ? void 0 : g.getBoundingClientRect()) || {
595
+ startDrawing(t, r, o = Nn(t, r, t, r, zt)) {
596
+ var d;
597
+ this.disableDragging(), this.add(o), this.hoveredId = o.id;
598
+ const l = this.ogma.view.graphToScreenCoordinates({ x: t, y: r }), u = ((d = this.ogma.getContainer()) == null ? void 0 : d.getBoundingClientRect()) || {
1024
599
  left: 0,
1025
600
  top: 0
1026
601
  };
1027
602
  this.startDragging(
1028
- this.getById(a.id),
1029
- h.x + (f == null ? void 0 : f.left),
1030
- h.y + f.top
603
+ this.getById(o.id),
604
+ l.x + (u == null ? void 0 : u.left),
605
+ l.y + u.top
1031
606
  ), this.draggedHandle = 2;
1032
607
  }
1033
608
  cancelDrawing() {
1034
- this.isDragging && (this.remove(this.arrow.id), this.emit(St, this.arrow), this.restoreDragging(), this.isDragging = !1, this.draggedHandle = V);
609
+ this.isDragging && (this.remove(this.arrow.id), this.emit(Tt, this.arrow), this.restoreDragging(), this.isDragging = !1, this.draggedHandle = V);
1035
610
  }
1036
- startDragging(t, r, a) {
1037
- this.selectedId !== t.id && this.select(this.hoveredId), this.arrow = t, this.startX = r, this.startY = a, this.start = Lt(this.arrow), this.end = Bt(this.arrow), this.disableDragging(), this.emit(Yt, this.arrow), this.isDragging = !0;
611
+ startDragging(t, r, o) {
612
+ this.selectedId !== t.id && this.select(this.hoveredId), this.arrow = t, this.startX = r, this.startY = o, this.start = $t(this.arrow), this.end = Wt(this.arrow), this.disableDragging(), this.emit(Zt, this.arrow), this.isDragging = !0;
1038
613
  }
1039
614
  detect(t, r = 0) {
1040
- return this.elements.find((a) => {
1041
- const { start: h, end: f } = Vt(a), g = new Y(t.x, t.y).sub(
1042
- new Y((h.x + f.x) / 2, (h.y + f.y) / 2)
1043
- ), p = new Y(f.x, f.y).sub(new Y(h.x, h.y)), s = p.length(), d = p.normalize(), m = Be(a);
1044
- return Math.abs(d.dot(g)) < s / 2 + r && Math.abs(d.rotateRadians(Math.PI / 2).dot(g)) < m / 2 + r;
615
+ return this.elements.find((o) => {
616
+ const { start: l, end: u } = Yt(o), d = vt(t, {
617
+ x: (l.x + u.x) / 2,
618
+ y: (l.y + u.y) / 2
619
+ }), g = vt(u, l), f = kt(g), y = We(g), v = Xe(o);
620
+ return Math.abs(Oe(y, d)) < f / 2 + r && Math.abs(Oe(rt(y, Math.PI / 2), d)) < v / 2 + r;
1045
621
  });
1046
622
  }
1047
623
  refreshEditor() {
1048
624
  if (+this.selectedId < 0 && +this.hoveredId < 0)
1049
625
  return;
1050
- const t = this.selectedId !== V ? this.getById(this.selectedId) : this.getById(this.hoveredId), r = Vt(t), a = this.ogma.view.graphToScreenCoordinates(r.start), h = this.ogma.view.graphToScreenCoordinates(r.end), f = Math.min(this.ogma.view.getZoom(), this.maxHandleScale), [g, p, s] = Array.prototype.slice.call(
626
+ const t = this.selectedId !== V ? this.getById(this.selectedId) : this.getById(this.hoveredId), r = Yt(t), o = this.ogma.view.graphToScreenCoordinates(r.start), l = this.ogma.view.graphToScreenCoordinates(r.end), [u, d, g] = Array.prototype.slice.call(
1051
627
  this.editor.element.querySelectorAll(".handle")
1052
628
  );
1053
- p.style.transform = `translate(${a.x}px, ${a.y}px) translate(-50%, -50%) scale(${f})`, s.style.transform = `translate(${h.x}px, ${h.y}px) translate(-50%, -50%) scale(${f}`;
1054
- const d = {
1055
- x: (h.x + a.x) / 2,
1056
- y: (h.y + a.y) / 2
1057
- }, m = new Y(h.x - a.x, h.y - a.y), A = m.mul(1 / m.length()), T = Math.atan2(A.y, A.x);
1058
- g.style.width = `${m.length()}px`, g.style.left = `${d.x}px`, g.style.top = `${d.y}px`, g.style.transform = `translate(-50%, -50%) rotate(${T}rad)`;
629
+ d.style.transform = `translate(${o.x}px, ${o.y}px) translate(-50%, -50%)`, g.style.transform = `translate(${l.x}px, ${l.y}px) translate(-50%, -50%)`;
630
+ const f = {
631
+ x: (l.x + o.x) / 2,
632
+ y: (l.y + o.y) / 2
633
+ }, y = vt(l, o), v = Ye(y, 1 / kt(y)), T = Math.atan2(v.y, v.x);
634
+ u.style.width = `${kt(y)}px`, u.style.left = `${f.x}px`, u.style.top = `${f.y}px`, u.style.transform = `translate(-50%, -50%) rotate(${T}rad)`;
1059
635
  }
1060
636
  getDefaultOptions() {
1061
- return _e;
637
+ return Me;
1062
638
  }
1063
639
  draw(t) {
1064
640
  t.innerHTML = "";
1065
- const r = Ot("g"), a = this.ogma.view.getAngle();
1066
- r.setAttribute("transform", `rotate(${-a * (180 / Math.PI)})`), this.elements.forEach(
1067
- (h) => $n(h, r, zt, this.minArrowHeight, this.maxArrowHeight)
641
+ const r = Pt("g"), o = this.ogma.view.getAngle();
642
+ r.setAttribute("transform", `rotate(${-o * (180 / Math.PI)})`), this.elements.forEach(
643
+ (l) => Vn(l, r, zt, this.minArrowHeight, this.maxArrowHeight)
1068
644
  ), t.appendChild(r);
1069
645
  }
1070
646
  refreshDrawing() {
1071
647
  const t = this.ogma.view.getAngle();
1072
- this.layer.element.children[0].setAttribute(
648
+ this.layer.element !== null && this.layer.element.children[0].setAttribute(
1073
649
  "transform",
1074
650
  `rotate(${-t * (180 / Math.PI)})`
1075
651
  );
@@ -1078,7 +654,7 @@ class qn extends Ye {
1078
654
  super.destroy(), document.removeEventListener("mousemove", this.onMouseMove, !0), document.removeEventListener("mouseup", this.onMouseUp);
1079
655
  }
1080
656
  }
1081
- const At = {
657
+ const St = {
1082
658
  font: "sans-serif",
1083
659
  fontSize: 12,
1084
660
  color: "black",
@@ -1086,13 +662,13 @@ const At = {
1086
662
  strokeWidth: 1,
1087
663
  strokeColor: "#000",
1088
664
  strokeType: "plain"
1089
- }, re = {
665
+ }, le = {
1090
666
  id: 0,
1091
667
  type: "Feature",
1092
668
  properties: {
1093
669
  type: "text",
1094
670
  content: "",
1095
- style: { ...At }
671
+ style: { ...St }
1096
672
  },
1097
673
  geometry: {
1098
674
  type: "Polygon",
@@ -1108,107 +684,107 @@ const At = {
1108
684
  }
1109
685
  // position: { x: 0, y: 0 },
1110
686
  // size: { width: 100, height: 50 }
1111
- }, Le = {
687
+ }, ze = {
1112
688
  handleSize: 3.5,
1113
689
  placeholder: "Your text..."
1114
- }, Bn = (u = 0, l = 0, t = 100, r = 50, a = "", h = { ...At }) => ({
1115
- id: Xt(),
690
+ }, Jn = (a = 0, h = 0, t = 100, r = 50, o = "", l = { ...St }) => ({
691
+ id: Kt(),
1116
692
  type: "Feature",
1117
693
  properties: {
1118
694
  type: "text",
1119
- content: a,
1120
- style: { ...At, ...h }
695
+ content: o,
696
+ style: { ...St, ...l }
1121
697
  },
1122
698
  geometry: {
1123
699
  type: "Polygon",
1124
700
  coordinates: [
1125
701
  [
1126
- [u, l],
1127
- [u + t, l],
1128
- [u + t, l + r],
1129
- [u, l + r],
1130
- [u, l]
702
+ [a, h],
703
+ [a + t, h],
704
+ [a + t, h + r],
705
+ [a, h + r],
706
+ [a, h]
1131
707
  ]
1132
708
  ]
1133
709
  }
1134
710
  });
1135
- var Xe = { exports: {} };
1136
- (function(u, l) {
711
+ var tn = { exports: {} };
712
+ (function(a, h) {
1137
713
  (function(t, r) {
1138
- u.exports = r();
1139
- })(Dn, () => (() => {
714
+ a.exports = r();
715
+ })(Xn, () => (() => {
1140
716
  var t = { d: (e, n) => {
1141
- for (var o in n)
1142
- t.o(n, o) && !t.o(e, o) && Object.defineProperty(e, o, { enumerable: !0, get: n[o] });
717
+ for (var s in n)
718
+ t.o(n, s) && !t.o(e, s) && Object.defineProperty(e, s, { enumerable: !0, get: n[s] });
1143
719
  }, o: (e, n) => Object.prototype.hasOwnProperty.call(e, n) }, r = {};
1144
- function a(e) {
1145
- return a = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
720
+ function o(e) {
721
+ return o = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
1146
722
  return typeof n;
1147
723
  } : function(n) {
1148
724
  return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
1149
- }, a(e);
725
+ }, o(e);
1150
726
  }
1151
- t.d(r, { default: () => Tn });
1152
- var h = /^((?:[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/, p = /\bbold(?:er)?\b/, s = 13.3333333, d = { "xx-small": 9, "x-small": 10, smaller: 13.3333, small: 13, medium: 16, large: 18, larger: 19.2, "x-large": 24, "xx-large": 32 };
1153
- function m(e) {
1154
- var n = "", o = this;
1155
- return o.style && o.style !== "normal" && (n += o.style), o.variant && o.variant !== "normal" && (n += (n ? " " : "") + o.variant), o.weight && o.weight !== "normal" && (n += (n ? " " : "") + o.weight), o.size && (n += (n ? " " : "") + o.size + "px", o.height !== o.size && (n += "/" + o.height + "px")), o.family && (n += (n ? " " : "") + o.family), e && (n += "::" + o.baseline), e && (n += "::" + o.color), n;
727
+ t.d(r, { default: () => Cn });
728
+ var l = /^((?:[a-z\d-]+\s+)*)([\d.]+(%|em|px)|(?:x+-)?large|(?:x+-)?small|medium)(?:\s*\/\s*(normal|[\d.]+(%|px|em)?))?(\s.+)?$/, u = /\bsmall-caps\b/, d = /\b(?:italic|oblique)\b/, g = /\bbold(?:er)?\b/, f = 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 };
729
+ function v(e) {
730
+ var n = "", s = this;
731
+ return s.style && s.style !== "normal" && (n += s.style), s.variant && s.variant !== "normal" && (n += (n ? " " : "") + s.variant), s.weight && s.weight !== "normal" && (n += (n ? " " : "") + s.weight), s.size && (n += (n ? " " : "") + s.size + "px", s.height !== s.size && (n += "/" + s.height + "px")), s.family && (n += (n ? " " : "") + s.family), e && (n += "::" + s.baseline), e && (n += "::" + s.color), n;
1156
732
  }
1157
- var A = { id: "", family: "sans-serif", height: 14, size: 12, variant: "", style: "", weight: "", baseline: "", color: null, toString: m, valueOf: m };
1158
- function T(e) {
1159
- var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, o = h.exec(e);
1160
- n.family = (o[6] || "").trim();
1161
- var i = d[o[2]] || parseFloat(o[2]);
1162
- o[3] === "%" ? i *= 0.16 : o[3] === "em" ? i *= 16 : o[3] === "pt" && (i *= s), n.size = i;
1163
- var c = parseFloat(o[4]);
1164
- if (c !== "normal" && c !== "inherit" && c ? o[5] && o[5] !== "em" ? o[5] === "pt" ? n.height = c * s : o[5] === "%" ? n.height = 0.01 * i : n.height = c : n.height = c * i : n.height = Math.round(i * (7 / 6)), f.test(o[1]) && (n.variant = "small-caps"), g.test(o[1]) && (n.style = "italic"), p.test(o[1]))
733
+ var T = { id: "", family: "sans-serif", height: 14, size: 12, variant: "", style: "", weight: "", baseline: "", color: null, toString: v, valueOf: v };
734
+ function A(e) {
735
+ var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = l.exec(e);
736
+ n.family = (s[6] || "").trim();
737
+ var i = y[s[2]] || parseFloat(s[2]);
738
+ s[3] === "%" ? i *= 0.16 : s[3] === "em" ? i *= 16 : s[3] === "pt" && (i *= f), n.size = i;
739
+ var c = parseFloat(s[4]);
740
+ if (c !== "normal" && c !== "inherit" && c ? s[5] && s[5] !== "em" ? s[5] === "pt" ? n.height = c * f : s[5] === "%" ? n.height = 0.01 * i : n.height = c : n.height = c * i : n.height = Math.round(i * (7 / 6)), u.test(s[1]) && (n.variant = "small-caps"), d.test(s[1]) && (n.style = "italic"), g.test(s[1]))
1165
741
  n.weight = "bold";
1166
742
  else {
1167
- var y = parseInt(/\b(\d+)\b/.exec(o[1]), 10);
1168
- y >= 100 && y !== 400 && (n.weight = y);
743
+ var p = parseInt(/\b(\d+)\b/.exec(s[1]), 10);
744
+ p >= 100 && p !== 400 && (n.weight = p);
1169
745
  }
1170
746
  return n;
1171
747
  }
1172
748
  function b() {
1173
- var e, n, o, i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "12px/14px sans-serif", c = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, y = 14, w = 12, x = null, E = null, k = "";
749
+ var e, n, s, i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "12px/14px sans-serif", c = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, p = 14, w = 12, x = null, k = null, S = "";
1174
750
  if (i && i.nodeType) {
1175
- var O = i && (i.ownerDocument && i.ownerDocument.defaultView || i.document && i || i.defaultView), L = O.getComputedStyle(i, null);
1176
- e = L.getPropertyValue("font-family") || "", w = parseFloat(L.getPropertyValue("font-size")), y = L.getPropertyValue("line-height"), x = L.getPropertyValue("font-weight"), E = L.getPropertyValue("font-style"), k = L.getPropertyValue("font-variant") || "";
751
+ var M = i && (i.ownerDocument && i.ownerDocument.defaultView || i.document && i || i.defaultView), O = M.getComputedStyle(i, null);
752
+ e = O.getPropertyValue("font-family") || "", w = parseFloat(O.getPropertyValue("font-size")), p = O.getPropertyValue("line-height"), x = O.getPropertyValue("font-weight"), k = O.getPropertyValue("font-style"), S = O.getPropertyValue("font-variant") || "";
1177
753
  } else if (typeof i == "string") {
1178
- var M = T(i);
1179
- e = M.family, w = M.size, y = M.height, k = M.variant, E = M.style, x = M.weight;
754
+ var I = A(i);
755
+ e = I.family, w = I.size, p = I.height, S = I.variant, k = I.style, x = I.weight;
1180
756
  } else
1181
- a(i) === "object" && (e = i.family, w = i.size, y = i.height, k = i.variant, x = i.weight, E = i.style, n = i.baseline, o = i.color);
1182
- c.size && c.size < 3 && (w *= c.size), y = y !== "normal" && y ? parseFloat(y) : w * (7 / 6), c.height && c.height < 3 && (y *= c.height);
1183
- var z = Object.create(A);
1184
- return z.family = c.family || e || "sans-serif", z.height = y ?? 14, z.size = w ?? 12, z.variant = c.variant || k || "", z.style = c.style || E || "", z.weight = c.weight || x || "", z.baseline = n || 0, c.baseline != null && (z.baseline = c.baseline), z.color = c.color || o || "", z.id = m.call(z, !0), z;
757
+ o(i) === "object" && (e = i.family, w = i.size, p = i.height, S = i.variant, x = i.weight, k = i.style, n = i.baseline, s = i.color);
758
+ c.size && c.size < 3 && (w *= c.size), p = p !== "normal" && p ? parseFloat(p) : w * (7 / 6), c.height && c.height < 3 && (p *= c.height);
759
+ var L = Object.create(T);
760
+ return L.family = c.family || e || "sans-serif", L.height = p ?? 14, L.size = w ?? 12, L.variant = c.variant || S || "", L.style = c.style || k || "", L.weight = c.weight || x || "", L.baseline = n || 0, c.baseline != null && (L.baseline = c.baseline), L.color = c.color || s || "", L.id = v.call(L, !0), L;
1185
761
  }
1186
- const I = { "\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 };
1187
- var S, P = function(e) {
762
+ const C = { "\n": 0.28, "\r": 0.28, " ": 0.28, " ": 0.28, " ": 0.28, "᠎": 0, " ": 0.5, " ": 1, " ": 0.5, " ": 1, " ": 0.33, " ": 0.25, " ": 0.16, " ": 0.56, " ": 0.28, " ": 0.2, " ": 0.15, "​": 0, " ": 0.16, " ": 0.22, " ": 1, "\uFEFF": 0 };
763
+ var E, $ = function(e) {
1188
764
  var n = typeof OffscreenCanvas < "u" && new OffscreenCanvas(100, 100) || e && e.createElement("canvas");
1189
765
  if (n && n.getContext) {
1190
- var o = n.getContext("2d");
1191
- if (o && typeof o.measureText == "function")
766
+ var s = n.getContext("2d");
767
+ if (s && typeof s.measureText == "function")
1192
768
  return function(i, c) {
1193
- return o.font = String(c), o.measureText(i).width;
769
+ return s.font = String(c), s.measureText(i).width;
1194
770
  };
1195
771
  }
1196
- }(typeof document < "u" ? document : null) || (S = {}, function(e, n) {
1197
- if (!S[n]) {
1198
- var o = b(n);
1199
- S[n] = o, /\bmonospace\b/.test(o.family) ? o.size *= 0.6 : (o.size *= 0.45, o.weight && (o.size *= 1.18));
772
+ }(typeof document < "u" ? document : null) || (E = {}, function(e, n) {
773
+ if (!E[n]) {
774
+ var s = b(n);
775
+ E[n] = s, /\bmonospace\b/.test(s.family) ? s.size *= 0.6 : (s.size *= 0.45, s.weight && (s.size *= 1.18));
1200
776
  }
1201
- return e.length * S[n].size;
1202
- }), $ = {}, _ = { trim: !0, collapse: !0 };
1203
- function X(e, n, o) {
1204
- var i = Object.assign({}, _, o), c = String(e);
777
+ return e.length * E[n].size;
778
+ }), N = {}, _ = { trim: !0, collapse: !0 };
779
+ function G(e, n, s) {
780
+ var i = Object.assign({}, _, s), c = String(e);
1205
781
  if (!c)
1206
782
  return 0;
1207
- if (c in I) {
1208
- var y = n.id + "/" + c;
1209
- return y in $ || ($[y] = P("_".concat(c, "_"), n) - P("__", n)), $[y];
783
+ if (c in C) {
784
+ var p = n.id + "/" + c;
785
+ return p in N || (N[p] = $("_".concat(c, "_"), n) - $("__", n)), N[p];
1210
786
  }
1211
- return i.trim && i.collapse ? i.trim ? c = c.trim() : i.collapse && (c = c.replace(/\s+/g, " ")) : c = c.replace(/\n/g, " "), P(c, n) + n.size * (e.tracking || 0);
787
+ return i.trim && i.collapse ? i.trim ? c = c.trim() : i.collapse && (c = c.replace(/\s+/g, " ")) : c = c.replace(/\n/g, " "), $(c, n) + n.size * (e.tracking || 0);
1212
788
  }
1213
789
  function W(e) {
1214
790
  return W = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
@@ -1217,17 +793,17 @@ var Xe = { exports: {} };
1217
793
  return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
1218
794
  }, W(e);
1219
795
  }
1220
- function Et(e, n) {
796
+ function _t(e, n) {
1221
797
  if (typeof n != "function" && n !== null)
1222
798
  throw new TypeError("Super expression must either be null or a function");
1223
- e.prototype = Object.create(n && n.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), n && kt(e, n);
799
+ e.prototype = Object.create(n && n.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), n && It(e, n);
1224
800
  }
1225
- function kt(e, n) {
1226
- return kt = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(o, i) {
1227
- return o.__proto__ = i, o;
1228
- }, kt(e, n);
801
+ function It(e, n) {
802
+ return It = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(s, i) {
803
+ return s.__proto__ = i, s;
804
+ }, It(e, n);
1229
805
  }
1230
- function Wt(e) {
806
+ function Jt(e) {
1231
807
  var n = function() {
1232
808
  if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
1233
809
  return !1;
@@ -1241,62 +817,62 @@ var Xe = { exports: {} };
1241
817
  }
1242
818
  }();
1243
819
  return function() {
1244
- var o, i = Ct(e);
820
+ var s, i = Nt(e);
1245
821
  if (n) {
1246
- var c = Ct(this).constructor;
1247
- o = Reflect.construct(i, arguments, c);
822
+ var c = Nt(this).constructor;
823
+ s = Reflect.construct(i, arguments, c);
1248
824
  } else
1249
- o = i.apply(this, arguments);
1250
- return We(this, o);
825
+ s = i.apply(this, arguments);
826
+ return en(this, s);
1251
827
  };
1252
828
  }
1253
- function We(e, n) {
829
+ function en(e, n) {
1254
830
  if (n && (W(n) === "object" || typeof n == "function"))
1255
831
  return n;
1256
832
  if (n !== void 0)
1257
833
  throw new TypeError("Derived constructors may only return object or undefined");
1258
- return function(o) {
1259
- if (o === void 0)
834
+ return function(s) {
835
+ if (s === void 0)
1260
836
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1261
- return o;
837
+ return s;
1262
838
  }(e);
1263
839
  }
1264
- function Ct(e) {
1265
- return Ct = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(n) {
840
+ function Nt(e) {
841
+ return Nt = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(n) {
1266
842
  return n.__proto__ || Object.getPrototypeOf(n);
1267
- }, Ct(e);
843
+ }, Nt(e);
1268
844
  }
1269
- function Pt(e, n) {
845
+ function Ht(e, n) {
1270
846
  if (!(e instanceof n))
1271
847
  throw new TypeError("Cannot call a class as a function");
1272
848
  }
1273
- function pe(e, n) {
1274
- for (var o = 0; o < n.length; o++) {
1275
- var i = n[o];
1276
- i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, (c = function(y, w) {
1277
- if (W(y) !== "object" || y === null)
1278
- return y;
1279
- var x = y[Symbol.toPrimitive];
849
+ function me(e, n) {
850
+ for (var s = 0; s < n.length; s++) {
851
+ var i = n[s];
852
+ i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, (c = function(p, w) {
853
+ if (W(p) !== "object" || p === null)
854
+ return p;
855
+ var x = p[Symbol.toPrimitive];
1280
856
  if (x !== void 0) {
1281
- var E = x.call(y, w);
1282
- if (W(E) !== "object")
1283
- return E;
857
+ var k = x.call(p, w);
858
+ if (W(k) !== "object")
859
+ return k;
1284
860
  throw new TypeError("@@toPrimitive must return a primitive value.");
1285
861
  }
1286
- return String(y);
862
+ return String(p);
1287
863
  }(i.key, "string"), W(c) === "symbol" ? c : String(c)), i);
1288
864
  }
1289
865
  var c;
1290
866
  }
1291
- function $t(e, n, o) {
1292
- return n && pe(e.prototype, n), o && pe(e, o), Object.defineProperty(e, "prototype", { writable: !1 }), e;
867
+ function Ft(e, n, s) {
868
+ return n && me(e.prototype, n), s && me(e, s), Object.defineProperty(e, "prototype", { writable: !1 }), e;
1293
869
  }
1294
- var H = function() {
870
+ var F = function() {
1295
871
  function e() {
1296
872
  var n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
1297
- Pt(this, e), this.value = n, this.weight = null, this.style = null, this.font = null, this.href = null, this.sub = !1, this.sup = !1;
873
+ Ht(this, e), this.value = n, this.weight = null, this.style = null, this.font = null, this.href = null, this.sub = !1, this.sup = !1;
1298
874
  }
1299
- return $t(e, [{ key: "clone", value: function() {
875
+ return Ft(e, [{ key: "clone", value: function() {
1300
876
  var n = new e(this.value);
1301
877
  return n.value = this.value, n.weight = this.weight, n.style = this.style, n.font = this.font, n.href = this.href, n.sub = this.sub, n.sup = this.sup, n;
1302
878
  } }, { key: "valueOf", value: function() {
@@ -1304,43 +880,43 @@ var Xe = { exports: {} };
1304
880
  } }, { key: "toString", value: function() {
1305
881
  return this.value;
1306
882
  } }]), e;
1307
- }(), Tt = function(e) {
1308
- Et(o, e);
1309
- var n = Wt(o);
1310
- function o() {
1311
- return Pt(this, o), n.apply(this, arguments);
883
+ }(), Dt = function(e) {
884
+ _t(s, e);
885
+ var n = Jt(s);
886
+ function s() {
887
+ return Ht(this, s), n.apply(this, arguments);
1312
888
  }
1313
- return $t(o);
1314
- }(H), nt = function(e) {
1315
- Et(o, e);
1316
- var n = Wt(o);
1317
- function o() {
1318
- return Pt(this, o), n.apply(this, arguments);
889
+ return Ft(s);
890
+ }(F), et = function(e) {
891
+ _t(s, e);
892
+ var n = Jt(s);
893
+ function s() {
894
+ return Ht(this, s), n.apply(this, arguments);
1319
895
  }
1320
- return $t(o);
1321
- }(H), pt = function(e) {
1322
- Et(o, e);
1323
- var n = Wt(o);
1324
- function o() {
1325
- return Pt(this, o), n.apply(this, arguments);
896
+ return Ft(s);
897
+ }(F), gt = function(e) {
898
+ _t(s, e);
899
+ var n = Jt(s);
900
+ function s() {
901
+ return Ht(this, s), n.apply(this, arguments);
1326
902
  }
1327
- return $t(o);
1328
- }(H), Gt = /^[\n\r\t\x20\xA0\u2000-\u200B\u205F\u3000]/, Ge = /^[^\n\r\t\u0020\u2000-\u200B\u205F\u3000]{2,}/, ge = /^[\xA0\u2011\u202F\u2060\uFEFF]/, Ze = /^(?:[;\xAD%?…]|,(?!\d))/, Ke = /^[´±°¢£¤$¥\u2212]/;
1329
- function Nt(e, n) {
903
+ return Ft(s);
904
+ }(F), Qt = /^[\n\r\t\x20\xA0\u2000-\u200B\u205F\u3000]/, nn = /^[^\n\r\t\u0020\u2000-\u200B\u205F\u3000]{2,}/, ve = /^[\xA0\u2011\u202F\u2060\uFEFF]/, rn = /^(?:[;\xAD%?…]|,(?!\d))/, sn = /^[´±°¢£¤$¥\u2212]/;
905
+ function Bt(e, n) {
1330
906
  n !== !1 && (e = e.trim());
1331
- for (var o, i, c = [], y = e.charAt(0), w = 0, x = 1, E = e.length; x < E; x++) {
1332
- o = e.charAt(x), i = e.charAt(x + 1);
1333
- var k = Gt.test(y), O = Gt.test(o), L = O || k, M = void 0;
1334
- if ((Ke.test(o) && !ge.test(y) || Ze.test(y + i) && !ge.test(o)) && (L = !0), y !== "-" && y !== "‐" && y !== "–" && y !== "—" || ((M = Gt.test(e.charAt(x - 2))) && !O && (L = !1), !M && Ge.test(o + i) && (L = !0)), L) {
1335
- var z = e.slice(w, x);
1336
- /\u00AD$/.test(z) ? (c.push(new H(z.slice(0, -1))), c.push(new pt())) : (c.push(new H(z)), c.push(new Tt())), w = x;
907
+ for (var s, i, c = [], p = e.charAt(0), w = 0, x = 1, k = e.length; x < k; x++) {
908
+ s = e.charAt(x), i = e.charAt(x + 1);
909
+ var S = Qt.test(p), M = Qt.test(s), O = M || S, I = void 0;
910
+ if ((sn.test(s) && !ve.test(p) || rn.test(p + i) && !ve.test(s)) && (O = !0), p !== "-" && p !== "‐" && p !== "–" && p !== "—" || ((I = Qt.test(e.charAt(x - 2))) && !M && (O = !1), !I && nn.test(s + i) && (O = !0)), O) {
911
+ var L = e.slice(w, x);
912
+ /\u00AD$/.test(L) ? (c.push(new F(L.slice(0, -1))), c.push(new gt())) : (c.push(new F(L)), c.push(new Dt())), w = x;
1337
913
  }
1338
- y = o;
914
+ p = s;
1339
915
  }
1340
- return c.push(new H(e.slice(w))), c;
916
+ return c.push(new F(e.slice(w))), c;
1341
917
  }
1342
- const ye = { 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: "›" };
1343
- var Je = /^[\n\r\x20\u2000-\u200B\u205F\u3000]/, Qe = /^<\/([a-zA-Z0-9]+)([^>]*)>/, tn = /^<([a-zA-Z0-9]+)((?:\s[^=\s/]+(?:\s*=\s*(?:"[^"]+"|'[^']+'|[^>\\s]+))?)+)?\s*(\/?)>(\n*)/, en = /^<!--(.+?)-->/, nn = /&(?:#(\d\d{2,})|#x([\da-fA-F]{2,})|([a-zA-Z][a-zA-Z1-4]{1,8}));/g, me = { b: function(e) {
918
+ const xe = { 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: "›" };
919
+ var on = /^[\n\r\x20\u2000-\u200B\u205F\u3000]/, an = /^<\/([a-zA-Z0-9]+)([^>]*)>/, ln = /^<([a-zA-Z0-9]+)((?:\s[^=\s/]+(?:\s*=\s*(?:"[^"]+"|'[^']+'|[^>\\s]+))?)+)?\s*(\/?)>(\n*)/, hn = /^<!--(.+?)-->/, cn = /&(?:#(\d\d{2,})|#x([\da-fA-F]{2,})|([a-zA-Z][a-zA-Z1-4]{1,8}));/g, we = { b: function(e) {
1344
920
  e.weight = "bold";
1345
921
  }, strong: function(e) {
1346
922
  e.weight = "bold";
@@ -1366,37 +942,37 @@ var Xe = { exports: {} };
1366
942
  e.sub = !0;
1367
943
  }, sup: function(e) {
1368
944
  e.sup = !0;
1369
- } }, rn = { 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 };
1370
- function ve(e) {
1371
- return e.replace(nn, function(n, o, i, c) {
1372
- if (o || i) {
1373
- var y = o ? 10 : 16;
1374
- return String.fromCharCode(parseInt(o || i, y));
945
+ } }, un = { 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 };
946
+ function be(e) {
947
+ return e.replace(cn, function(n, s, i, c) {
948
+ if (s || i) {
949
+ var p = s ? 10 : 16;
950
+ return String.fromCharCode(parseInt(s || i, p));
1375
951
  }
1376
- return c in ye ? ye[c] : n;
952
+ return c in xe ? xe[c] : n;
1377
953
  });
1378
954
  }
1379
- function sn(e) {
955
+ function dn(e) {
1380
956
  return e && e.length > 1 && (e[0] === '"' && e[e.length - 1] === '"' || e[0] === "'" && e[e.length - 1] === "'") ? e.slice(1, -1) : e;
1381
957
  }
1382
- var on = /^\s*([^=\s&]+)(?:\s*=\s*("[^"]+"|'[^']+'|[^>\s]+))?/;
1383
- function an(e) {
1384
- var n, o = {};
958
+ var fn = /^\s*([^=\s&]+)(?:\s*=\s*("[^"]+"|'[^']+'|[^>\s]+))?/;
959
+ function pn(e) {
960
+ var n, s = {};
1385
961
  if (e) {
1386
962
  do
1387
- if (n = on.exec(e)) {
1388
- var i = ve(sn(n[2] || "")).replace(/[ \r\n\t]+/g, " ").trim();
1389
- if (o[n[1]] = i, (e = e.slice(n[0].length)).length && /^\S/.test(e[0]))
963
+ if (n = fn.exec(e)) {
964
+ var i = be(dn(n[2] || "")).replace(/[ \r\n\t]+/g, " ").trim();
965
+ if (s[n[1]] = i, (e = e.slice(n[0].length)).length && /^\S/.test(e[0]))
1390
966
  throw new Error("Attribute error");
1391
967
  }
1392
968
  while (n && e.length);
1393
969
  if (/\S/.test(e))
1394
970
  throw new Error("Attribute error");
1395
971
  }
1396
- return o;
972
+ return s;
1397
973
  }
1398
- const xe = { 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: "Þ" };
1399
- var ln = /^(\^|_|\\[^#$%&~_^\\{}()\s]+)(\{)?/, hn = /^%[^\n]+(?:\n|$)/, cn = /^[^#$%&~_^\\{}]+/, un = /^\\([&{}$%#_])/, dn = /(?:\\[\\@,!:;-]|-{2,3}|[!?]`|``?|,,|''?|~|<<|>>)/g, fn = { "---": "—", "--": "–", "!`": "¡", "?`": "¿", "``": "“", ",,": "„", "''": "”", "`": "‘", "'": "’", "<<": "«", ">>": "»", "~": " ", "\\-": "­", "\\,": " ", "\\;": " ", "\\:": " ", "\\!": " ", "\\@": "\uFEFF", "\\\\": "\\newline{}" }, U = { bf: function(e) {
974
+ const Ae = { 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: "Þ" };
975
+ var gn = /^(\^|_|\\[^#$%&~_^\\{}()\s]+)(\{)?/, yn = /^%[^\n]+(?:\n|$)/, mn = /^[^#$%&~_^\\{}]+/, vn = /^\\([&{}$%#_])/, xn = /(?:\\[\\@,!:;-]|-{2,3}|[!?]`|``?|,,|''?|~|<<|>>)/g, wn = { "---": "—", "--": "–", "!`": "¡", "?`": "¿", "``": "“", ",,": "„", "''": "”", "`": "‘", "'": "’", "<<": "«", ">>": "»", "~": " ", "\\-": "­", "\\,": " ", "\\;": " ", "\\:": " ", "\\!": " ", "\\@": "\uFEFF", "\\\\": "\\newline{}" }, U = { bf: function(e) {
1400
976
  e.weight = "bold";
1401
977
  }, it: function(e) {
1402
978
  e.style = "italic";
@@ -1411,170 +987,170 @@ var Xe = { exports: {} };
1411
987
  }, _: function(e) {
1412
988
  e.sub = !0;
1413
989
  }, par: function(e) {
1414
- this.tokens.push(new nt(), new nt());
990
+ this.tokens.push(new et(), new et());
1415
991
  }, newline: function(e) {
1416
- this.tokens.push(new nt());
992
+ this.tokens.push(new et());
1417
993
  }, url: function(e, n) {
1418
- this.open_context().href = n, this.add_token(new H(n)), this.close_context();
994
+ this.open_context().href = n, this.add_token(new F(n)), this.close_context();
1419
995
  } };
1420
996
  U.textsuperscript = U["^"], U.textsubscript = U._, U.textsl = U.sl, U.mathbf = U.bf, U.mathit = U.it, U.textbf = U.bf, U.textit = U.it, U.textcolor = U.color;
1421
- var pn = /[\r\n\xA0]+/g;
1422
- function gn(e, n) {
997
+ var bn = /[\r\n\xA0]+/g;
998
+ function An(e, n) {
1423
999
  e.sup && (e.baseline = 0.45, e.size = 0.7), e.sub && (e.baseline = -0.3, e.size = 0.7);
1424
- var o = n;
1425
- return (e.style || e.weight || e.baseline || e.color || e.size || e.family) && (o = b(n, e)), o;
1000
+ var s = n;
1001
+ return (e.style || e.weight || e.baseline || e.color || e.size || e.family) && (s = b(n, e)), s;
1426
1002
  }
1427
- function we(e, n, o) {
1428
- for (var i, c, y = e.width; y + o.width > n && e.length; )
1429
- c = (i = e[e.length - 1]).width, i.width > o.width ? (i.value = i.value.slice(0, -1), i.width = X(i, i.font), y += i.width) : e.pop(), y -= c;
1430
- e[e.length - 1] instanceof pt && e.pop(), i = e[e.length - 1] || i || {}, o.font = b(o.font, i.bold, i.italic, ""), o.href = e.length ? i.href : null, o.rel = e.length ? i.rel : null, o.target = e.length ? i.target : null, e.push(o);
1003
+ function Ee(e, n, s) {
1004
+ for (var i, c, p = e.width; p + s.width > n && e.length; )
1005
+ c = (i = e[e.length - 1]).width, i.width > s.width ? (i.value = i.value.slice(0, -1), i.width = G(i, i.font), p += i.width) : e.pop(), p -= c;
1006
+ e[e.length - 1] instanceof gt && e.pop(), i = e[e.length - 1] || i || {}, s.font = b(s.font, i.bold, i.italic, ""), s.href = e.length ? i.href : null, s.rel = e.length ? i.rel : null, s.target = e.length ? i.target : null, e.push(s);
1431
1007
  }
1432
- function vt(e) {
1008
+ function xt(e) {
1433
1009
  return Math.round(1e6 * e) / 1e6;
1434
1010
  }
1435
- function be(e) {
1011
+ function ke(e) {
1436
1012
  return function(n) {
1437
1013
  if (Array.isArray(n))
1438
- return Zt(n);
1014
+ return te(n);
1439
1015
  }(e) || function(n) {
1440
1016
  if (typeof Symbol < "u" && n[Symbol.iterator] != null || n["@@iterator"] != null)
1441
1017
  return Array.from(n);
1442
- }(e) || function(n, o) {
1018
+ }(e) || function(n, s) {
1443
1019
  if (n) {
1444
1020
  if (typeof n == "string")
1445
- return Zt(n, o);
1021
+ return te(n, s);
1446
1022
  var i = Object.prototype.toString.call(n).slice(8, -1);
1447
- return i === "Object" && n.constructor && (i = n.constructor.name), i === "Map" || i === "Set" ? Array.from(n) : i === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i) ? Zt(n, o) : void 0;
1023
+ return i === "Object" && n.constructor && (i = n.constructor.name), i === "Map" || i === "Set" ? Array.from(n) : i === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i) ? te(n, s) : void 0;
1448
1024
  }
1449
1025
  }(e) || function() {
1450
1026
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
1451
1027
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
1452
1028
  }();
1453
1029
  }
1454
- function Zt(e, n) {
1030
+ function te(e, n) {
1455
1031
  (n == null || n > e.length) && (n = e.length);
1456
- for (var o = 0, i = new Array(n); o < n; o++)
1457
- i[o] = e[o];
1032
+ for (var s = 0, i = new Array(n); s < n; s++)
1033
+ i[s] = e[s];
1458
1034
  return i;
1459
1035
  }
1460
- var yn = { center: "middle", right: "end" }, mn = { middle: 0.5, center: 0.5, bottom: 1, end: 1 }, Kt = function(e, n) {
1036
+ var En = { center: "middle", right: "end" }, kn = { middle: 0.5, center: 0.5, bottom: 1, end: 1 }, ee = function(e, n) {
1461
1037
  return !e && !n || e === n;
1462
1038
  };
1463
- function vn(e, n) {
1464
- var o = [], i = n.font(), c = i.size, y = i.family, w = n.align(), x = n.createElement();
1039
+ function Sn(e, n) {
1040
+ var s = [], i = n.font(), c = i.size, p = i.family, w = n.align(), x = n.createElement();
1465
1041
  if (e.length) {
1466
- var E = i.height, k = n.valign(), O = n.height()(), L = n.width()(0), M = !isFinite(L) && e.length === 1, z = M ? null : n.x(), j = vt(E / c), Q = M ? null : vt(E / (1.15 * c + (E - c) / 2));
1467
- if (mn[k] && isFinite(O)) {
1468
- var N = k === "bottom" ? 1 : 0.5;
1469
- Q += (O * N - E * e.length * N) / c;
1042
+ var k = i.height, S = n.valign(), M = n.height()(), O = n.width()(0), I = !isFinite(O) && e.length === 1, L = I ? null : n.x(), B = xt(k / c), J = I ? null : xt(k / (1.15 * c + (k - c) / 2));
1043
+ if (kn[S] && isFinite(M)) {
1044
+ var z = S === "bottom" ? 1 : 0.5;
1045
+ J += (M * z - k * e.length * z) / c;
1470
1046
  }
1471
- var C = w === "justify", F = 0;
1472
- w === "right" ? F = L : w === "center" && (F = L / 2);
1473
- for (var R = [], tt = "tspan", G = null, q = "", D = function() {
1047
+ var P = w === "justify", j = 0;
1048
+ w === "right" ? j = O : w === "center" && (j = O / 2);
1049
+ for (var H = [], Q = "tspan", Y = null, q = "", D = function() {
1474
1050
  if (q) {
1475
- var gt = x(tt, G, q);
1476
- R.push(gt);
1051
+ var yt = x(Q, Y, q);
1052
+ H.push(yt);
1477
1053
  }
1478
- tt = "tspan", G = null, q = "";
1479
- }, it = 0, et = e.length; it < et; it++) {
1480
- var at = "", dt = "", st = 0, lt = e[it];
1054
+ Q = "tspan", Y = null, q = "";
1055
+ }, nt = 0, tt = e.length; nt < tt; nt++) {
1056
+ var at = "", dt = "", ot = 0, lt = e[nt];
1481
1057
  if (lt.length) {
1482
- R = [];
1483
- for (var xt = 0, Mt = 0, ht = void 0, Z = 0, Rt = lt.length; Z < Rt; Z++) {
1484
- var B = lt[Z], K = B.font;
1485
- B.whitespace && xt++, Mt += B.width, Z && !B.tracking && !st && Kt(K.id, at) && Kt(B.class, dt) && Kt(ht, B.href) ? q += B.value : (D(), q = B.value, G = { fontFamily: K.family !== y ? K.family : null, fontSize: K.size !== c ? 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: B.class || null }, st && (G.dx = vt(st), st = 0), B.tracking && (st = K.size * B.tracking), B.href && !ht ? (ht = B.href, tt = "a", G.href = ht, G.rel = B.rel, G.target = B.target) : ht = null, at = K.id, dt = B.class);
1058
+ H = [];
1059
+ for (var wt = 0, Lt = 0, ht = void 0, X = 0, jt = lt.length; X < jt; X++) {
1060
+ var R = lt[X], Z = R.font;
1061
+ R.whitespace && wt++, Lt += R.width, X && !R.tracking && !ot && ee(Z.id, at) && ee(R.class, dt) && ee(ht, R.href) ? q += R.value : (D(), q = R.value, Y = { fontFamily: Z.family !== p ? Z.family : null, fontSize: Z.size !== c ? Z.size : null, fontWeight: Z.weight || null, fontStyle: Z.style || null, fontVariant: Z.variant !== "normal" && Z.variant || null, fill: Z.color || null, baselineShift: Z.baseline ? 100 * Z.baseline + "%" : null, className: R.class || null }, ot && (Y.dx = xt(ot), ot = 0), R.tracking && (ot = Z.size * R.tracking), R.href && !ht ? (ht = R.href, Q = "a", Y.href = ht, Y.rel = R.rel, Y.target = R.target) : ht = null, at = Z.id, dt = R.class);
1486
1062
  }
1487
- if (D(), M)
1488
- o.push.apply(o, be(R));
1063
+ if (D(), I)
1064
+ s.push.apply(s, ke(H));
1489
1065
  else {
1490
- var Ht = null, Dt = it === et - 1 || lt[lt.length - 1] instanceof nt;
1491
- C && lt.length > 1 && !Dt && (Ht = vt((L - Mt) / xt)), o.push(x.apply(void 0, ["tspan", { wordSpacing: Ht, x: z(it) + F, dy: vt(it ? j : Q) + "em" }].concat(be(R))));
1066
+ var qt = null, Ct = nt === tt - 1 || lt[lt.length - 1] instanceof et;
1067
+ P && lt.length > 1 && !Ct && (qt = xt((O - Lt) / wt)), s.push(x.apply(void 0, ["tspan", { wordSpacing: qt, x: L(nt) + j, dy: xt(nt ? B : J) + "em" }].concat(ke(H))));
1492
1068
  }
1493
1069
  } else
1494
- o.push(x("tspan", { x: z(it), dy: vt(it ? j : Q) + "em" }, " "));
1070
+ s.push(x("tspan", { x: L(nt), dy: xt(nt ? B : J) + "em" }, " "));
1495
1071
  }
1496
1072
  }
1497
- return x.apply(void 0, ["text", { fontFamily: y, fontSize: c, textAnchor: yn[w] || "start" }].concat(o));
1073
+ return x.apply(void 0, ["text", { fontFamily: p, fontSize: c, textAnchor: En[w] || "start" }].concat(s));
1498
1074
  }
1499
- var xn = { middle: 0.5, center: 0.5, bottom: 1, end: 1 };
1500
- function wn(e, n, o) {
1075
+ var Tn = { middle: 0.5, center: 0.5, bottom: 1, end: 1 };
1076
+ function _n(e, n, s) {
1501
1077
  if (e.length) {
1502
- o.textBaseline = "middle";
1503
- var i = n.font(), c = i.height, y = i.size, w = n.valign(), x = n.height()(), E = n.width()(0), k = n.align(), O = k === "justify", L = 0.5 * c, M = xn[w];
1504
- if (M && isFinite(x)) {
1505
- var z = e.length * c;
1506
- L += x * M - z * M;
1078
+ s.textBaseline = "middle";
1079
+ var i = n.font(), c = i.height, p = i.size, w = n.valign(), x = n.height()(), k = n.width()(0), S = n.align(), M = S === "justify", O = 0.5 * c, I = Tn[w];
1080
+ if (I && isFinite(x)) {
1081
+ var L = e.length * c;
1082
+ O += x * I - L * I;
1507
1083
  }
1508
- e.forEach(function(j, Q) {
1509
- var N = n.x()(Q), C = Q * c + L, F = 0, R = 0;
1510
- j.forEach(function(q) {
1511
- q.whitespace && F++, R += q.width;
1084
+ e.forEach(function(B, J) {
1085
+ var z = n.x()(J), P = J * c + O, j = 0, H = 0;
1086
+ B.forEach(function(q) {
1087
+ q.whitespace && j++, H += q.width;
1512
1088
  });
1513
- var tt = 0, G = Q === e.length - 1 || j[j.length - 1] instanceof nt;
1514
- O && j.length > 1 && !G && (tt = (E - R) / F), j.forEach(function(q) {
1515
- o.font = q.font;
1516
- var D = q.font, it = D.baseline ? y * -D.baseline + 0.15 * y : 0;
1517
- o.fillStyle = function(dt, st) {
1518
- return dt.color ? dt.color : st.href ? "#00C" : "#000";
1089
+ var Q = 0, Y = J === e.length - 1 || B[B.length - 1] instanceof et;
1090
+ M && B.length > 1 && !Y && (Q = (k - H) / j), B.forEach(function(q) {
1091
+ s.font = q.font;
1092
+ var D = q.font, nt = D.baseline ? p * -D.baseline + 0.15 * p : 0;
1093
+ s.fillStyle = function(dt, ot) {
1094
+ return dt.color ? dt.color : ot.href ? "#00C" : "#000";
1519
1095
  }(D, q);
1520
- var et = 0;
1521
- if (k === "right" ? et += E - R : k === "center" ? et += E / 2 - R / 2 : k === "justify" && (q.whitespace || q instanceof nt) && (N += tt), o.fillText(q.value, N + et, C + it), q.href) {
1522
- o.beginPath(), o.strokeStyle = o.fillStyle;
1523
- var at = Math.floor(C + 0.45 * y) + 0.5;
1524
- o.moveTo(N + et, at), o.lineTo(N + et + q.width, at), o.stroke();
1096
+ var tt = 0;
1097
+ if (S === "right" ? tt += k - H : S === "center" ? tt += k / 2 - H / 2 : S === "justify" && (q.whitespace || q instanceof et) && (z += Q), s.fillText(q.value, z + tt, P + nt), q.href) {
1098
+ s.beginPath(), s.strokeStyle = s.fillStyle;
1099
+ var at = Math.floor(P + 0.45 * p) + 0.5;
1100
+ s.moveTo(z + tt, at), s.lineTo(z + tt + q.width, at), s.stroke();
1525
1101
  }
1526
- N += q.width;
1102
+ z += q.width;
1527
1103
  });
1528
1104
  });
1529
1105
  }
1530
1106
  }
1531
- function Jt(e) {
1532
- return Jt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
1107
+ function ne(e) {
1108
+ return ne = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
1533
1109
  return typeof n;
1534
1110
  } : function(n) {
1535
1111
  return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
1536
- }, Jt(e);
1112
+ }, ne(e);
1537
1113
  }
1538
- function Ae(e) {
1539
- for (var n = {}, o = 0; o < e.length; o++) {
1540
- var i = e[o];
1541
- typeof i != "number" && i != null && (typeof i == "string" ? n.text = i : typeof i == "function" ? n.fn = i : Jt(i) === "object" && i._groups ? n.d3 = i : i && i.nodeType && i.getContext ? n.ctx = i.getContext("2d") : i && i.fillText && i.beginPath ? n.ctx = i : i && (n.text = i));
1114
+ function Se(e) {
1115
+ for (var n = {}, s = 0; s < e.length; s++) {
1116
+ var i = e[s];
1117
+ typeof i != "number" && i != null && (typeof i == "string" ? n.text = i : typeof i == "function" ? n.fn = i : ne(i) === "object" && i._groups ? n.d3 = i : i && i.nodeType && i.getContext ? n.ctx = i.getContext("2d") : i && i.fillText && i.beginPath ? n.ctx = i : i && (n.text = i));
1542
1118
  }
1543
1119
  return n;
1544
1120
  }
1545
- function _t(e) {
1546
- return _t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
1121
+ function Mt(e) {
1122
+ return Mt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
1547
1123
  return typeof n;
1548
1124
  } : function(n) {
1549
1125
  return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
1550
- }, _t(e);
1126
+ }, Mt(e);
1551
1127
  }
1552
- function bn(e, n) {
1553
- for (var o = 0; o < n.length; o++) {
1554
- var i = n[o];
1555
- i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, (c = function(y, w) {
1556
- if (_t(y) !== "object" || y === null)
1557
- return y;
1558
- var x = y[Symbol.toPrimitive];
1128
+ function In(e, n) {
1129
+ for (var s = 0; s < n.length; s++) {
1130
+ var i = n[s];
1131
+ i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, (c = function(p, w) {
1132
+ if (Mt(p) !== "object" || p === null)
1133
+ return p;
1134
+ var x = p[Symbol.toPrimitive];
1559
1135
  if (x !== void 0) {
1560
- var E = x.call(y, w);
1561
- if (_t(E) !== "object")
1562
- return E;
1136
+ var k = x.call(p, w);
1137
+ if (Mt(k) !== "object")
1138
+ return k;
1563
1139
  throw new TypeError("@@toPrimitive must return a primitive value.");
1564
1140
  }
1565
- return String(y);
1566
- }(i.key, "string"), _t(c) === "symbol" ? c : String(c)), i);
1141
+ return String(p);
1142
+ }(i.key, "string"), Mt(c) === "symbol" ? c : String(c)), i);
1567
1143
  }
1568
1144
  var c;
1569
1145
  }
1570
- var An = b(), Qt = function(e) {
1146
+ var Dn = b(), ie = function(e) {
1571
1147
  return typeof e == "function" ? e : function() {
1572
1148
  return e;
1573
1149
  };
1574
- }, rt = function() {
1150
+ }, it = function() {
1575
1151
  function e(i) {
1576
- if (function(y, w) {
1577
- if (!(y instanceof w))
1152
+ if (function(p, w) {
1153
+ if (!(p instanceof w))
1578
1154
  throw new TypeError("Cannot call a class as a function");
1579
1155
  }(this, e), this.props = { overflow: "ellipsis", lineclamp: null, align: "left", wordBreak: null, valign: "top", width: function() {
1580
1156
  return 1 / 0;
@@ -1586,82 +1162,82 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1586
1162
  for (var c in i)
1587
1163
  typeof this[c] == "function" && this[c](i[c]);
1588
1164
  }
1589
- var n, o;
1590
- return n = e, o = [{ key: "linebreak", value: function(i) {
1591
- var c = this, y = this.props.parser(String(i)), w = this.font(), x = function(E, k, O) {
1592
- if (!E.length)
1165
+ var n, s;
1166
+ return n = e, s = [{ key: "linebreak", value: function(i) {
1167
+ var c = this, p = this.props.parser(String(i)), w = this.font(), x = function(k, S, M) {
1168
+ if (!k.length)
1593
1169
  return [];
1594
- var L = k.height(), M = k.width(), z = k.overflowLine(), j = k.overflowWrap(), Q = b(O, !0, !1), N = isFinite(L()) ? Math.floor(L() / O.height) : 1 / 0;
1595
- if (!L() && !M(0) || !N)
1170
+ var O = S.height(), I = S.width(), L = S.overflowLine(), B = S.overflowWrap(), J = b(M, !0, !1), z = isFinite(O()) ? Math.floor(O() / M.height) : 1 / 0;
1171
+ if (!O() && !I(0) || !z)
1596
1172
  return [];
1597
- for (var C = 0, F = 0, R = 0, tt = [], G = [], q = !1; C < E.length && F < N; ) {
1598
- var D = E[C], it = gn(D, O);
1599
- if (D.width = X(D, it), D.font = it, D.line = F, D.whitespace = D.value in I, D.value && (D.value = D.value.replace(pn, " ")), !(!R && D.whitespace || q && D.whitespace))
1600
- if (D instanceof nt)
1601
- R = 0, G = [], tt.push(C + 1), F++;
1602
- else if (D instanceof Tt || D instanceof pt)
1603
- G.push({ index: C, width: R });
1604
- else if (D.whitespace || R + D.width < M(F))
1605
- R += D.width;
1606
- else if (G.length) {
1607
- var et = void 0, at = void 0;
1173
+ for (var P = 0, j = 0, H = 0, Q = [], Y = [], q = !1; P < k.length && j < z; ) {
1174
+ var D = k[P], nt = An(D, M);
1175
+ if (D.width = G(D, nt), D.font = nt, D.line = j, D.whitespace = D.value in C, D.value && (D.value = D.value.replace(bn, " ")), !(!H && D.whitespace || q && D.whitespace))
1176
+ if (D instanceof et)
1177
+ H = 0, Y = [], Q.push(P + 1), j++;
1178
+ else if (D instanceof Dt || D instanceof gt)
1179
+ Y.push({ index: P, width: H });
1180
+ else if (D.whitespace || H + D.width < I(j))
1181
+ H += D.width;
1182
+ else if (Y.length) {
1183
+ var tt = void 0, at = void 0;
1608
1184
  do {
1609
- at = !0, et = G.pop();
1610
- var dt = E[et.index], st = void 0;
1611
- dt instanceof pt && (st = X("-", dt.font), et.width + st > M(F) && (at = !G.length));
1185
+ at = !0, tt = Y.pop();
1186
+ var dt = k[tt.index], ot = void 0;
1187
+ dt instanceof gt && (ot = G("-", dt.font), tt.width + ot > I(j) && (at = !Y.length));
1612
1188
  } while (!at);
1613
- tt.push(et.index + 1), R = 0, F++, C = et.index, G = [];
1614
- } else if (j === "break-word") {
1615
- var lt = M(F);
1616
- if (R + D.width > lt) {
1617
- var xt = D.clone();
1189
+ Q.push(tt.index + 1), H = 0, j++, P = tt.index, Y = [];
1190
+ } else if (B === "break-word") {
1191
+ var lt = I(j);
1192
+ if (H + D.width > lt) {
1193
+ var wt = D.clone();
1618
1194
  do
1619
- D.value = D.value.slice(0, -1), D.width = X(D, D.font), R += D.width;
1195
+ D.value = D.value.slice(0, -1), D.width = G(D, D.font), H += D.width;
1620
1196
  while (D.value && D.width > lt);
1621
- xt.value = xt.value.slice(D.value.length), E.splice(C + 1, 0, new Tt(), xt);
1197
+ wt.value = wt.value.slice(D.value.length), k.splice(P + 1, 0, new Dt(), wt);
1622
1198
  }
1623
- tt.push(C + 1), R = 0, F++;
1199
+ Q.push(P + 1), H = 0, j++;
1624
1200
  } else
1625
- R += D.width;
1626
- C++, q = D.whitespace;
1201
+ H += D.width;
1202
+ P++, q = D.whitespace;
1627
1203
  }
1628
- C !== tt[tt.length - 1] && tt.push(C);
1629
- var Mt = 0, ht = 0, Z = tt.map(function(gt) {
1630
- for (var J, yt = Mt; (J = E[yt]) && (J.whitespace || !J.value); )
1631
- yt++;
1632
- for (var ft = gt, ne = null; ft > yt && (J = E[ft - 1]) && (J.whitespace || !(J.value || J instanceof pt)); )
1633
- J instanceof nt && (ne = J), ft--;
1634
- J instanceof pt && (J.value = "-", J.width = X("-", J.font)), Mt = gt;
1635
- var wt = E.slice(yt, ft).filter(function(ie) {
1636
- return ie.value;
1204
+ P !== Q[Q.length - 1] && Q.push(P);
1205
+ var Lt = 0, ht = 0, X = Q.map(function(yt) {
1206
+ for (var K, mt = Lt; (K = k[mt]) && (K.whitespace || !K.value); )
1207
+ mt++;
1208
+ for (var ft = yt, oe = null; ft > mt && (K = k[ft - 1]) && (K.whitespace || !(K.value || K instanceof gt)); )
1209
+ K instanceof et && (oe = K), ft--;
1210
+ K instanceof gt && (K.value = "-", K.width = G("-", K.font)), Lt = yt;
1211
+ var bt = k.slice(mt, ft).filter(function(ae) {
1212
+ return ae.value;
1637
1213
  });
1638
- return ne && wt.push(ne), wt.width = wt.reduce(function(ie, _n) {
1639
- return ie + _n.width;
1640
- }, 0), wt.width > ht && (ht = wt.width), wt;
1214
+ return oe && bt.push(oe), bt.width = bt.reduce(function(ae, Pn) {
1215
+ return ae + Pn.width;
1216
+ }, 0), bt.width > ht && (ht = bt.width), bt;
1641
1217
  });
1642
- if (Z.hasLineOverflow = !1, z) {
1643
- var Rt = z === "ellipsis" ? "…" : z;
1644
- Z.forEach(function(gt, J) {
1645
- var yt = M(J);
1646
- if (gt.width > yt) {
1647
- var ft = new H(Rt);
1648
- ft.font = O, ft.width = X(Rt, Q), we(gt, yt, ft), Z.hasLineOverflow = !0;
1218
+ if (X.hasLineOverflow = !1, L) {
1219
+ var jt = L === "ellipsis" ? "…" : L;
1220
+ X.forEach(function(yt, K) {
1221
+ var mt = I(K);
1222
+ if (yt.width > mt) {
1223
+ var ft = new F(jt);
1224
+ ft.font = M, ft.width = G(jt, J), Ee(yt, mt, ft), X.hasLineOverflow = !0;
1649
1225
  }
1650
1226
  });
1651
1227
  }
1652
- var B = k.overflow() === "ellipsis" ? "…" : k.overflow();
1653
- if (B && C !== E.length) {
1654
- var K = M(Z.length - 1), Ht = Z[Z.length - 1], Dt = new H(B);
1655
- Dt.font = O, Dt.width = X(B, Q), we(Ht, K, Dt), Z.hasOverflow = !0;
1228
+ var R = S.overflow() === "ellipsis" ? "…" : S.overflow();
1229
+ if (R && P !== k.length) {
1230
+ var Z = I(X.length - 1), qt = X[X.length - 1], Ct = new F(R);
1231
+ Ct.font = M, Ct.width = G(R, J), Ee(qt, Z, Ct), X.hasOverflow = !0;
1656
1232
  } else
1657
- Z.hasOverflow = !1;
1658
- return Z.font = O, Z.width = ht, Z;
1659
- }(y, this, w);
1660
- return x.height = x.length * w.height, x.render = function(E) {
1661
- return c.render(x, E);
1233
+ X.hasOverflow = !1;
1234
+ return X.font = M, X.width = ht, X;
1235
+ }(p, this, w);
1236
+ return x.height = x.length * w.height, x.render = function(k) {
1237
+ return c.render(x, k);
1662
1238
  }, x.svg = x.render, x.draw = x.render, x;
1663
1239
  } }, { key: "font", value: function(i) {
1664
- return arguments.length ? (this.props.font = b(i), this) : this.props.font || b(An);
1240
+ return arguments.length ? (this.props.font = b(i), this) : this.props.font || b(Dn);
1665
1241
  } }, { key: "overflow", value: function(i) {
1666
1242
  return arguments.length ? (this.props.overflow = String(i), this) : this.props.overflow;
1667
1243
  } }, { key: "overflowLine", value: function(i) {
@@ -1679,11 +1255,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1679
1255
  var c = String(i).toLowerCase();
1680
1256
  return c === "break-word" ? this.props.overflowWrap = "break-word" : c !== "normal" && i != null || (this.props.overflowWrap = null), this;
1681
1257
  } }, { key: "width", value: function(i) {
1682
- return arguments.length ? (this.props.width = Qt(i), this) : this.props.width;
1258
+ return arguments.length ? (this.props.width = ie(i), this) : this.props.width;
1683
1259
  } }, { key: "height", value: function(i) {
1684
- return arguments.length ? (this.props.height = Qt(i), this) : this.props.height;
1260
+ return arguments.length ? (this.props.height = ie(i), this) : this.props.height;
1685
1261
  } }, { key: "x", value: function(i) {
1686
- return arguments.length ? (this.props.x = Qt(i), this) : this.props.x;
1262
+ return arguments.length ? (this.props.x = ie(i), this) : this.props.x;
1687
1263
  } }, { key: "parser", value: function(i) {
1688
1264
  if (!arguments.length)
1689
1265
  return this.props.parser;
@@ -1697,49 +1273,49 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1697
1273
  } }, { key: "createElement", value: function(i) {
1698
1274
  return arguments.length ? (this.props.createElement = i, this) : this.props.createElement || e.createElement;
1699
1275
  } }, { key: "render", value: function() {
1700
- var i = Ae(arguments);
1701
- return typeof i.text == "string" && (i.text = this.linebreak(i.text)), i.ctx ? wn(i.text, this, i.ctx) : vn(i.text, this);
1702
- } }], o && bn(n.prototype, o), Object.defineProperty(n, "prototype", { writable: !1 }), e;
1276
+ var i = Se(arguments);
1277
+ return typeof i.text == "string" && (i.text = this.linebreak(i.text)), i.ctx ? _n(i.text, this, i.ctx) : Sn(i.text, this);
1278
+ } }], s && In(n.prototype, s), Object.defineProperty(n, "prototype", { writable: !1 }), e;
1703
1279
  }();
1704
- function It(e) {
1705
- return It = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
1280
+ function Ot(e) {
1281
+ return Ot = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
1706
1282
  return typeof n;
1707
1283
  } : function(n) {
1708
1284
  return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
1709
- }, It(e);
1285
+ }, Ot(e);
1710
1286
  }
1711
- function te(e, n) {
1287
+ function re(e, n) {
1712
1288
  (n == null || n > e.length) && (n = e.length);
1713
- for (var o = 0, i = new Array(n); o < n; o++)
1714
- i[o] = e[o];
1289
+ for (var s = 0, i = new Array(n); s < n; s++)
1290
+ i[s] = e[s];
1715
1291
  return i;
1716
1292
  }
1717
- function Sn(e, n) {
1718
- for (var o = 0; o < n.length; o++) {
1719
- var i = n[o];
1720
- i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, (c = function(y, w) {
1721
- if (It(y) !== "object" || y === null)
1722
- return y;
1723
- var x = y[Symbol.toPrimitive];
1293
+ function Mn(e, n) {
1294
+ for (var s = 0; s < n.length; s++) {
1295
+ var i = n[s];
1296
+ i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, (c = function(p, w) {
1297
+ if (Ot(p) !== "object" || p === null)
1298
+ return p;
1299
+ var x = p[Symbol.toPrimitive];
1724
1300
  if (x !== void 0) {
1725
- var E = x.call(y, w);
1726
- if (It(E) !== "object")
1727
- return E;
1301
+ var k = x.call(p, w);
1302
+ if (Ot(k) !== "object")
1303
+ return k;
1728
1304
  throw new TypeError("@@toPrimitive must return a primitive value.");
1729
1305
  }
1730
- return String(y);
1731
- }(i.key, "string"), It(c) === "symbol" ? c : String(c)), i);
1306
+ return String(p);
1307
+ }(i.key, "string"), Ot(c) === "symbol" ? c : String(c)), i);
1732
1308
  }
1733
1309
  var c;
1734
1310
  }
1735
- var Se = function(e) {
1311
+ var Te = function(e) {
1736
1312
  return typeof e == "function" ? e : function() {
1737
1313
  return e;
1738
1314
  };
1739
- }, Ee = function() {
1315
+ }, _e = function() {
1740
1316
  function e(i) {
1741
- if (function(y, w) {
1742
- if (!(y instanceof w))
1317
+ if (function(p, w) {
1318
+ if (!(p instanceof w))
1743
1319
  throw new TypeError("Cannot call a class as a function");
1744
1320
  }(this, e), this.props = { width: function() {
1745
1321
  return 1 / 0;
@@ -1750,47 +1326,47 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1750
1326
  typeof this[c] == "function" && this[c](i[c]);
1751
1327
  this.render = this.render.bind(this);
1752
1328
  }
1753
- var n, o;
1754
- return n = e, o = [{ key: "anchor", value: function(i) {
1755
- var c = this.props, y = c.hAnchor, w = c.vAnchor, x = c.width, E = c.height;
1329
+ var n, s;
1330
+ return n = e, s = [{ key: "anchor", value: function(i) {
1331
+ var c = this.props, p = c.hAnchor, w = c.vAnchor, x = c.width, k = c.height;
1756
1332
  if (!arguments.length)
1757
- return [y * x(0), w * E(0)];
1333
+ return [p * x(0), w * k(0)];
1758
1334
  if (typeof i == "string") {
1759
- var k = this.props;
1760
- i.toLowerCase().trim().split(/\s+/).forEach(function(O) {
1761
- O === "top" && (k.vAnchor = -0), O === "middle" && (k.vAnchor = -0.5), O === "bottom" && (k.vAnchor = -1), O === "left" && (k.hAnchor = -0), O === "center" && (k.hAnchor = -0.5), O === "right" && (k.hAnchor = -1);
1335
+ var S = this.props;
1336
+ i.toLowerCase().trim().split(/\s+/).forEach(function(M) {
1337
+ M === "top" && (S.vAnchor = -0), M === "middle" && (S.vAnchor = -0.5), M === "bottom" && (S.vAnchor = -1), M === "left" && (S.hAnchor = -0), M === "center" && (S.hAnchor = -0.5), M === "right" && (S.hAnchor = -1);
1762
1338
  });
1763
1339
  }
1764
1340
  return this;
1765
1341
  } }, { key: "width", value: function(i) {
1766
- return arguments.length ? (this.props.width = Se(i), this) : this.props.width;
1342
+ return arguments.length ? (this.props.width = Te(i), this) : this.props.width;
1767
1343
  } }, { key: "height", value: function(i) {
1768
- return arguments.length ? (this.props.height = Se(i), this) : this.props.height;
1344
+ return arguments.length ? (this.props.height = Te(i), this) : this.props.height;
1769
1345
  } }, { key: "rotate", value: function(i) {
1770
1346
  return arguments.length ? (this.props.rotation = i, this) : this.props.rotation;
1771
1347
  } }, { key: "createElement", value: function(i) {
1772
1348
  return arguments.length ? (this.props.createElement = i, this) : this.props.createElement || e.createElement;
1773
1349
  } }, { key: "canvas", value: function(i, c) {
1774
- var y, w = i.getContext ? i.getContext("2d") : i;
1350
+ var p, w = i.getContext ? i.getContext("2d") : i;
1775
1351
  return w.save(), w.rotate(this.rotate() * Math.PI / 180), w.translate.apply(w, function(x) {
1776
1352
  if (Array.isArray(x))
1777
- return te(x);
1778
- }(y = this.anchor()) || function(x) {
1353
+ return re(x);
1354
+ }(p = this.anchor()) || function(x) {
1779
1355
  if (typeof Symbol < "u" && x[Symbol.iterator] != null || x["@@iterator"] != null)
1780
1356
  return Array.from(x);
1781
- }(y) || function(x, E) {
1357
+ }(p) || function(x, k) {
1782
1358
  if (x) {
1783
1359
  if (typeof x == "string")
1784
- return te(x, E);
1785
- var k = Object.prototype.toString.call(x).slice(8, -1);
1786
- return k === "Object" && x.constructor && (k = x.constructor.name), k === "Map" || k === "Set" ? Array.from(x) : k === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(k) ? te(x, E) : void 0;
1360
+ return re(x, k);
1361
+ var S = Object.prototype.toString.call(x).slice(8, -1);
1362
+ return S === "Object" && x.constructor && (S = x.constructor.name), S === "Map" || S === "Set" ? Array.from(x) : S === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(S) ? re(x, k) : void 0;
1787
1363
  }
1788
- }(y) || function() {
1364
+ }(p) || function() {
1789
1365
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
1790
1366
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
1791
1367
  }()), c(w), w.restore(), w;
1792
1368
  } }, { key: "render", value: function() {
1793
- var i = Ae(arguments);
1369
+ var i = Se(arguments);
1794
1370
  if (i.d3)
1795
1371
  return i.d3.attr("transform", "rotate(".concat(this.rotate(), ") translate(").concat(this.anchor(), ")"));
1796
1372
  if (i.ctx)
@@ -1799,207 +1375,207 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1799
1375
  var c = typeof i.text.render == "function" ? i.text.render() : i.text;
1800
1376
  return this.createElement()("g", { transform: "rotate(".concat(this.rotate(), ") translate(").concat(this.anchor(), ")") }, c);
1801
1377
  }
1802
- } }], o && Sn(n.prototype, o), Object.defineProperty(n, "prototype", { writable: !1 }), e;
1803
- }(), En = Object.prototype.hasOwnProperty, ee = {};
1804
- function kn(e) {
1805
- return ee[e] || (ee[e] = e.replace(/([a-z])([A-Z])/g, function(n, o, i) {
1806
- return o + "-" + i.toLowerCase();
1807
- })), ee[e];
1378
+ } }], s && Mn(n.prototype, s), Object.defineProperty(n, "prototype", { writable: !1 }), e;
1379
+ }(), On = Object.prototype.hasOwnProperty, se = {};
1380
+ function Ln(e) {
1381
+ return se[e] || (se[e] = e.replace(/([a-z])([A-Z])/g, function(n, s, i) {
1382
+ return s + "-" + i.toLowerCase();
1383
+ })), se[e];
1808
1384
  }
1809
- function ke(e, n) {
1385
+ function Ie(e, n) {
1810
1386
  if (Array.isArray(n))
1811
- return n.forEach(function(o) {
1812
- return ke(e, o);
1387
+ return n.forEach(function(s) {
1388
+ return Ie(e, s);
1813
1389
  });
1814
1390
  typeof n == "string" && (n = document.createTextNode(n)), e.appendChild(n);
1815
1391
  }
1816
- function Te(e, n) {
1392
+ function De(e, n) {
1817
1393
  if (typeof document < "u") {
1818
- var o = typeof e == "string" ? document.createElementNS("http://www.w3.org/2000/svg", e) : e;
1819
- if (n && o.setAttribute)
1394
+ var s = typeof e == "string" ? document.createElementNS("http://www.w3.org/2000/svg", e) : e;
1395
+ if (n && s.setAttribute)
1820
1396
  for (var i in n)
1821
- En.call(n, i) && n[i] != null && o.setAttribute(i === "className" ? "class" : kn(i), n[i]);
1822
- for (var c = arguments.length, y = new Array(c > 2 ? c - 2 : 0), w = 2; w < c; w++)
1823
- y[w - 2] = arguments[w];
1824
- return y != null && y.length && y.forEach(function(x) {
1825
- ke(o, x);
1826
- }), o;
1397
+ On.call(n, i) && n[i] != null && s.setAttribute(i === "className" ? "class" : Ln(i), n[i]);
1398
+ for (var c = arguments.length, p = new Array(c > 2 ? c - 2 : 0), w = 2; w < c; w++)
1399
+ p[w - 2] = arguments[w];
1400
+ return p != null && p.length && p.forEach(function(x) {
1401
+ Ie(s, x);
1402
+ }), s;
1827
1403
  }
1828
1404
  }
1829
- rt.createElement = Te, rt.textparser = Nt, rt.defaultparser = Nt, rt.htmlparser = function(e) {
1405
+ it.createElement = De, it.textparser = Bt, it.defaultparser = Bt, it.htmlparser = function(e) {
1830
1406
  e = String(e || "").trim();
1831
- for (var n, o, i = { weight: null, style: null, sub: !1, sup: !1, href: null, color: null, rel: null, target: null }, c = [], y = [], w = function(L) {
1832
- for (var M in i)
1833
- i[M] && (L[M] = i[M]);
1834
- c.push(L);
1835
- }, x = function(L) {
1836
- var M = c.length, z = rn[L];
1837
- if (M && z) {
1838
- for (var j = M - 1; c[j] && (c[j] instanceof Tt || Je.test(c[j].value)); )
1839
- j--;
1840
- for (; z && c[j] && c[j] instanceof nt; )
1841
- j--, z--;
1842
- for (; z-- > 0; )
1843
- c.push(new nt());
1407
+ for (var n, s, i = { weight: null, style: null, sub: !1, sup: !1, href: null, color: null, rel: null, target: null }, c = [], p = [], w = function(O) {
1408
+ for (var I in i)
1409
+ i[I] && (O[I] = i[I]);
1410
+ c.push(O);
1411
+ }, x = function(O) {
1412
+ var I = c.length, L = un[O];
1413
+ if (I && L) {
1414
+ for (var B = I - 1; c[B] && (c[B] instanceof Dt || on.test(c[B].value)); )
1415
+ B--;
1416
+ for (; L && c[B] && c[B] instanceof et; )
1417
+ B--, L--;
1418
+ for (; L-- > 0; )
1419
+ c.push(new et());
1844
1420
  }
1845
1421
  }; e.length; ) {
1846
1422
  if (n = /^[^<]+/.exec(e))
1847
- Nt(ve(n[0]), !1).forEach(w);
1848
- else if (!(n = en.exec(e)))
1849
- if (n = Qe.exec(e))
1850
- y.length && (i = y.pop()), x(n[1]);
1851
- else if (n = tn.exec(e)) {
1852
- var E = n[1];
1853
- x(E), y.push(i), i = Object.create(i), me[E] && me[E](i, "");
1854
- var k = an(n[2]);
1855
- E === "a" && (k.href && (i.href = k.href), k.rel && (i.rel = k.rel), k.target && (i.target = k.target)), k.class && (i.class = i.class ? i.class + " " + k.class : k.class), k.style && (o = /(?:^|\s|;)color\s*:\s*([^;\s"']+)/.exec(k.style)) && o[1] && (i.color = o[1]), E === "br" && c.push(new nt());
1423
+ Bt(be(n[0]), !1).forEach(w);
1424
+ else if (!(n = hn.exec(e)))
1425
+ if (n = an.exec(e))
1426
+ p.length && (i = p.pop()), x(n[1]);
1427
+ else if (n = ln.exec(e)) {
1428
+ var k = n[1];
1429
+ x(k), p.push(i), i = Object.create(i), we[k] && we[k](i, "");
1430
+ var S = pn(n[2]);
1431
+ k === "a" && (S.href && (i.href = S.href), S.rel && (i.rel = S.rel), S.target && (i.target = S.target)), S.class && (i.class = i.class ? i.class + " " + S.class : S.class), S.style && (s = /(?:^|\s|;)color\s*:\s*([^;\s"']+)/.exec(S.style)) && s[1] && (i.color = s[1]), k === "br" && c.push(new et());
1856
1432
  } else
1857
- n = [e.slice(0, 1)], w(new H(n[0]));
1433
+ n = [e.slice(0, 1)], w(new F(n[0]));
1858
1434
  e = e.slice(n[0].length);
1859
1435
  }
1860
- for (var O = c[c.length - 1]; O instanceof nt; )
1861
- c.pop(), O = c[c.length - 1];
1436
+ for (var M = c[c.length - 1]; M instanceof et; )
1437
+ c.pop(), M = c[c.length - 1];
1862
1438
  return c;
1863
- }, rt.latexparser = function(e) {
1439
+ }, it.latexparser = function(e) {
1864
1440
  e = String(e || "").trim();
1865
1441
  var n = [0];
1866
- e = e.replace(/\\verb,(.*?),/, function(N, C) {
1867
- return n.push(C), "\\verb," + (n.length - 1) + ",";
1442
+ e = e.replace(/\\verb,(.*?),/, function(z, P) {
1443
+ return n.push(P), "\\verb," + (n.length - 1) + ",";
1868
1444
  }).replace(/\\\\\n/g, function() {
1869
1445
  return "\\\\";
1870
- }).replace(dn, function(N, C, F) {
1871
- return F.charAt(C - 1) === "\\" ? N : fn[N];
1872
- }).replace(/\n\s+/g, function(N) {
1873
- return /\n/.test(N.slice(1)) ? "\\par " : N;
1874
- }).replace(/\\symbol\{(\d+)\}/, function(N, C, F, R) {
1875
- return R.charAt(F - 1) === "\\" ? N : String.fromCharCode(1 * C);
1876
- }).replace(/(^|[^\\])(\^|_)(\d|[^{]\S*)/g, function(N, C, F, R) {
1877
- return C + F + "{" + R + "}";
1878
- }).replace(/\\verb,(.*?),/, function(N, C) {
1879
- return "\\verb,".concat(n[+C], ",");
1446
+ }).replace(xn, function(z, P, j) {
1447
+ return j.charAt(P - 1) === "\\" ? z : wn[z];
1448
+ }).replace(/\n\s+/g, function(z) {
1449
+ return /\n/.test(z.slice(1)) ? "\\par " : z;
1450
+ }).replace(/\\symbol\{(\d+)\}/, function(z, P, j, H) {
1451
+ return H.charAt(j - 1) === "\\" ? z : String.fromCharCode(1 * P);
1452
+ }).replace(/(^|[^\\])(\^|_)(\d|[^{]\S*)/g, function(z, P, j, H) {
1453
+ return P + j + "{" + H + "}";
1454
+ }).replace(/\\verb,(.*?),/, function(z, P) {
1455
+ return "\\verb,".concat(n[+P], ",");
1880
1456
  });
1881
- for (var o, i = { weight: null, italic: null, variant: null, sub: !1, sup: !1, href: null }, c = [], y = [], w = function(N) {
1882
- for (var C in i)
1883
- i[C] && (N[C] = i[C]);
1884
- return c.push(N), N;
1457
+ for (var s, i = { weight: null, italic: null, variant: null, sub: !1, sup: !1, href: null }, c = [], p = [], w = function(z) {
1458
+ for (var P in i)
1459
+ i[P] && (z[P] = i[P]);
1460
+ return c.push(z), z;
1885
1461
  }, x = function() {
1886
- y.push(i), i = Object.create(i);
1887
- }, E = function() {
1888
- if (!y.length)
1462
+ p.push(i), i = Object.create(i);
1463
+ }, k = function() {
1464
+ if (!p.length)
1889
1465
  throw new Error("Unexpected }");
1890
- i = y.pop();
1891
- }, k = { tokens: c, open_context: x, close_context: E, add_token: w }; e.length; ) {
1892
- if (o = cn.exec(e))
1893
- Nt(o[0], !1).forEach(w);
1894
- else if (o = un.exec(e))
1895
- w(new H(o[1]));
1896
- else if (!(o = hn.exec(e))) {
1897
- if (o = /^\{/.exec(e))
1466
+ i = p.pop();
1467
+ }, S = { tokens: c, open_context: x, close_context: k, add_token: w }; e.length; ) {
1468
+ if (s = mn.exec(e))
1469
+ Bt(s[0], !1).forEach(w);
1470
+ else if (s = vn.exec(e))
1471
+ w(new F(s[1]));
1472
+ else if (!(s = yn.exec(e))) {
1473
+ if (s = /^\{/.exec(e))
1898
1474
  x();
1899
- else if (o = /^\}/.exec(e))
1900
- E();
1901
- else if (!(o = /^\$/.exec(e)))
1902
- if (o = /^\\verb,([^,]+),/.exec(e))
1903
- w(new H(o[1]));
1904
- else if (o = ln.exec(e)) {
1905
- var O = o[1].slice(1) || o[1], L = !!o[2];
1906
- if (/^(La)?TeX$/i.test(O)) {
1475
+ else if (s = /^\}/.exec(e))
1476
+ k();
1477
+ else if (!(s = /^\$/.exec(e)))
1478
+ if (s = /^\\verb,([^,]+),/.exec(e))
1479
+ w(new F(s[1]));
1480
+ else if (s = gn.exec(e)) {
1481
+ var M = s[1].slice(1) || s[1], O = !!s[2];
1482
+ if (/^(La)?TeX$/i.test(M)) {
1907
1483
  x(), i.family = "serif";
1908
- var M = void 0;
1909
- O === "LaTeX" && ((M = w(new H("L"))).tracking = -0.25, (M = w(new H("A"))).size = 0.7, M.baseline = 0.3, M.tracking = -0.1), (M = w(new H("T"))).tracking = -0.17, (M = w(new H("E"))).baseline = -0.22, M.tracking = -0.13, M = w(new H("X")), E();
1910
- } else if (O in xe)
1911
- w(new H(xe[O])), L && x();
1912
- else if (O in U) {
1913
- var z = [], j = U[O].length - 1, Q = void 0;
1914
- if (j) {
1915
- for (L = !1, e = e.slice(o[0].length - 1); j--; ) {
1916
- if (!(Q = /^\{([^}]+)\}/.exec(e)))
1917
- throw new Error(O + " is missing an argument");
1918
- z.push(Q[1]), e = e.slice(Q[0].length);
1484
+ var I = void 0;
1485
+ M === "LaTeX" && ((I = w(new F("L"))).tracking = -0.25, (I = w(new F("A"))).size = 0.7, I.baseline = 0.3, I.tracking = -0.1), (I = w(new F("T"))).tracking = -0.17, (I = w(new F("E"))).baseline = -0.22, I.tracking = -0.13, I = w(new F("X")), k();
1486
+ } else if (M in Ae)
1487
+ w(new F(Ae[M])), O && x();
1488
+ else if (M in U) {
1489
+ var L = [], B = U[M].length - 1, J = void 0;
1490
+ if (B) {
1491
+ for (O = !1, e = e.slice(s[0].length - 1); B--; ) {
1492
+ if (!(J = /^\{([^}]+)\}/.exec(e)))
1493
+ throw new Error(M + " is missing an argument");
1494
+ L.push(J[1]), e = e.slice(J[0].length);
1919
1495
  }
1920
- o[0] = /^\{/.exec(e) ? "{" : "", L = !!o[0];
1496
+ s[0] = /^\{/.exec(e) ? "{" : "", O = !!s[0];
1921
1497
  }
1922
- L && x(), U[O].apply(k, [i].concat(z));
1498
+ O && x(), U[M].apply(S, [i].concat(L));
1923
1499
  } else
1924
- console.warn("unknown latex command", O), w(new H(o[1])), L && x();
1500
+ console.warn("unknown latex command", M), w(new F(s[1])), O && x();
1925
1501
  } else
1926
- o = [e.slice(0, 1)], w(new H(o[0]));
1502
+ s = [e.slice(0, 1)], w(new F(s[0]));
1927
1503
  }
1928
- e = e.slice(o[0].length);
1504
+ e = e.slice(s[0].length);
1929
1505
  }
1930
1506
  return c;
1931
- }, rt.measureText = function(e, n, o) {
1932
- return X(e, b(n), o);
1933
- }, rt.Token = H, rt.Break = Tt, rt.LineBreak = nt, rt.SoftHyphen = pt, rt.Rotator = Ee, Ee.createElement = Te;
1934
- const Tn = rt;
1507
+ }, it.measureText = function(e, n, s) {
1508
+ return G(e, b(n), s);
1509
+ }, it.Token = F, it.Break = Dt, it.LineBreak = et, it.SoftHyphen = gt, it.Rotator = _e, _e.createElement = De;
1510
+ const Cn = it;
1935
1511
  return r.default;
1936
1512
  })());
1937
- })(Xe);
1938
- var Vn = Xe.exports;
1939
- const ze = /* @__PURE__ */ fe(Vn);
1940
- function se(u) {
1941
- return u.replace(/…$/, "");
1513
+ })(tn);
1514
+ var Qn = tn.exports;
1515
+ const Ne = /* @__PURE__ */ Ze(Qn);
1516
+ function he(a) {
1517
+ return a.replace(/…$/, "");
1942
1518
  }
1943
- function oe(u) {
1944
- return u.children[0].innerHTML;
1519
+ function ce(a) {
1520
+ return a.children[0].innerHTML;
1945
1521
  }
1946
- function Un(u, l) {
1947
- const t = ut(u), { fontSize: r, font: a, padding: h = 0 } = u.properties.style || {};
1522
+ function ti(a, h) {
1523
+ const t = ut(a), { fontSize: r, font: o, padding: l = 0 } = a.properties.style || {};
1948
1524
  if (t.width === t.height && t.width === 0)
1949
1525
  return;
1950
- const f = new ze({
1951
- font: `${r}px/${r}px ${a}`.replace(/(px)+/g, "px"),
1952
- width: t.width - h * 2,
1953
- height: t.height - h * 2,
1526
+ const u = new Ne({
1527
+ font: `${r}px/${r}px ${o}`.replace(/(px)+/g, "px"),
1528
+ width: t.width - l * 2,
1529
+ height: t.height - l * 2,
1954
1530
  align: "left",
1955
1531
  valign: "top",
1956
1532
  x: 0,
1957
1533
  overflow: "ellipsis",
1958
1534
  parser: "html",
1959
- createElement: ze.createElement
1535
+ createElement: Ne.createElement
1960
1536
  });
1961
- f.overflowWrap("break-word");
1962
- const p = f.linebreak(
1963
- u.properties.content.replaceAll(`
1537
+ u.overflowWrap("break-word");
1538
+ const g = u.linebreak(
1539
+ a.properties.content.replaceAll(`
1964
1540
  `, "<br>")
1965
- ).render(), s = [...p.children];
1966
- let d = 0;
1967
- const m = [];
1968
- u.properties.content.split(`
1541
+ ).render(), f = [...g.children];
1542
+ let y = 0;
1543
+ const v = [];
1544
+ a.properties.content.split(`
1969
1545
  `).forEach((b) => {
1970
- let I = b;
1971
- for (; I.length && d < s.length; ) {
1972
- if (s[d].innerHTML === "&nbsp;") {
1973
- I.startsWith(`
1974
- `) || m.push(d), d++;
1546
+ let C = b;
1547
+ for (; C.length && y < f.length; ) {
1548
+ if (f[y].innerHTML === "&nbsp;") {
1549
+ C.startsWith(`
1550
+ `) || v.push(y), y++;
1975
1551
  break;
1976
1552
  }
1977
- const S = se(oe(s[d]));
1978
- I.startsWith(S) && (I = I.slice(S.length).trim()), d++;
1553
+ const E = he(ce(f[y]));
1554
+ C.startsWith(E) && (C = C.slice(E.length).trim()), y++;
1979
1555
  }
1980
- }), m.forEach((b) => p.removeChild(s[b]));
1981
- const A = u.properties.content.match(/(https?:\/\/.*)/gm), T = A ? A.map((b) => b.split(" ")[0]) : [];
1982
- p.setAttribute("transform", `translate(${h}, ${h})`), T.forEach((b) => {
1983
- let I = b;
1984
- const S = [];
1985
- for (; I.length > 0; ) {
1986
- const P = s.find((_) => !!_.children[0] && _.children[0].tagName === "tspan" && I.startsWith(se(oe(_))));
1987
- if (!P)
1988
- break;
1989
- S.push(P);
1990
- const $ = se(P.children[0].innerHTML).length;
1556
+ }), v.forEach((b) => g.removeChild(f[b]));
1557
+ const T = a.properties.content.match(/(https?:\/\/.*)/gm), A = T ? T.map((b) => b.split(" ")[0]) : [];
1558
+ g.setAttribute("transform", `translate(${l}, ${l})`), A.forEach((b) => {
1559
+ let C = b;
1560
+ const E = [];
1561
+ for (; C.length > 0; ) {
1562
+ const $ = f.find((_) => !!_.children[0] && _.children[0].tagName === "tspan" && C.startsWith(he(ce(_))));
1991
1563
  if (!$)
1992
1564
  break;
1993
- I = I.slice($);
1565
+ E.push($);
1566
+ const N = he($.children[0].innerHTML).length;
1567
+ if (!N)
1568
+ break;
1569
+ C = C.slice(N);
1994
1570
  }
1995
- S.forEach((P) => {
1996
- const $ = document.createElementNS("http://www.w3.org/2000/svg", "a");
1997
- $.setAttribute("href", b), $.setAttribute("target", "_blank"), $.innerHTML = oe(P), P.children[0].innerHTML = "", P.children[0].appendChild($);
1571
+ E.forEach(($) => {
1572
+ const N = document.createElementNS("http://www.w3.org/2000/svg", "a");
1573
+ N.setAttribute("href", b), N.setAttribute("target", "_blank"), N.innerHTML = ce($), $.children[0].innerHTML = "", $.children[0].appendChild(N);
1998
1574
  });
1999
- }), l.appendChild(p);
1575
+ }), h.appendChild(g);
2000
1576
  }
2001
- const Ce = 20;
2002
- class Yn extends Ye {
1577
+ const He = 20;
1578
+ class ei extends Qe {
2003
1579
  constructor(t, r = {}) {
2004
1580
  super(
2005
1581
  t,
@@ -2017,152 +1593,148 @@ class Yn extends Ye {
2017
1593
  </div>
2018
1594
  `
2019
1595
  );
2020
- v(this, "textArea");
2021
- v(this, "handleSize");
2022
- v(this, "rect", { x: 0, y: 0, width: 0, height: 0 });
2023
- v(this, "annotation", { ...re });
2024
- v(this, "startX", 0);
2025
- v(this, "startY", 0);
2026
- v(this, "handles", []);
2027
- v(this, "draggedHandle", V);
2028
- v(this, "isFocused", !1);
2029
- v(this, "placeholder", "Type your text here...");
2030
- v(this, "_onFocus", () => {
1596
+ m(this, "textArea");
1597
+ m(this, "handleSize");
1598
+ m(this, "rect", { x: 0, y: 0, width: 0, height: 0 });
1599
+ m(this, "annotation", { ...le });
1600
+ m(this, "startX", 0);
1601
+ m(this, "startY", 0);
1602
+ m(this, "handles", []);
1603
+ m(this, "draggedHandle", V);
1604
+ m(this, "isFocused", !1);
1605
+ m(this, "placeholder", "Type your text here...");
1606
+ m(this, "_onFocus", () => {
2031
1607
  this.textArea.value === this.placeholder && (this.textArea.value = ""), this.isFocused = !0;
2032
1608
  });
2033
- v(this, "_onBlur", () => {
1609
+ m(this, "_onBlur", () => {
2034
1610
  this.isFocused = !1;
2035
1611
  });
2036
- v(this, "startDrawing", (t, r, a = Bn(t, r, 0, 0, "", At)) => {
2037
- this.add(a);
2038
- const h = this.ogma.view.graphToScreenCoordinates({ x: t, y: r });
2039
- this.select(a.id), this.startDragging(this.getById(a.id), h.x, h.y), this.draggedHandle = 6;
1612
+ m(this, "startDrawing", (t, r, o = Jn(t, r, 0, 0, "", St)) => {
1613
+ this.add(o);
1614
+ const l = this.ogma.view.graphToScreenCoordinates({ x: t, y: r });
1615
+ this.select(o.id), this.startDragging(this.getById(o.id), l.x, l.y), this.draggedHandle = 6;
2040
1616
  });
2041
- v(this, "cancelDrawing", () => {
2042
- this.isDragging && (this.remove(this.annotation.id), this.annotation = { ...re }, this.draggedHandle = V, this.isDragging = !1, this.emit(St, this.annotation));
1617
+ m(this, "cancelDrawing", () => {
1618
+ this.isDragging && (this.remove(this.annotation.id), this.annotation = { ...le }, this.draggedHandle = V, this.isDragging = !1, this.emit(Tt, this.annotation));
2043
1619
  });
2044
- v(this, "startDragging", (t, r, a) => {
1620
+ m(this, "startDragging", (t, r, o) => {
2045
1621
  this.annotation = t;
2046
- const h = ct(this.annotation), f = ut(this.annotation);
2047
- this.rect.x = h.x, this.rect.y = h.y, this.rect.width = f.width, this.rect.height = f.height, this.startX = r, this.startY = a, this.disableDragging(), this.textArea.classList.add("noevents"), this.textArea.setAttribute("disabled", "disabled"), this.emit(Yt, this.annotation), this.isDragging = !0;
1622
+ const l = ct(this.annotation), u = ut(this.annotation);
1623
+ this.rect.x = l.x, this.rect.y = l.y, this.rect.width = u.width, this.rect.height = u.height, this.startX = r, this.startY = o, this.disableDragging(), this.textArea.classList.add("noevents"), this.textArea.setAttribute("disabled", "disabled"), this.emit(Zt, this.annotation), this.isDragging = !0;
2048
1624
  });
2049
- v(this, "onHandleMouseDown", (t) => {
1625
+ m(this, "onHandleMouseDown", (t) => {
2050
1626
  const r = this.getById(this.selectedId) || this.getById(this.hoveredId);
2051
1627
  if (!r)
2052
1628
  return;
2053
1629
  this.selectedId !== r.id && this.select(this.hoveredId);
2054
- const { x: a, y: h } = ae(t, this.ogma.getContainer());
2055
- this.startDragging(r, a, h), this.draggedHandle = qe(t.target);
1630
+ const { x: o, y: l } = ue(t, this.ogma.getContainer());
1631
+ this.startDragging(r, o, l), this.draggedHandle = Ue(t.target);
2056
1632
  });
2057
- v(this, "onMouseMove", (t) => {
1633
+ m(this, "onMouseMove", (t) => {
2058
1634
  requestAnimationFrame(() => this._onMouseMove(t));
2059
1635
  });
2060
- v(this, "_onMouseMove", (t) => {
1636
+ m(this, "_onMouseMove", (t) => {
2061
1637
  if (!this.isDragging)
2062
1638
  return;
2063
1639
  t.stopPropagation(), t.preventDefault();
2064
- const r = this.handles[this.draggedHandle], a = r.classList.contains("top"), h = r.classList.contains("left"), f = r.classList.contains("right"), g = r.classList.contains("bottom"), p = r.classList.contains("line-handle"), { x: s, y: d } = ae(
1640
+ const r = this.handles[this.draggedHandle], o = r.classList.contains("top"), l = r.classList.contains("left"), u = r.classList.contains("right"), d = r.classList.contains("bottom"), g = r.classList.contains("line-handle"), { x: f, y } = ue(
2065
1641
  t,
2066
1642
  this.ogma.getContainer()
2067
- ), m = this.ogma.view.getZoom(), A = (s - this.startX) / m, T = (d - this.startY) / m, b = this.ogma.view.getAngle(), I = new Y(A, T).rotateRadians(b);
2068
- (g && h || a && f) && (I.y = 0, I.x = 0);
2069
- const S = h || p ? this.rect.x + I.x : this.rect.x, P = a || p ? this.rect.y + I.y : this.rect.y, $ = Math.max(
2070
- this.rect.width + A * (p || h ? 0 : 1),
2071
- Ce
1643
+ ), v = this.ogma.view.getZoom(), T = (f - this.startX) / v, A = (y - this.startY) / v, b = this.ogma.view.getAngle(), C = rt({ x: T, y: A }, b);
1644
+ (d && l || o && u) && (C.y = 0, C.x = 0);
1645
+ const E = l || g ? this.rect.x + C.x : this.rect.x, $ = o || g ? this.rect.y + C.y : this.rect.y, N = Math.max(
1646
+ this.rect.width + T * (g || l ? 0 : 1),
1647
+ He
2072
1648
  ), _ = Math.max(
2073
- this.rect.height + T * (p || a ? 0 : 1),
2074
- Ce
1649
+ this.rect.height + A * (g || o ? 0 : 1),
1650
+ He
2075
1651
  );
2076
- Pn(this.annotation, S, P, $, _), this.emit(Ut, this.annotation, "text"), this.refreshEditor(), this.layer.refresh();
1652
+ Bn(this.annotation, E, $, N, _), this.emit(Xt, this.annotation, "text"), this.refreshEditor(), this.layer.refresh();
2077
1653
  });
2078
- v(this, "onMouseUp", () => {
2079
- !this.isDragging || this.draggedHandle === V || (this.restoreDragging(), this.textArea.classList.remove("noevents"), this.textArea.removeAttribute("disabled"), this.emit(St, this.annotation), this.isDragging = !1, this.draggedHandle = V);
1654
+ m(this, "onMouseUp", () => {
1655
+ !this.isDragging || this.draggedHandle === V || (this.restoreDragging(), this.textArea.classList.remove("noevents"), this.textArea.removeAttribute("disabled"), this.emit(Tt, this.annotation), this.isDragging = !1, this.draggedHandle = V);
2080
1656
  });
2081
- v(this, "_onMousedown", (t) => {
1657
+ m(this, "_onMousedown", (t) => {
2082
1658
  t.stopPropagation();
2083
1659
  });
2084
- v(this, "onViewChanged", () => {
1660
+ m(this, "onViewChanged", () => {
2085
1661
  const t = Math.max(2, this.handleSize / this.ogma.view.getZoom());
2086
1662
  document.documentElement.style.setProperty("--handle-scale", `${1 / t}`);
2087
1663
  });
2088
- v(this, "_onInput", () => {
1664
+ m(this, "_onInput", () => {
2089
1665
  const t = this.getById(this.selectedId);
2090
- t && (this.textArea.value = this.textArea.value.replace(/ +(?= )/g, ""), this.textArea.focus(), t.properties.content = this.textArea.value, this.emit(de, t), this.layer.refresh());
1666
+ t && (this.textArea.value = this.textArea.value.replace(/ +(?= )/g, ""), this.textArea.focus(), t.properties.content = this.textArea.value, this.emit(ye, t), this.layer.refresh());
2091
1667
  });
2092
- this.showeditorOnHover = !1, this.handleSize = Le.handleSize || r.textHandleSize, this.placeholder = Le.placeholder || r.textPlaceholder || "";
2093
- const a = this.textArea = this.editor.element.querySelector("textarea");
2094
- a.addEventListener("input", this._onInput), a.addEventListener("focus", this._onFocus), a.addEventListener("blur", this._onBlur), a.addEventListener("mousedown", this._onMousedown), a.spellcheck = !1, this.handles = Array.prototype.slice.call(
1668
+ this.showeditorOnHover = !1, this.handleSize = ze.handleSize || r.textHandleSize, this.placeholder = ze.placeholder || r.textPlaceholder || "";
1669
+ const o = this.textArea = this.editor.element.querySelector("textarea");
1670
+ o.addEventListener("input", this._onInput), o.addEventListener("focus", this._onFocus), o.addEventListener("blur", this._onBlur), o.addEventListener("mousedown", this._onMousedown), o.spellcheck = !1, this.handles = Array.prototype.slice.call(
2095
1671
  this.editor.element.querySelectorAll(".annotation-text-handle > .handle")
2096
1672
  ), this.handles.forEach(
2097
- (h) => h.addEventListener("mousedown", this.onHandleMouseDown)
1673
+ (l) => l.addEventListener("mousedown", this.onHandleMouseDown)
2098
1674
  ), document.addEventListener("mouseup", this.onMouseUp), document.addEventListener("mousemove", this.onMouseMove, !0), t.events.on(["viewChanged", "zoom"], this.onViewChanged);
2099
1675
  }
2100
1676
  _canRemove() {
2101
1677
  return !this.isFocused;
2102
1678
  }
2103
- detect({ x: t, y: r }, a = 0) {
2104
- const h = new Y(t, r), f = this.ogma.view.getAngle();
2105
- return this.elements.find((g) => {
2106
- const { x: p, y: s } = ct(g), { width: d, height: m } = ut(g), A = new Y(p, s), { x: T, y: b } = h.sub(A).rotateRadians(-f);
2107
- return T > -a && T < d + a && b > -a && b < m + a;
1679
+ detect({ x: t, y: r }, o = 0) {
1680
+ const l = { x: t, y: r }, u = this.ogma.view.getAngle();
1681
+ return this.elements.find((d) => {
1682
+ const { x: g, y: f } = ct(d), { width: y, height: v } = ut(d), T = { x: g, y: f }, { x: A, y: b } = rt(vt(l, T), -u);
1683
+ return A > -o && A < y + o && b > -o && b < v + o;
2108
1684
  });
2109
1685
  }
2110
1686
  draw(t) {
2111
1687
  t.innerHTML = "";
2112
- const r = "", a = this.ogma.view.getAngle();
2113
- this.elements.forEach((f, g) => {
2114
- const p = `class${g}`, s = ut(f), d = ct(f), m = f.id, {
2115
- color: A,
2116
- fontSize: T,
1688
+ const r = "", o = this.ogma.view.getAngle();
1689
+ this.elements.forEach((u, d) => {
1690
+ const g = `class${d}`, f = ut(u), y = ct(u), v = u.id, {
1691
+ color: T,
1692
+ fontSize: A,
2117
1693
  font: b,
2118
- strokeColor: I,
2119
- strokeWidth: S,
2120
- strokeType: P,
2121
- background: $
2122
- } = f.properties.style || At;
2123
- if (m === this.selectedId)
1694
+ strokeColor: C,
1695
+ strokeWidth: E,
1696
+ strokeType: $,
1697
+ background: N
1698
+ } = u.properties.style || St;
1699
+ if (v === this.selectedId)
2124
1700
  return;
2125
- const _ = Ot("g");
2126
- _.classList.add("annotation-text"), _.setAttribute("fill", `${A}`), _.setAttribute("font-size", `${T}px`), _.setAttribute("font-family", `${b}`);
2127
- const X = Ot("rect");
1701
+ const _ = Pt("g");
1702
+ _.classList.add("annotation-text"), _.setAttribute("fill", `${T}`), _.setAttribute("font-size", `${A}px`), _.setAttribute("font-family", `${b}`);
1703
+ const G = Pt("rect");
2128
1704
  let W = !1;
2129
- P && P !== "none" && (W = !0, X.setAttribute("stroke", I || "black"), X.setAttribute("stroke-width", `${S}`), P === "dashed" && X.setAttribute("stroke-dasharray", "5,5")), ($ && $.length || W) && (W = !0, X.setAttribute("fill", $ || "transparent")), W && (X.setAttribute("width", `${s.width}`), X.setAttribute("height", `${s.height}`)), _.appendChild(X), Un(f, _);
2130
- const { x: Et, y: kt } = new Y(d.x, d.y).rotateRadians(
2131
- -a
2132
- );
2133
- _.setAttribute("transform", `translate(${Et},${kt})`), _.classList.add(p), _.setAttribute("data-annotation", `${f.id}`), _.setAttribute("data-annotation-type", "text"), t.appendChild(_);
1705
+ $ && $ !== "none" && (W = !0, G.setAttribute("stroke", C || "black"), G.setAttribute("stroke-width", `${E}`), $ === "dashed" && G.setAttribute("stroke-dasharray", "5,5")), (N && N.length || W) && (W = !0, G.setAttribute("fill", N || "transparent")), W && (G.setAttribute("width", `${f.width}`), G.setAttribute("height", `${f.height}`)), _.appendChild(G), ti(u, _);
1706
+ const { x: _t, y: It } = rt(y, -o);
1707
+ _.setAttribute("transform", `translate(${_t},${It})`), _.classList.add(g), _.setAttribute("data-annotation", `${u.id}`), _.setAttribute("data-annotation-type", "text"), t.appendChild(_);
2134
1708
  });
2135
- const h = Ot("style");
2136
- h.innerHTML = r, t.firstChild && t.insertBefore(h, t.firstChild);
1709
+ const l = Pt("style");
1710
+ l.innerHTML = r, t.firstChild && t.insertBefore(l, t.firstChild);
2137
1711
  }
2138
1712
  refreshDrawing() {
2139
1713
  const t = this.ogma.view.getAngle();
2140
1714
  [...this.layer.element.children].forEach((r) => {
2141
- const a = r.getAttribute("data-annotation");
2142
- if (!a)
1715
+ const o = r.getAttribute("data-annotation");
1716
+ if (!o)
2143
1717
  return;
2144
- const h = ct(this.getById(a)), { x: f, y: g } = new Y(h.x, h.y).rotateRadians(
2145
- -t
2146
- );
2147
- r.setAttribute("transform", `translate(${f},${g})`);
1718
+ const l = ct(this.getById(o)), { x: u, y: d } = rt(l, -t);
1719
+ r.setAttribute("transform", `translate(${u},${d})`);
2148
1720
  });
2149
1721
  }
2150
1722
  getDefaultOptions() {
2151
- return re;
1723
+ return le;
2152
1724
  }
2153
1725
  refreshEditor() {
2154
1726
  if (+this.selectedId < 0 && +this.hoveredId < 0)
2155
1727
  return;
2156
- const t = this.getById(this.selectedId) || this.getById(this.hoveredId), r = ut(t), a = this.ogma.view.graphToScreenCoordinates(
1728
+ const t = this.getById(this.selectedId) || this.getById(this.hoveredId), r = ut(t), o = this.ogma.view.graphToScreenCoordinates(
2157
1729
  ct(t)
2158
- ), h = this.ogma.view.getZoom(), {
2159
- font: f,
2160
- fontSize: g,
2161
- color: p,
2162
- background: s,
2163
- padding: d = 0
2164
- } = t.properties.style || At, m = (g || 1) * h;
2165
- this.textArea.value = t.properties.content, this.editor.element.style.transform = `translate(${a.x}px, ${a.y}px)translate(-50%, -50%)translate(${r.width / 2 * h}px, ${r.height / 2 * h}px)`, this.editor.element.style.width = `${r.width * h}px`, this.editor.element.style.height = `${r.height * h}px`, this.textArea.style.font = `${m} ${f}`, this.textArea.style.fontFamily = f || "sans-serif", this.textArea.style.fontSize = `${m}px`, this.textArea.style.padding = `${h * d}px`, this.textArea.style.lineHeight = `${m}px`, this.textArea.style.boxSizing = "border-box", this.textArea.style.color = p || "black", this.textArea.style.background = s || "transparent", this.textArea.placeholder = this.placeholder, this.layer.refresh();
1730
+ ), l = this.ogma.view.getZoom(), {
1731
+ font: u,
1732
+ fontSize: d,
1733
+ color: g,
1734
+ background: f,
1735
+ padding: y = 0
1736
+ } = t.properties.style || St, v = (d || 1) * l;
1737
+ this.textArea.value = t.properties.content, this.editor.element.style.transform = `translate(${o.x}px, ${o.y}px)translate(-50%, -50%)translate(${r.width / 2 * l}px, ${r.height / 2 * l}px)`, this.editor.element.style.width = `${r.width * l}px`, this.editor.element.style.height = `${r.height * l}px`, this.textArea.style.font = `${v} ${u}`, this.textArea.style.fontFamily = u || "sans-serif", this.textArea.style.fontSize = `${v}px`, this.textArea.style.padding = `${l * y}px`, this.textArea.style.lineHeight = `${v}px`, this.textArea.style.boxSizing = "border-box", this.textArea.style.color = g || "black", this.textArea.style.background = f || "transparent", this.textArea.placeholder = this.placeholder, this.layer.refresh();
2166
1738
  }
2167
1739
  select(t) {
2168
1740
  super.select(t), this.textArea.focus();
@@ -2171,62 +1743,62 @@ class Yn extends Ye {
2171
1743
  super.destroy(), document.removeEventListener("mouseup", this.onMouseUp), document.removeEventListener("mousemove", this.onMouseMove, !0), this.ogma.events.off(this.onViewChanged);
2172
1744
  }
2173
1745
  }
2174
- class Xn {
1746
+ class ni {
2175
1747
  constructor() {
2176
- v(this, "links", {});
2177
- v(this, "linksByTargetId", {});
2178
- v(this, "linksByArrowId", {});
2179
- }
2180
- add(l, t, r, a, h) {
2181
- const f = Xt(), g = l.id, p = {
2182
- id: f,
2183
- arrow: g,
1748
+ m(this, "links", {});
1749
+ m(this, "linksByTargetId", {});
1750
+ m(this, "linksByArrowId", {});
1751
+ }
1752
+ add(h, t, r, o, l) {
1753
+ const u = Kt(), d = h.id, g = {
1754
+ id: u,
1755
+ arrow: d,
2184
1756
  target: r,
2185
- targetType: a,
2186
- connectionPoint: h,
1757
+ targetType: o,
1758
+ connectionPoint: l,
2187
1759
  side: t
2188
1760
  };
2189
- return this.links[f] = p, this.linksByTargetId[r] || (this.linksByTargetId[r] = []), this.linksByTargetId[r].push(f), this.linksByArrowId[g] || (this.linksByArrowId[g] = {}), this.linksByArrowId[g][t] = f, l.properties.link = l.properties.link || {}, l.properties.link[t] = {
1761
+ return this.links[u] = g, this.linksByTargetId[r] || (this.linksByTargetId[r] = []), this.linksByTargetId[r].push(u), this.linksByArrowId[d] || (this.linksByArrowId[d] = {}), this.linksByArrowId[d][t] = u, h.properties.link = h.properties.link || {}, h.properties.link[t] = {
2190
1762
  id: r,
2191
1763
  side: t,
2192
- type: a,
2193
- magnet: h
1764
+ type: o,
1765
+ magnet: l
2194
1766
  }, this;
2195
1767
  }
2196
- arrowIsLinked(l, t) {
1768
+ arrowIsLinked(h, t) {
2197
1769
  var r;
2198
- return !!((r = this.linksByArrowId[l]) != null && r[t]);
1770
+ return !!((r = this.linksByArrowId[h]) != null && r[t]);
2199
1771
  }
2200
1772
  // remove the link between the arrow and the target by arrow id and side
2201
- remove(l, t) {
2202
- var g, p;
2203
- const r = l.id, a = (g = this.linksByArrowId[r]) == null ? void 0 : g[t];
2204
- if ((p = l.properties.link) == null || delete p[t], !a)
1773
+ remove(h, t) {
1774
+ var d, g;
1775
+ const r = h.id, o = (d = this.linksByArrowId[r]) == null ? void 0 : d[t];
1776
+ if ((g = h.properties.link) == null || delete g[t], !o)
2205
1777
  return this;
2206
- const h = this.links[a];
2207
- delete this.links[a];
2208
- const f = this.linksByTargetId[h.target];
2209
- for (let s = 0; s < f.length; s++)
2210
- if (f[s] === a) {
2211
- f.splice(s, 1);
1778
+ const l = this.links[o];
1779
+ delete this.links[o];
1780
+ const u = this.linksByTargetId[l.target];
1781
+ for (let f = 0; f < u.length; f++)
1782
+ if (u[f] === o) {
1783
+ u.splice(f, 1);
2212
1784
  break;
2213
1785
  }
2214
1786
  return delete this.linksByArrowId[r][t], this;
2215
1787
  }
2216
- getArrowLink(l, t) {
2217
- var a;
2218
- const r = (a = this.linksByArrowId[l]) == null ? void 0 : a[t];
1788
+ getArrowLink(h, t) {
1789
+ var o;
1790
+ const r = (o = this.linksByArrowId[h]) == null ? void 0 : o[t];
2219
1791
  return r ? this.links[r] : null;
2220
1792
  }
2221
- getTargetLinks(l, t) {
1793
+ getTargetLinks(h, t) {
2222
1794
  var r;
2223
- return ((r = this.linksByTargetId[l]) == null ? void 0 : r.map((a) => this.links[a]).filter((a) => a.targetType === t)) ?? [];
1795
+ return ((r = this.linksByTargetId[h]) == null ? void 0 : r.map((o) => this.links[o]).filter((o) => o.targetType === t)) ?? [];
2224
1796
  }
2225
- forEach(l) {
2226
- Object.values(this.links).forEach(l);
1797
+ forEach(h) {
1798
+ Object.values(this.links).forEach(h);
2227
1799
  }
2228
1800
  }
2229
- const ot = (u) => u.properties.type === "arrow", mt = (u) => u.properties.type === "text", Pe = (u) => u.type === "FeatureCollection", Wn = {
1801
+ const st = (a) => a.properties.type === "arrow", pt = (a) => a.properties.type === "text", Fe = (a) => a.type === "FeatureCollection", ii = {
2230
1802
  magnetColor: "#3e8",
2231
1803
  detectMargin: 20,
2232
1804
  magnetHandleRadius: 5,
@@ -2236,7 +1808,7 @@ const ot = (u) => u.properties.type === "arrow", mt = (u) => u.properties.type =
2236
1808
  textHandleSize: 3.5,
2237
1809
  minArrowHeight: 20,
2238
1810
  maxArrowHeight: 30
2239
- }, $e = ["start", "end"], Ne = [
1811
+ }, Be = ["start", "end"], je = [
2240
1812
  { x: 0, y: 0 },
2241
1813
  { x: 0.5, y: 0 },
2242
1814
  { x: 1, y: 0 },
@@ -2246,159 +1818,160 @@ const ot = (u) => u.properties.type === "arrow", mt = (u) => u.properties.type =
2246
1818
  { x: 0.5, y: 1 },
2247
1819
  { x: 1, y: 1 }
2248
1820
  ];
2249
- class Kn extends Ue {
1821
+ class oi extends Je {
2250
1822
  constructor(t, r = {}) {
2251
1823
  super();
2252
- v(this, "arrows");
2253
- v(this, "texts");
2254
- v(this, "links", new Xn());
2255
- v(this, "layer");
2256
- v(this, "annotations");
2257
- v(this, "ogma");
2258
- v(this, "options");
2259
- v(this, "selected", null);
2260
- v(this, "updateTimeout", 0);
2261
- v(this, "hoveredNode", null);
2262
- v(this, "dragged", null);
2263
- v(this, "textToMagnet");
2264
- v(this, "activeLinks", []);
2265
- v(this, "_render", (t) => {
1824
+ m(this, "arrows");
1825
+ m(this, "texts");
1826
+ m(this, "links", new ni());
1827
+ m(this, "layer");
1828
+ m(this, "annotations");
1829
+ m(this, "ogma");
1830
+ m(this, "options");
1831
+ m(this, "selected", null);
1832
+ m(this, "updateTimeout", 0);
1833
+ m(this, "hoveredNode", null);
1834
+ m(this, "dragged", null);
1835
+ m(this, "textToMagnet");
1836
+ m(this, "activeLinks", []);
1837
+ m(this, "_render", (t) => {
2266
1838
  if (!this.dragged || this.textToMagnet === void 0)
2267
1839
  return;
2268
1840
  t.beginPath(), t.fillStyle = "green";
2269
1841
  const r = this.ogma.view.getZoom();
2270
- Ne.forEach((a) => {
1842
+ je.forEach((o) => {
2271
1843
  if (!this.textToMagnet)
2272
1844
  return;
2273
- const h = ut(this.textToMagnet), f = ct(this.textToMagnet), { x: g, y: p } = new Y(a.x, a.y).mul({ x: h.width, y: h.height }).rotateRadians(this.ogma.view.getAngle()).add(f);
2274
- t.moveTo(g, p), t.arc(g, p, this.options.magnetHandleRadius / r, 0, Math.PI * 2);
1845
+ const l = ut(this.textToMagnet), u = ct(this.textToMagnet), d = Ut(o, { x: l.width, y: l.height }), g = rt(d, this.ogma.view.getAngle()), { x: f, y } = Et(g, u);
1846
+ t.moveTo(f, y), t.arc(f, y, this.options.magnetHandleRadius / r, 0, Math.PI * 2);
2275
1847
  }), t.fill(), t.closePath();
2276
1848
  });
2277
- v(this, "_onFeatureDrag", (t, r) => {
2278
- const a = r;
2279
- if (ot(t) && a === "line")
2280
- ["start", "end"].find((h) => {
2281
- const f = h === "start" ? Lt(t) : Bt(t);
2282
- return this._snapToText(t, a, f) || this._findAndSnapToNode(t, h, f);
1849
+ m(this, "_onFeatureDrag", (t, r) => {
1850
+ const o = r;
1851
+ if (st(t) && o === "line")
1852
+ ["start", "end"].find((l) => {
1853
+ const u = l === "start" ? $t(t) : Wt(t);
1854
+ return this._snapToText(t, o, u) || this._findAndSnapToNode(t, l, u);
2283
1855
  });
2284
- else if (ot(t) && a !== "line") {
2285
- const h = a === "start" ? Lt(t) : Bt(t);
2286
- this._snapToText(t, a, h) || this._findAndSnapToNode(t, a, h);
1856
+ else if (st(t) && o !== "line") {
1857
+ const l = o === "start" ? $t(t) : Wt(t);
1858
+ this._snapToText(t, o, l) || this._findAndSnapToNode(t, o, l);
2287
1859
  } else
2288
- mt(t) && (this.activeLinks.forEach(({ arrow: h, side: f, connectionPoint: g }) => {
2289
- const p = this.getAnnotation(h), s = ut(t), d = ct(t), m = new Y(g.x, g.y).mul({ x: s.width, y: s.height }).rotateRadians(this.ogma.view.getAngle()).add(d);
2290
- p.geometry.coordinates[f === "start" ? 0 : 1] = [m.x, m.y];
1860
+ pt(t) && (this.activeLinks.forEach(({ arrow: l, side: u, connectionPoint: d }) => {
1861
+ const g = this.getAnnotation(l), f = ut(t), y = ct(t), v = Ut(d, { x: f.width, y: f.height }), T = rt(v, this.ogma.view.getAngle()), A = Et(T, y);
1862
+ g.geometry.coordinates[u === "start" ? 0 : 1] = [A.x, A.y];
2291
1863
  }), this.activeLinks.length && this.arrows.refreshLayer());
2292
- this.layer.refresh(), this.emit(Ut, t, r);
1864
+ this.layer.refresh(), this.emit(Xt, t, r);
2293
1865
  });
2294
- v(this, "_onFeatureDragEnd", (t) => {
2295
- this.dragged !== null && ot(t) && Lt(this.dragged) && $e.forEach((r) => {
2296
- this.links.getArrowLink(t.id, r) && this.emit(jn, {
1866
+ m(this, "_onFeatureDragEnd", (t) => {
1867
+ this.dragged !== null && st(t) && $t(this.dragged) && Be.forEach((r) => {
1868
+ this.links.getArrowLink(t.id, r) && this.emit(Yn, {
2297
1869
  arrow: t,
2298
1870
  link: this.links.getArrowLink(t.id, r)
2299
1871
  });
2300
- }), (mt(t) || ot(t)) && this.onUpdate(t), this.dragged = null, this.activeLinks = [], this.textToMagnet = void 0, this.annotations.forEach((r) => r.enableDetection()), this.layer.refresh(), this.emit(St, t);
1872
+ }), (pt(t) || st(t)) && this.onUpdate(t), this.dragged = null, this.activeLinks = [], this.textToMagnet = void 0, this.annotations.forEach((r) => r.enableDetection()), this.layer.refresh(), this.emit(Tt, t);
2301
1873
  });
2302
- v(this, "_onFeatureDragStart", (t) => {
2303
- this.textToMagnet = void 0, ot(t) ? this.dragged = t : mt(t) && this.activeLinks.push(...this.links.getTargetLinks(t.id, "text")), this.annotations.forEach((r) => {
2304
- const a = r.getSelectedFeature();
2305
- a && a !== t && r.unhover().unselect(), r.disableDetection();
2306
- }), this.emit(Yt, t);
1874
+ m(this, "_onFeatureDragStart", (t) => {
1875
+ this.textToMagnet = void 0, st(t) ? this.dragged = t : pt(t) && this.activeLinks.push(...this.links.getTargetLinks(t.id, "text")), this.annotations.forEach((r) => {
1876
+ const o = r.getSelectedFeature();
1877
+ o && o !== t && r.unhover().unselect(), r.disableDetection();
1878
+ }), this.emit(Zt, t);
2307
1879
  });
2308
- v(this, "_onNodesDragStart", () => {
1880
+ m(this, "_onNodesDragStart", () => {
2309
1881
  this.arrows.unhover().unselect(), this.texts.unhover().unselect();
2310
1882
  });
2311
- v(this, "_onNodesDrag", (t) => {
2312
- const { dx: r, dy: a } = t;
2313
- this._moveNodes(t.nodes, r, a);
1883
+ m(this, "_onNodesDrag", (t) => {
1884
+ const { dx: r, dy: o } = t;
1885
+ this._moveNodes(t.nodes, r, o);
2314
1886
  });
2315
- v(this, "_onLayoutEnd", (t) => {
2316
- t.ids.forEach((r, a) => {
2317
- this.links.getTargetLinks(r, "node").forEach((f) => {
2318
- const g = this.getAnnotation(f.arrow), p = f.side, s = jt(
2319
- g,
2320
- p === "start" ? "end" : "start"
2321
- ), d = t.positions.current[a], m = this.ogma.getNode(r).getAttribute("radius"), A = Ft(s, d, +m);
2322
- bt(g, p, A.x, A.y);
1887
+ m(this, "_onLayoutEnd", (t) => {
1888
+ t.ids.forEach((r, o) => {
1889
+ this.links.getTargetLinks(r, "node").forEach((u) => {
1890
+ const d = this.getAnnotation(u.arrow), g = u.side, f = Rt(
1891
+ d,
1892
+ g === "start" ? "end" : "start"
1893
+ ), y = t.positions.current[o], v = this.ogma.getNode(r).getAttribute("radius"), T = Vt(f, y, +v);
1894
+ At(d, g, T.x, T.y);
2323
1895
  });
2324
1896
  }), this.arrows.refreshLayer(), this.texts.refreshLayer();
2325
1897
  });
2326
- v(this, "_onAdded", (t) => {
2327
- this.emit(ue, t);
1898
+ m(this, "_onAdded", (t) => {
1899
+ this.emit(ge, t);
2328
1900
  });
2329
- v(this, "_onRemoved", (t) => {
2330
- this.emit(ce, t);
1901
+ m(this, "_onRemoved", (t) => {
1902
+ this.emit(pe, t);
2331
1903
  });
2332
- v(this, "_onUnselect", (t) => {
2333
- this.selected = null, this.emit(he, t);
1904
+ m(this, "_onUnselect", (t) => {
1905
+ this.selected = null, this.emit(fe, t);
2334
1906
  });
2335
- v(this, "_onSelect", (t) => {
2336
- this.selected !== t && (this.selected = t, this.emit(le, this.selected));
1907
+ m(this, "_onSelect", (t) => {
1908
+ this.selected !== t && (this.selected = t, this.emit(de, this.selected));
2337
1909
  });
2338
1910
  /**
2339
1911
  * Triggers the update event on the annotation
2340
1912
  * @param annotation The annotation updated
2341
1913
  */
2342
- v(this, "onUpdate", (t) => {
1914
+ m(this, "onUpdate", (t) => {
2343
1915
  cancelAnimationFrame(this.updateTimeout), this.updateTimeout = requestAnimationFrame(
2344
1916
  () => this._onUpdate(t)
2345
1917
  );
2346
1918
  });
2347
- v(this, "_onUpdate", (t) => {
2348
- this.emit(de, t);
1919
+ m(this, "_onUpdate", (t) => {
1920
+ this.emit(ye, t);
2349
1921
  });
2350
- this.options = this.setOptions({ ...Wn, ...r }), this.ogma = t, this.arrows = new qn(t, this.options), this.texts = new Yn(t, this.options), this.annotations = [this.arrows, this.texts], this.annotations.forEach((a) => {
2351
- a.on(Yt, this._onFeatureDragStart).on(Ut, this._onFeatureDrag).on(St, this._onFeatureDragEnd).on(de, this.onUpdate).on(he, this._onUnselect).on(le, this._onSelect).on(ue, this._onAdded).on(ce, this._onRemoved);
1922
+ this.options = this.setOptions({ ...ii, ...r }), this.ogma = t, this.arrows = new Kn(t, this.options), this.texts = new ei(t, this.options), this.annotations = [this.arrows, this.texts], this.annotations.forEach((o) => {
1923
+ o.on(Zt, this._onFeatureDragStart).on(Xt, this._onFeatureDrag).on(Tt, this._onFeatureDragEnd).on(ye, this.onUpdate).on(fe, this._onUnselect).on(de, this._onSelect).on(ge, this._onAdded).on(pe, this._onRemoved);
2352
1924
  }), this.ogma.events.on("nodesDragStart", this._onNodesDragStart).on("nodesDragProgress", this._onNodesDrag).on("layoutEnd", this._onLayoutEnd).on(["viewChanged", "rotate"], () => {
2353
1925
  this.refreshTextLinks();
2354
1926
  }), this.layer = t.layers.addCanvasLayer(this._render), this.layer.moveToBottom();
2355
1927
  }
2356
- _moveNodes(t, r, a) {
2357
- t.forEach((h) => {
2358
- const f = this.links.getTargetLinks(h.getId(), "node"), g = h.getPosition();
2359
- f.forEach((p) => {
2360
- const s = this.getAnnotation(p.arrow), d = p.side, m = jt(
2361
- s,
2362
- d === "start" ? "end" : "start"
1928
+ _moveNodes(t, r, o) {
1929
+ t.forEach((l) => {
1930
+ const u = this.links.getTargetLinks(l.getId(), "node"), d = l.getPosition();
1931
+ u.forEach((g) => {
1932
+ const f = this.getAnnotation(g.arrow), y = g.side, v = Rt(
1933
+ f,
1934
+ y === "start" ? "end" : "start"
2363
1935
  );
2364
- let A = g;
2365
- const T = +h.getAttribute("radius"), b = 1e-6;
2366
- (p.connectionPoint.x - (g.x - r) > b || p.connectionPoint.y - (g.y - a) > b) && (A = Ft(m, g, T)), bt(s, d, A.x, A.y);
1936
+ let T = d;
1937
+ const A = +l.getAttribute("radius"), b = 1e-6;
1938
+ (g.connectionPoint.x - (d.x - r) > b || g.connectionPoint.y - (d.y - o) > b) && (T = Vt(v, d, A)), At(f, y, T.x, T.y);
2367
1939
  });
2368
1940
  }), this.arrows.refreshLayer();
2369
1941
  }
2370
- _snapToText(t, r, a) {
2371
- const h = this.texts.detect(a, this.options.detectMargin);
2372
- if (this.links.remove(t, r), !h)
1942
+ _snapToText(t, r, o) {
1943
+ const l = this.texts.detect(o, this.options.detectMargin);
1944
+ if (this.links.remove(t, r), !l)
2373
1945
  return !1;
2374
- this.textToMagnet = h;
2375
- const f = this.findMagnetPoint(Ne, h, a);
2376
- return f ? (bt(t, r, f.point.x, f.point.y), this.links.add(t, r, h.id, "text", f.magnet), !0) : !1;
2377
- }
2378
- _findAndSnapToNode(t, r, a) {
2379
- const h = this.ogma.view.graphToScreenCoordinates(a), f = this.ogma.view.getElementAt(h);
2380
- this.links.remove(t, r), f && f.isNode ? (this.hoveredNode = f, this.hoveredNode.setSelected(!0), this._snapToNode(t, r, f, h)) : (this.hoveredNode && this.hoveredNode.setSelected(!1), this.hoveredNode = null);
2381
- }
2382
- _snapToNode(t, r, a, h) {
2383
- const f = a.getPositionOnScreen(), g = +a.getAttribute("radius"), p = g * this.ogma.view.getZoom(), s = h.x - f.x, d = h.y - f.y, m = Math.sqrt(s * s + d * d), A = a.getPosition();
2384
- if (m < p + this.options.detectMargin) {
2385
- let T = A;
2386
- if (m > p / 2) {
2387
- const b = jt(t, r === "end" ? "start" : "end");
2388
- T = Ft(b, T, g);
1946
+ this.textToMagnet = l;
1947
+ const u = this.findMagnetPoint(je, l, o);
1948
+ return u ? (At(t, r, u.point.x, u.point.y), this.links.add(t, r, l.id, "text", u.magnet), !0) : !1;
1949
+ }
1950
+ _findAndSnapToNode(t, r, o) {
1951
+ var d, g;
1952
+ const l = this.ogma.view.graphToScreenCoordinates(o), u = this.ogma.view.getElementAt(l);
1953
+ this.links.remove(t, r), u && u.isNode ? ((d = this.hoveredNode) == null || d.setSelected(!1), this.hoveredNode = u, u.setSelected(!0), this._snapToNode(t, r, u, l)) : ((g = this.hoveredNode) == null || g.setSelected(!1), this.hoveredNode = null);
1954
+ }
1955
+ _snapToNode(t, r, o, l) {
1956
+ const u = o.getPositionOnScreen(), d = +o.getAttribute("radius"), g = d * this.ogma.view.getZoom(), f = l.x - u.x, y = l.y - u.y, v = Math.sqrt(f * f + y * y), T = o.getPosition();
1957
+ if (v < g + this.options.detectMargin) {
1958
+ let A = T;
1959
+ if (v > g / 2) {
1960
+ const b = Rt(t, r === "end" ? "start" : "end");
1961
+ A = Vt(b, A, d);
2389
1962
  }
2390
- bt(t, r, T.x, T.y), this.links.add(t, r, a.getId(), "node", T);
1963
+ At(t, r, A.x, A.y), this.links.add(t, r, o.getId(), "node", A);
2391
1964
  }
2392
1965
  }
2393
1966
  refreshTextLinks() {
2394
1967
  let t = !1;
2395
1968
  this.links.forEach(
2396
- ({ connectionPoint: r, targetType: a, target: h, arrow: f, side: g }) => {
2397
- if (a !== "text")
1969
+ ({ connectionPoint: r, targetType: o, target: l, arrow: u, side: d }) => {
1970
+ if (o !== "text")
2398
1971
  return;
2399
1972
  t = !0;
2400
- const p = this.getAnnotation(h), s = this.getAnnotation(f), d = ut(p), m = ct(p), A = new Y(r.x, r.y).mul({ x: d.width, y: d.height }).rotateRadians(this.ogma.view.getAngle()).add(m);
2401
- bt(s, g, A.x, A.y);
1973
+ const g = this.getAnnotation(l), f = this.getAnnotation(u), y = ut(g), v = ct(g), T = Ut(r, { x: y.width, y: y.height }), A = rt(T, this.ogma.view.getAngle()), b = Et(A, v);
1974
+ At(f, d, b.x, b.y);
2402
1975
  }
2403
1976
  ), t && this.arrows.refreshLayer();
2404
1977
  }
@@ -2408,24 +1981,24 @@ class Kn extends Ue {
2408
1981
  getSelected() {
2409
1982
  return this.selected;
2410
1983
  }
2411
- findMagnetPoint(t, r, a) {
2412
- let h;
2413
- for (const f of t) {
2414
- const g = ut(r), p = ct(r), s = new Y(f.x, f.y).mul({ x: g.width, y: g.height }).rotateRadians(this.ogma.view.getAngle()).add(p), d = s.sub(a).length(), m = Math.min(
1984
+ findMagnetPoint(t, r, o) {
1985
+ let l;
1986
+ for (const u of t) {
1987
+ const d = ut(r), g = ct(r), f = Ut(u, { x: d.width, y: d.height }), y = rt(f, this.ogma.view.getAngle()), v = Et(y, g), T = kt(vt(v, o)), A = Math.min(
2415
1988
  this.options.magnetRadius * this.ogma.view.getZoom(),
2416
1989
  // when really zoomed in: avoid to snap on too far away magnets
2417
- g.width / 2,
2418
- g.height / 2
1990
+ d.width / 2,
1991
+ d.height / 2
2419
1992
  );
2420
- if (d < Math.max(m, this.options.magnetHandleRadius)) {
2421
- h = {
2422
- point: s,
2423
- magnet: f
1993
+ if (T < Math.max(A, this.options.magnetHandleRadius)) {
1994
+ l = {
1995
+ point: v,
1996
+ magnet: u
2424
1997
  };
2425
1998
  break;
2426
1999
  }
2427
2000
  }
2428
- return h;
2001
+ return l;
2429
2002
  }
2430
2003
  /**
2431
2004
  * Set the options for the controller
@@ -2443,26 +2016,26 @@ class Kn extends Ue {
2443
2016
  * @param id the id of the annotation to select
2444
2017
  */
2445
2018
  select(t) {
2446
- const r = this.getAnnotations().features.find((a) => a.id === t);
2447
- return r ? (ot(r) ? this.arrows.select(r.id) : mt(r) && this.texts.select(r.id), this) : this;
2019
+ const r = this.getAnnotations().features.find((o) => o.id === t);
2020
+ return r ? (st(r) ? this.arrows.select(r.id) : pt(r) && this.texts.select(r.id), this) : this;
2448
2021
  }
2449
2022
  /**
2450
2023
  * Unselects the currently selected annotation
2451
2024
  */
2452
2025
  unselect() {
2453
- return this.selected ? (ot(this.selected) ? this.arrows.unselect() : mt(this.selected) && this.texts.unselect(), this) : this;
2026
+ return this.selected ? (st(this.selected) ? this.arrows.unselect() : pt(this.selected) && this.texts.unselect(), this) : this;
2454
2027
  }
2455
2028
  /**
2456
2029
  * Add an annotation to the controller
2457
2030
  * @param annotation The annotation to add
2458
2031
  */
2459
2032
  add(t) {
2460
- if (Pe(t)) {
2461
- const [r, a] = t.features.reduce(
2462
- (h, f) => (ot(f) ? h[1].push(f) : mt(f) && h[0].push(f), h),
2033
+ if (Fe(t)) {
2034
+ const [r, o] = t.features.reduce(
2035
+ (l, u) => (st(u) ? l[1].push(u) : pt(u) && l[0].push(u), l),
2463
2036
  [[], []]
2464
2037
  );
2465
- return r.forEach((h) => this.add(h)), a.forEach((h) => this.add(h)), this.arrows.refreshLayer(), this;
2038
+ return r.forEach((l) => this.add(l)), o.forEach((l) => this.add(l)), this.arrows.refreshLayer(), this;
2466
2039
  }
2467
2040
  switch (t.properties.type) {
2468
2041
  case "text":
@@ -2479,29 +2052,29 @@ class Kn extends Ue {
2479
2052
  * @param annotation The annotation(s) to remove
2480
2053
  */
2481
2054
  remove(t) {
2482
- return Pe(t) ? (t.features.forEach(
2055
+ return Fe(t) ? (t.features.forEach(
2483
2056
  (r) => this.remove(r)
2484
- ), this) : (ot(t) ? (this.links.remove(t, "start"), this.links.remove(t, "end"), this.arrows.remove(t.id)) : this.texts.remove(t.id), this);
2057
+ ), this) : (st(t) ? (this.links.remove(t, "start"), this.links.remove(t, "end"), this.arrows.remove(t.id)) : this.texts.remove(t.id), this);
2485
2058
  }
2486
2059
  loadLink(t) {
2487
2060
  if (t.properties.link)
2488
- for (const r of $e) {
2489
- const a = t.properties.link[r];
2490
- if (!a)
2061
+ for (const r of Be) {
2062
+ const o = t.properties.link[r];
2063
+ if (!o)
2491
2064
  continue;
2492
- const h = this.getAnnotation(a.id);
2493
- if (a.type === "text" && h)
2494
- this.links.add(t, r, a.id, a.type, a.magnet);
2495
- else if (a.type === "node") {
2496
- const f = this.ogma.getNode(a.id);
2497
- if (!f)
2065
+ const l = this.getAnnotation(o.id);
2066
+ if (o.type === "text" && l)
2067
+ this.links.add(t, r, o.id, o.type, o.magnet);
2068
+ else if (o.type === "node") {
2069
+ const u = this.ogma.getNode(o.id);
2070
+ if (!u)
2498
2071
  continue;
2499
- this.links.add(t, r, a.id, a.type, a.magnet);
2500
- const g = f.getPosition(), p = f.getAttribute("radius") || 0, s = jt(
2072
+ this.links.add(t, r, o.id, o.type, o.magnet);
2073
+ const d = u.getPosition(), g = u.getAttribute("radius") || 0, f = Rt(
2501
2074
  t,
2502
2075
  r === "start" ? "end" : "start"
2503
- ), d = Ft(s, g, +p);
2504
- bt(t, r, d.x, d.y);
2076
+ ), y = Vt(f, d, +g);
2077
+ At(t, r, y.x, y.y);
2505
2078
  }
2506
2079
  }
2507
2080
  }
@@ -2511,8 +2084,8 @@ class Kn extends Ue {
2511
2084
  * @param y coord of the first point
2512
2085
  * @param arrow The arrow to add
2513
2086
  */
2514
- startArrow(t, r, a) {
2515
- this.cancelDrawing(), this.arrows.startDrawing(t, r, a);
2087
+ startArrow(t, r, o) {
2088
+ this.cancelDrawing(), this.arrows.startDrawing(t, r, o);
2516
2089
  }
2517
2090
  /**
2518
2091
  * Start adding a text (add it, and give control to the user)
@@ -2520,14 +2093,14 @@ class Kn extends Ue {
2520
2093
  * @param y coord of the top left point
2521
2094
  * @param text The text to add
2522
2095
  */
2523
- startText(t, r, a) {
2524
- this.cancelDrawing(), this.texts.startDrawing(t, r, a);
2096
+ startText(t, r, o) {
2097
+ this.cancelDrawing(), this.texts.startDrawing(t, r, o);
2525
2098
  }
2526
2099
  /**
2527
2100
  * Cancel drawing on the current frame
2528
2101
  */
2529
2102
  cancelDrawing() {
2530
- this.annotations.forEach((t) => t.cancelDrawing()), this.emit(Hn);
2103
+ this.annotations.forEach((t) => t.cancelDrawing()), this.emit(Wn);
2531
2104
  }
2532
2105
  /**
2533
2106
  * Update the style of the annotation with the given id
@@ -2535,8 +2108,12 @@ class Kn extends Ue {
2535
2108
  * @param style The new style
2536
2109
  */
2537
2110
  updateStyle(t, r) {
2538
- const a = this.getAnnotations().features.find((h) => h.id === t);
2539
- return a ? (ot(a) ? this.arrows.updateStyle(a, r) : mt(a) && this.texts.updateStyle(a, r), this.onUpdate(a), this) : this;
2111
+ const o = this.getAnnotations().features.find((l) => l.id === t);
2112
+ return o ? (st(o) ? this.arrows.updateStyle(o, r) : pt(o) && this.texts.updateStyle(o, r), this.onUpdate(o), this) : this;
2113
+ }
2114
+ setScale(t, r, o, l) {
2115
+ const u = this.getAnnotations().features.find((d) => d.id === t);
2116
+ return u ? (st(u) ? this.arrows.scale(u, r, o, l) : pt(u) && this.texts.scale(u, r, o, l), this.onUpdate(u), this) : this;
2540
2117
  }
2541
2118
  /**
2542
2119
  *
@@ -2567,47 +2144,48 @@ class Kn extends Ue {
2567
2144
  }
2568
2145
  }
2569
2146
  export {
2570
- qn as Arrows,
2571
- Kn as Control,
2572
- ue as EVT_ADD,
2573
- Hn as EVT_CANCEL_DRAWING,
2574
- Ut as EVT_DRAG,
2575
- St as EVT_DRAG_END,
2576
- Yt as EVT_DRAG_START,
2577
- Nn as EVT_HOVER,
2578
- jn as EVT_LINK,
2579
- ce as EVT_REMOVE,
2580
- le as EVT_SELECT,
2581
- Rn as EVT_UNHOVER,
2582
- he as EVT_UNSELECT,
2583
- de as EVT_UPDATE,
2147
+ Kn as Arrows,
2148
+ oi as Control,
2149
+ ge as EVT_ADD,
2150
+ Wn as EVT_CANCEL_DRAWING,
2151
+ Xt as EVT_DRAG,
2152
+ Tt as EVT_DRAG_END,
2153
+ Zt as EVT_DRAG_START,
2154
+ Un as EVT_HOVER,
2155
+ Yn as EVT_LINK,
2156
+ pe as EVT_REMOVE,
2157
+ de as EVT_SELECT,
2158
+ Gn as EVT_UNHOVER,
2159
+ fe as EVT_UNSELECT,
2160
+ ye as EVT_UPDATE,
2584
2161
  V as NONE,
2585
- Yn as Texts,
2586
- ae as clientToContainerPosition,
2587
- Ln as createArrow,
2588
- Ot as createSVGElement,
2589
- Bn as createText,
2590
- _e as defaultArrowOptions,
2162
+ ei as Texts,
2163
+ ue as clientToContainerPosition,
2164
+ Nn as createArrow,
2165
+ Pt as createSVGElement,
2166
+ Jn as createText,
2167
+ Me as defaultArrowOptions,
2591
2168
  zt as defaultArrowStyle,
2592
- Le as defaultControllerOptions,
2593
- re as defaultTextOptions,
2594
- At as defaultTextStyle,
2595
- Zn as getAnnotationsBounds,
2596
- Bt as getArrowEnd,
2597
- Vt as getArrowEndPoints,
2598
- jt as getArrowSide,
2599
- Lt as getArrowStart,
2600
- Ft as getAttachmentPointOnNode,
2601
- qe as getHandleId,
2602
- He as getTextBbox,
2169
+ ze as defaultControllerOptions,
2170
+ le as defaultTextOptions,
2171
+ St as defaultTextStyle,
2172
+ si as getAnnotationsBounds,
2173
+ Wt as getArrowEnd,
2174
+ Yt as getArrowEndPoints,
2175
+ Rt as getArrowSide,
2176
+ $t as getArrowStart,
2177
+ Vt as getAttachmentPointOnNode,
2178
+ Ue as getHandleId,
2179
+ qe as getTextBbox,
2603
2180
  ct as getTextPosition,
2604
2181
  ut as getTextSize,
2605
- Pe as isAnnotationCollection,
2606
- ot as isArrow,
2607
- mt as isText,
2608
- Fe as setArrowEnd,
2609
- bt as setArrowEndPoint,
2610
- je as setArrowStart,
2611
- Pn as setTextBbox,
2612
- Cn as updateTextBbox
2182
+ Fe as isAnnotationCollection,
2183
+ st as isArrow,
2184
+ pt as isText,
2185
+ qn as scaleGeometry,
2186
+ Ve as setArrowEnd,
2187
+ At as setArrowEndPoint,
2188
+ Re as setArrowStart,
2189
+ Bn as setTextBbox,
2190
+ Fn as updateTextBbox
2613
2191
  };