@annotorious/annotorious 3.0.0-rc.23 → 3.0.0-rc.25
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/Annotorious.d.ts +5 -5
- package/dist/AnnotoriousOpts.d.ts +2 -2
- package/dist/AnnotoriousOpts.d.ts.map +1 -1
- package/dist/annotation/SVGAnnotationLayerPointerEvent.d.ts +1 -1
- package/dist/annotation/editors/editorsRegistry.d.ts +1 -1
- package/dist/annotation/tools/drawingToolsRegistry.d.ts +1 -1
- package/dist/annotation/utils/styling.d.ts +1 -1
- package/dist/annotorious.es.js +773 -761
- package/dist/annotorious.es.js.map +1 -1
- package/dist/annotorious.js +1 -1
- package/dist/annotorious.js.map +1 -1
- package/dist/model/core/ImageAnnotation.d.ts +1 -1
- package/dist/model/core/rectangle/rectangleUtils.d.ts +1 -1
- package/dist/model/w3c/W3CImageAnnotation.d.ts +2 -2
- package/dist/model/w3c/W3CImageFormatAdapter.d.ts +2 -2
- package/dist/state/ImageAnnotationStore.d.ts +1 -1
- package/dist/state/ImageAnnotatorState.d.ts +3 -3
- package/package.json +6 -6
- package/src/Annotorious.ts +1 -1
- package/src/AnnotoriousOpts.ts +2 -2
package/dist/annotorious.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var nn = Object.defineProperty;
|
|
2
2
|
var on = (e, t, n) => t in e ? nn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var Ke = (e, t, n) => (on(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
4
|
-
function
|
|
4
|
+
function F() {
|
|
5
5
|
}
|
|
6
6
|
function nt(e, t) {
|
|
7
7
|
for (const n in t)
|
|
@@ -11,19 +11,19 @@ function nt(e, t) {
|
|
|
11
11
|
e
|
|
12
12
|
);
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function Ut(e) {
|
|
15
15
|
return e();
|
|
16
16
|
}
|
|
17
17
|
function dt() {
|
|
18
18
|
return /* @__PURE__ */ Object.create(null);
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
e.forEach(
|
|
20
|
+
function ce(e) {
|
|
21
|
+
e.forEach(Ut);
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function K(e) {
|
|
24
24
|
return typeof e == "function";
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function J(e, t) {
|
|
27
27
|
return e != e ? t == t : e !== t || e && typeof e == "object" || typeof e == "function";
|
|
28
28
|
}
|
|
29
29
|
function sn(e) {
|
|
@@ -33,7 +33,7 @@ function Vt(e, ...t) {
|
|
|
33
33
|
if (e == null) {
|
|
34
34
|
for (const o of t)
|
|
35
35
|
o(void 0);
|
|
36
|
-
return
|
|
36
|
+
return F;
|
|
37
37
|
}
|
|
38
38
|
const n = e.subscribe(...t);
|
|
39
39
|
return n.unsubscribe ? () => n.unsubscribe() : n;
|
|
@@ -93,10 +93,10 @@ const fn = typeof window < "u" ? window : typeof globalThis < "u" ? globalThis :
|
|
|
93
93
|
// @ts-ignore Node typings have this
|
|
94
94
|
global
|
|
95
95
|
);
|
|
96
|
-
function
|
|
96
|
+
function re(e, t) {
|
|
97
97
|
e.appendChild(t);
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function O(e, t, n) {
|
|
100
100
|
e.insertBefore(t, n || null);
|
|
101
101
|
}
|
|
102
102
|
function k(e) {
|
|
@@ -106,19 +106,19 @@ function rt(e, t) {
|
|
|
106
106
|
for (let n = 0; n < e.length; n += 1)
|
|
107
107
|
e[n] && e[n].d(t);
|
|
108
108
|
}
|
|
109
|
-
function
|
|
109
|
+
function C(e) {
|
|
110
110
|
return document.createElementNS("http://www.w3.org/2000/svg", e);
|
|
111
111
|
}
|
|
112
112
|
function zt(e) {
|
|
113
113
|
return document.createTextNode(e);
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function ie() {
|
|
116
116
|
return zt(" ");
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function fe() {
|
|
119
119
|
return zt("");
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function j(e, t, n, o) {
|
|
122
122
|
return e.addEventListener(t, n, o), () => e.removeEventListener(t, n, o);
|
|
123
123
|
}
|
|
124
124
|
function h(e, t, n) {
|
|
@@ -163,7 +163,7 @@ function Te() {
|
|
|
163
163
|
return !0;
|
|
164
164
|
};
|
|
165
165
|
}
|
|
166
|
-
function
|
|
166
|
+
function de(e, t) {
|
|
167
167
|
const n = e.$$.callbacks[t.type];
|
|
168
168
|
n && n.slice().forEach((o) => o.call(this, t));
|
|
169
169
|
}
|
|
@@ -206,7 +206,7 @@ function Ft() {
|
|
|
206
206
|
}
|
|
207
207
|
function mn(e) {
|
|
208
208
|
if (e.fragment !== null) {
|
|
209
|
-
e.update(),
|
|
209
|
+
e.update(), ce(e.before_update);
|
|
210
210
|
const t = e.dirty;
|
|
211
211
|
e.dirty = [-1], e.fragment && e.fragment.p(e.ctx, t), e.after_update.forEach(it);
|
|
212
212
|
}
|
|
@@ -216,26 +216,26 @@ function pn(e) {
|
|
|
216
216
|
Ae.forEach((o) => e.indexOf(o) === -1 ? t.push(o) : n.push(o)), n.forEach((o) => o()), Ae = t;
|
|
217
217
|
}
|
|
218
218
|
const Ge = /* @__PURE__ */ new Set();
|
|
219
|
-
let
|
|
220
|
-
function
|
|
221
|
-
|
|
219
|
+
let he;
|
|
220
|
+
function le() {
|
|
221
|
+
he = {
|
|
222
222
|
r: 0,
|
|
223
223
|
c: [],
|
|
224
|
-
p:
|
|
224
|
+
p: he
|
|
225
225
|
// parent group
|
|
226
226
|
};
|
|
227
227
|
}
|
|
228
|
-
function
|
|
229
|
-
|
|
228
|
+
function ae() {
|
|
229
|
+
he.r || ce(he.c), he = he.p;
|
|
230
230
|
}
|
|
231
|
-
function
|
|
231
|
+
function I(e, t) {
|
|
232
232
|
e && e.i && (Ge.delete(e), e.i(t));
|
|
233
233
|
}
|
|
234
|
-
function
|
|
234
|
+
function X(e, t, n, o) {
|
|
235
235
|
if (e && e.o) {
|
|
236
236
|
if (Ge.has(e))
|
|
237
237
|
return;
|
|
238
|
-
Ge.add(e),
|
|
238
|
+
Ge.add(e), he.c.push(() => {
|
|
239
239
|
Ge.delete(e), o && (n && e.d(1), o());
|
|
240
240
|
}), e.o(t);
|
|
241
241
|
} else
|
|
@@ -244,24 +244,24 @@ function D(e, t, n, o) {
|
|
|
244
244
|
function Se(e) {
|
|
245
245
|
return (e == null ? void 0 : e.length) !== void 0 ? e : Array.from(e);
|
|
246
246
|
}
|
|
247
|
-
function
|
|
247
|
+
function te(e) {
|
|
248
248
|
e && e.c();
|
|
249
249
|
}
|
|
250
|
-
function
|
|
250
|
+
function $(e, t, n) {
|
|
251
251
|
const { fragment: o, after_update: i } = e.$$;
|
|
252
252
|
o && o.m(t, n), it(() => {
|
|
253
|
-
const s = e.$$.on_mount.map(
|
|
254
|
-
e.$$.on_destroy ? e.$$.on_destroy.push(...s) :
|
|
253
|
+
const s = e.$$.on_mount.map(Ut).filter(K);
|
|
254
|
+
e.$$.on_destroy ? e.$$.on_destroy.push(...s) : ce(s), e.$$.on_mount = [];
|
|
255
255
|
}), i.forEach(it);
|
|
256
256
|
}
|
|
257
|
-
function
|
|
257
|
+
function ee(e, t) {
|
|
258
258
|
const n = e.$$;
|
|
259
|
-
n.fragment !== null && (pn(n.after_update),
|
|
259
|
+
n.fragment !== null && (pn(n.after_update), ce(n.on_destroy), n.fragment && n.fragment.d(t), n.on_destroy = n.fragment = null, n.ctx = []);
|
|
260
260
|
}
|
|
261
261
|
function yn(e, t) {
|
|
262
262
|
e.$$.dirty[0] === -1 && (we.push(e), gn(), e.$$.dirty.fill(0)), e.$$.dirty[t / 31 | 0] |= 1 << t % 31;
|
|
263
263
|
}
|
|
264
|
-
function
|
|
264
|
+
function ne(e, t, n, o, i, s, r = null, l = [-1]) {
|
|
265
265
|
const a = Pe;
|
|
266
266
|
Ie(e);
|
|
267
267
|
const c = e.$$ = {
|
|
@@ -269,7 +269,7 @@ function ee(e, t, n, o, i, s, r = null, l = [-1]) {
|
|
|
269
269
|
ctx: [],
|
|
270
270
|
// state
|
|
271
271
|
props: s,
|
|
272
|
-
update:
|
|
272
|
+
update: F,
|
|
273
273
|
not_equal: i,
|
|
274
274
|
bound: dt(),
|
|
275
275
|
// lifecycle
|
|
@@ -290,17 +290,17 @@ function ee(e, t, n, o, i, s, r = null, l = [-1]) {
|
|
|
290
290
|
if (c.ctx = n ? n(e, t.props || {}, (f, d, ...g) => {
|
|
291
291
|
const m = g.length ? g[0] : d;
|
|
292
292
|
return c.ctx && i(c.ctx[f], c.ctx[f] = m) && (!c.skip_bound && c.bound[f] && c.bound[f](m), u && yn(e, f)), d;
|
|
293
|
-
}) : [], c.update(), u = !0,
|
|
293
|
+
}) : [], c.update(), u = !0, ce(c.before_update), c.fragment = o ? o(c.ctx) : !1, t.target) {
|
|
294
294
|
if (t.hydrate) {
|
|
295
295
|
const f = un(t.target);
|
|
296
296
|
c.fragment && c.fragment.l(f), f.forEach(k);
|
|
297
297
|
} else
|
|
298
298
|
c.fragment && c.fragment.c();
|
|
299
|
-
t.intro &&
|
|
299
|
+
t.intro && I(e.$$.fragment), $(e, t.target, t.anchor), Ft();
|
|
300
300
|
}
|
|
301
301
|
Ie(a);
|
|
302
302
|
}
|
|
303
|
-
class
|
|
303
|
+
class oe {
|
|
304
304
|
constructor() {
|
|
305
305
|
/**
|
|
306
306
|
* ### PRIVATE API
|
|
@@ -321,7 +321,7 @@ class te {
|
|
|
321
321
|
}
|
|
322
322
|
/** @returns {void} */
|
|
323
323
|
$destroy() {
|
|
324
|
-
|
|
324
|
+
ee(this, 1), this.$destroy = F;
|
|
325
325
|
}
|
|
326
326
|
/**
|
|
327
327
|
* @template {Extract<keyof Events, string>} K
|
|
@@ -330,8 +330,8 @@ class te {
|
|
|
330
330
|
* @returns {() => void}
|
|
331
331
|
*/
|
|
332
332
|
$on(t, n) {
|
|
333
|
-
if (!
|
|
334
|
-
return
|
|
333
|
+
if (!K(n))
|
|
334
|
+
return F;
|
|
335
335
|
const o = this.$$.callbacks[t] || (this.$$.callbacks[t] = []);
|
|
336
336
|
return o.push(n), () => {
|
|
337
337
|
const i = o.indexOf(n);
|
|
@@ -348,7 +348,7 @@ class te {
|
|
|
348
348
|
}
|
|
349
349
|
const _n = "4";
|
|
350
350
|
typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(_n);
|
|
351
|
-
var
|
|
351
|
+
var q = /* @__PURE__ */ ((e) => (e.ELLIPSE = "ELLIPSE", e.POLYGON = "POLYGON", e.RECTANGLE = "RECTANGLE", e))(q || {});
|
|
352
352
|
const lt = {}, at = (e, t) => lt[e] = t, st = (e) => lt[e.type].area(e), wn = (e, t, n) => lt[e.type].intersects(e, t, n), Fe = (e) => {
|
|
353
353
|
let t = 1 / 0, n = 1 / 0, o = -1 / 0, i = -1 / 0;
|
|
354
354
|
return e.forEach(([s, r]) => {
|
|
@@ -361,7 +361,7 @@ const lt = {}, at = (e, t) => lt[e] = t, st = (e) => lt[e.type].area(e), wn = (e
|
|
|
361
361
|
return d * d / (s * s) + g * g / (r * r) <= 1;
|
|
362
362
|
}
|
|
363
363
|
};
|
|
364
|
-
at(
|
|
364
|
+
at(q.ELLIPSE, bn);
|
|
365
365
|
const En = {
|
|
366
366
|
area: (e) => {
|
|
367
367
|
const { points: t } = e.geometry;
|
|
@@ -380,12 +380,12 @@ const En = {
|
|
|
380
380
|
return i;
|
|
381
381
|
}
|
|
382
382
|
};
|
|
383
|
-
at(
|
|
383
|
+
at(q.POLYGON, En);
|
|
384
384
|
const An = {
|
|
385
385
|
area: (e) => e.geometry.w * e.geometry.h,
|
|
386
386
|
intersects: (e, t, n) => t >= e.geometry.x && t <= e.geometry.x + e.geometry.w && n >= e.geometry.y && n <= e.geometry.y + e.geometry.h
|
|
387
387
|
};
|
|
388
|
-
at(
|
|
388
|
+
at(q.RECTANGLE, An);
|
|
389
389
|
const Sn = (e, t = !1) => {
|
|
390
390
|
const n = typeof e == "string" ? e : e.value, o = /^(xywh)=(pixel|percent)?:?(.+?),(.+?),(.+?),(.+)*/g, i = [...n.matchAll(o)][0], [s, r, l, a, c, u, f] = i;
|
|
391
391
|
if (r !== "xywh")
|
|
@@ -394,7 +394,7 @@ const Sn = (e, t = !1) => {
|
|
|
394
394
|
throw new Error(`Unsupported MediaFragment unit: ${l}`);
|
|
395
395
|
const [d, g, m, y] = [a, c, u, f].map(parseFloat);
|
|
396
396
|
return {
|
|
397
|
-
type:
|
|
397
|
+
type: q.RECTANGLE,
|
|
398
398
|
geometry: {
|
|
399
399
|
x: d,
|
|
400
400
|
y: g,
|
|
@@ -431,7 +431,7 @@ const Sn = (e, t = !1) => {
|
|
|
431
431
|
}, Ln = (e) => {
|
|
432
432
|
const [t, n, o] = e.match(/(<polygon points=["|'])([^("|')]*)/) || [], i = o.split(" ").map((s) => s.split(",").map(parseFloat));
|
|
433
433
|
return {
|
|
434
|
-
type:
|
|
434
|
+
type: q.POLYGON,
|
|
435
435
|
geometry: {
|
|
436
436
|
points: i,
|
|
437
437
|
bounds: Fe(i)
|
|
@@ -445,7 +445,7 @@ const Sn = (e, t = !1) => {
|
|
|
445
445
|
maxY: o + s
|
|
446
446
|
};
|
|
447
447
|
return {
|
|
448
|
-
type:
|
|
448
|
+
type: q.ELLIPSE,
|
|
449
449
|
geometry: {
|
|
450
450
|
cx: n,
|
|
451
451
|
cy: o,
|
|
@@ -463,10 +463,10 @@ const Sn = (e, t = !1) => {
|
|
|
463
463
|
throw "Unsupported SVG shape: " + t;
|
|
464
464
|
}, Bn = (e) => {
|
|
465
465
|
let t;
|
|
466
|
-
if (e.type ===
|
|
466
|
+
if (e.type === q.POLYGON) {
|
|
467
467
|
const n = e.geometry, { points: o } = n;
|
|
468
468
|
t = `<svg><polygon points="${o.map((i) => i.join(",")).join(" ")}" /></svg>`;
|
|
469
|
-
} else if (e.type ===
|
|
469
|
+
} else if (e.type === q.ELLIPSE) {
|
|
470
470
|
const n = e.geometry;
|
|
471
471
|
t = `<svg><ellipse cx="${n.cx}" cy="${n.cy}" rx="${n.rx}" ry="${n.ry}" /></svg>`;
|
|
472
472
|
}
|
|
@@ -474,21 +474,21 @@ const Sn = (e, t = !1) => {
|
|
|
474
474
|
return { type: "SvgSelector", value: t };
|
|
475
475
|
throw `Unsupported shape type: ${e.type}`;
|
|
476
476
|
};
|
|
477
|
-
let
|
|
477
|
+
let Ne;
|
|
478
478
|
const In = new Uint8Array(16);
|
|
479
479
|
function Pn() {
|
|
480
|
-
if (!
|
|
480
|
+
if (!Ne && (Ne = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !Ne))
|
|
481
481
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
482
|
-
return
|
|
482
|
+
return Ne(In);
|
|
483
483
|
}
|
|
484
|
-
const
|
|
484
|
+
const W = [];
|
|
485
485
|
for (let e = 0; e < 256; ++e)
|
|
486
|
-
|
|
486
|
+
W.push((e + 256).toString(16).slice(1));
|
|
487
487
|
function Yn(e, t = 0) {
|
|
488
|
-
return
|
|
488
|
+
return W[e[t + 0]] + W[e[t + 1]] + W[e[t + 2]] + W[e[t + 3]] + "-" + W[e[t + 4]] + W[e[t + 5]] + "-" + W[e[t + 6]] + W[e[t + 7]] + "-" + W[e[t + 8]] + W[e[t + 9]] + "-" + W[e[t + 10]] + W[e[t + 11]] + W[e[t + 12]] + W[e[t + 13]] + W[e[t + 14]] + W[e[t + 15]];
|
|
489
489
|
}
|
|
490
|
-
const
|
|
491
|
-
randomUUID:
|
|
490
|
+
const Dn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), yt = {
|
|
491
|
+
randomUUID: Dn
|
|
492
492
|
};
|
|
493
493
|
function qt(e, t, n) {
|
|
494
494
|
if (yt.randomUUID && !t && !e)
|
|
@@ -498,7 +498,7 @@ function qt(e, t, n) {
|
|
|
498
498
|
return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, Yn(o);
|
|
499
499
|
}
|
|
500
500
|
var _t = Object.prototype.hasOwnProperty;
|
|
501
|
-
function
|
|
501
|
+
function ge(e, t) {
|
|
502
502
|
var n, o;
|
|
503
503
|
if (e === t)
|
|
504
504
|
return !0;
|
|
@@ -509,14 +509,14 @@ function de(e, t) {
|
|
|
509
509
|
return e.toString() === t.toString();
|
|
510
510
|
if (n === Array) {
|
|
511
511
|
if ((o = e.length) === t.length)
|
|
512
|
-
for (; o-- &&
|
|
512
|
+
for (; o-- && ge(e[o], t[o]); )
|
|
513
513
|
;
|
|
514
514
|
return o === -1;
|
|
515
515
|
}
|
|
516
516
|
if (!n || typeof e == "object") {
|
|
517
517
|
o = 0;
|
|
518
518
|
for (n in e)
|
|
519
|
-
if (_t.call(e, n) && ++o && !_t.call(t, n) || !(n in t) || !
|
|
519
|
+
if (_t.call(e, n) && ++o && !_t.call(t, n) || !(n in t) || !ge(e[n], t[n]))
|
|
520
520
|
return !1;
|
|
521
521
|
return Object.keys(t).length === o;
|
|
522
522
|
}
|
|
@@ -525,7 +525,7 @@ function de(e, t) {
|
|
|
525
525
|
}
|
|
526
526
|
function Je() {
|
|
527
527
|
}
|
|
528
|
-
function
|
|
528
|
+
function Xn(e, t) {
|
|
529
529
|
return e != e ? t == t : e !== t || e && typeof e == "object" || typeof e == "function";
|
|
530
530
|
}
|
|
531
531
|
const pe = [];
|
|
@@ -533,7 +533,7 @@ function ct(e, t = Je) {
|
|
|
533
533
|
let n;
|
|
534
534
|
const o = /* @__PURE__ */ new Set();
|
|
535
535
|
function i(l) {
|
|
536
|
-
if (
|
|
536
|
+
if (Xn(e, l) && (e = l, n)) {
|
|
537
537
|
const a = !pe.length;
|
|
538
538
|
for (const c of o)
|
|
539
539
|
c[1](), pe.push(c, e);
|
|
@@ -555,7 +555,7 @@ function ct(e, t = Je) {
|
|
|
555
555
|
}
|
|
556
556
|
return { set: i, update: s, subscribe: r };
|
|
557
557
|
}
|
|
558
|
-
const
|
|
558
|
+
const Cn = (e) => {
|
|
559
559
|
const { subscribe: t, set: n } = ct();
|
|
560
560
|
let o;
|
|
561
561
|
return t((i) => o = i), e.observe(({ changes: i }) => {
|
|
@@ -573,11 +573,11 @@ const Xn = (e) => {
|
|
|
573
573
|
};
|
|
574
574
|
};
|
|
575
575
|
var Kt = /* @__PURE__ */ ((e) => (e.EDIT = "EDIT", e.SELECT = "SELECT", e.NONE = "NONE", e))(Kt || {});
|
|
576
|
-
const
|
|
577
|
-
const { subscribe: n, set: o } = ct(
|
|
578
|
-
let i =
|
|
576
|
+
const Qe = { selected: [] }, Rn = (e, t = "EDIT") => {
|
|
577
|
+
const { subscribe: n, set: o } = ct(Qe);
|
|
578
|
+
let i = Qe;
|
|
579
579
|
n((f) => i = f);
|
|
580
|
-
const s = () => o(
|
|
580
|
+
const s = () => o(Qe), r = () => {
|
|
581
581
|
var f;
|
|
582
582
|
return ((f = i.selected) == null ? void 0 : f.length) === 0;
|
|
583
583
|
}, l = (f) => {
|
|
@@ -588,7 +588,7 @@ const Ze = { selected: [] }, Rn = (e, t = "EDIT") => {
|
|
|
588
588
|
}, a = (f, d) => {
|
|
589
589
|
const g = e.getAnnotation(f);
|
|
590
590
|
if (g) {
|
|
591
|
-
const m =
|
|
591
|
+
const m = Nn(g, t);
|
|
592
592
|
o(m === "EDIT" ? { selected: [{ id: f, editable: !0 }], pointerEvent: d } : m === "SELECT" ? { selected: [{ id: f }], pointerEvent: d } : { selected: [], pointerEvent: d });
|
|
593
593
|
} else
|
|
594
594
|
console.warn("Invalid selection: " + f);
|
|
@@ -615,9 +615,9 @@ const Ze = { selected: [] }, Rn = (e, t = "EDIT") => {
|
|
|
615
615
|
setSelected: c,
|
|
616
616
|
subscribe: n
|
|
617
617
|
};
|
|
618
|
-
},
|
|
618
|
+
}, Nn = (e, t) => typeof t == "function" ? t(e) || "EDIT" : t || "EDIT", Un = [];
|
|
619
619
|
for (let e = 0; e < 256; ++e)
|
|
620
|
-
|
|
620
|
+
Un.push((e + 256).toString(16).slice(1));
|
|
621
621
|
typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
622
622
|
const Vn = (e, t) => {
|
|
623
623
|
const n = new Set(e.bodies.map((o) => o.id));
|
|
@@ -627,8 +627,8 @@ const Vn = (e, t) => {
|
|
|
627
627
|
return e.bodies.filter((o) => !n.has(o.id));
|
|
628
628
|
}, zn = (e, t) => t.bodies.map((n) => {
|
|
629
629
|
const o = e.bodies.find((i) => i.id === n.id);
|
|
630
|
-
return { newBody: n, oldBody: o && !
|
|
631
|
-
}).filter(({ oldBody: n }) => n).map(({ oldBody: n, newBody: o }) => ({ oldBody: n, newBody: o })), Hn = (e, t) => !
|
|
630
|
+
return { newBody: n, oldBody: o && !ge(o, n) ? o : void 0 };
|
|
631
|
+
}).filter(({ oldBody: n }) => n).map(({ oldBody: n, newBody: o }) => ({ oldBody: n, newBody: o })), Hn = (e, t) => !ge(e.target, t.target), Wt = (e, t) => {
|
|
632
632
|
const n = Vn(e, t), o = Gn(e, t), i = zn(e, t);
|
|
633
633
|
return {
|
|
634
634
|
oldValue: e,
|
|
@@ -639,7 +639,7 @@ const Vn = (e, t) => {
|
|
|
639
639
|
targetUpdated: Hn(e, t) ? { oldTarget: e.target, newTarget: t.target } : void 0
|
|
640
640
|
};
|
|
641
641
|
};
|
|
642
|
-
var
|
|
642
|
+
var H = /* @__PURE__ */ ((e) => (e.LOCAL = "LOCAL", e.REMOTE = "REMOTE", e))(H || {});
|
|
643
643
|
const Fn = (e, t) => {
|
|
644
644
|
var n, o;
|
|
645
645
|
const { changes: i, origin: s } = t;
|
|
@@ -682,188 +682,195 @@ const Fn = (e, t) => {
|
|
|
682
682
|
];
|
|
683
683
|
return { created: a, deleted: c, updated: u };
|
|
684
684
|
}, qn = (e) => e.id !== void 0, Kn = () => {
|
|
685
|
-
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = [], o = (
|
|
686
|
-
const
|
|
687
|
-
|
|
688
|
-
}, s = (
|
|
685
|
+
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = [], o = (w, S = {}) => n.push({ onChange: w, options: S }), i = (w) => {
|
|
686
|
+
const S = n.findIndex((T) => T.onChange == w);
|
|
687
|
+
S > -1 && n.splice(S, 1);
|
|
688
|
+
}, s = (w, S) => {
|
|
689
689
|
const T = {
|
|
690
|
-
origin:
|
|
690
|
+
origin: w,
|
|
691
691
|
changes: {
|
|
692
|
-
created:
|
|
693
|
-
updated:
|
|
694
|
-
deleted:
|
|
692
|
+
created: S.created || [],
|
|
693
|
+
updated: S.updated || [],
|
|
694
|
+
deleted: S.deleted || []
|
|
695
695
|
},
|
|
696
696
|
state: [...e.values()]
|
|
697
697
|
};
|
|
698
698
|
n.forEach((M) => {
|
|
699
699
|
Fn(M, T) && M.onChange(T);
|
|
700
700
|
});
|
|
701
|
-
}, r = (
|
|
702
|
-
if (e.get(
|
|
703
|
-
throw Error(`Cannot add annotation ${
|
|
704
|
-
e.set(
|
|
705
|
-
}, l = (
|
|
706
|
-
const T = typeof
|
|
707
|
-
if (
|
|
708
|
-
const
|
|
709
|
-
return M === T.id ? e.set(M, T) : (e.delete(M), e.set(T.id, T)),
|
|
701
|
+
}, r = (w, S = H.LOCAL) => {
|
|
702
|
+
if (e.get(w.id))
|
|
703
|
+
throw Error(`Cannot add annotation ${w.id} - exists already`);
|
|
704
|
+
e.set(w.id, w), w.bodies.forEach((T) => t.set(T.id, w.id)), s(S, { created: [w] });
|
|
705
|
+
}, l = (w, S) => {
|
|
706
|
+
const T = typeof w == "string" ? S : w, M = typeof w == "string" ? w : w.id, P = e.get(M);
|
|
707
|
+
if (P) {
|
|
708
|
+
const G = Wt(P, T);
|
|
709
|
+
return M === T.id ? e.set(M, T) : (e.delete(M), e.set(T.id, T)), P.bodies.forEach((x) => t.delete(x.id)), T.bodies.forEach((x) => t.set(x.id, T.id)), G;
|
|
710
710
|
} else
|
|
711
711
|
console.warn(`Cannot update annotation ${M} - does not exist`);
|
|
712
|
-
}, a = (
|
|
713
|
-
const M = qn(
|
|
714
|
-
|
|
715
|
-
}, c = (
|
|
716
|
-
const T =
|
|
717
|
-
const
|
|
718
|
-
return
|
|
712
|
+
}, a = (w, S = H.LOCAL, T = H.LOCAL) => {
|
|
713
|
+
const M = qn(S) ? T : S, P = l(w, S);
|
|
714
|
+
P && s(M, { updated: [P] });
|
|
715
|
+
}, c = (w, S = H.LOCAL) => {
|
|
716
|
+
const T = w.reduce((M, P) => {
|
|
717
|
+
const G = l(P);
|
|
718
|
+
return G ? [...M, G] : M;
|
|
719
719
|
}, []);
|
|
720
|
-
T.length > 0 && s(
|
|
721
|
-
}, u = (
|
|
722
|
-
const T = e.get(
|
|
720
|
+
T.length > 0 && s(S, { updated: T });
|
|
721
|
+
}, u = (w, S = H.LOCAL) => {
|
|
722
|
+
const T = e.get(w.annotation);
|
|
723
723
|
if (T) {
|
|
724
724
|
const M = {
|
|
725
725
|
...T,
|
|
726
|
-
bodies: [...T.bodies,
|
|
726
|
+
bodies: [...T.bodies, w]
|
|
727
727
|
};
|
|
728
|
-
e.set(T.id, M), t.set(
|
|
728
|
+
e.set(T.id, M), t.set(w.id, M.id), s(S, { updated: [{
|
|
729
729
|
oldValue: T,
|
|
730
730
|
newValue: M,
|
|
731
|
-
bodiesCreated: [
|
|
731
|
+
bodiesCreated: [w]
|
|
732
732
|
}] });
|
|
733
733
|
} else
|
|
734
|
-
console.warn(`Attempt to add body to missing annotation: ${
|
|
735
|
-
}, f = () => [...e.values()], d = (
|
|
736
|
-
const
|
|
737
|
-
e.clear(), t.clear(), s(
|
|
738
|
-
}, g = (
|
|
739
|
-
if (
|
|
734
|
+
console.warn(`Attempt to add body to missing annotation: ${w.annotation}`);
|
|
735
|
+
}, f = () => [...e.values()], d = (w = H.LOCAL) => {
|
|
736
|
+
const S = [...e.values()];
|
|
737
|
+
e.clear(), t.clear(), s(w, { deleted: S });
|
|
738
|
+
}, g = (w, S = !0, T = H.LOCAL) => {
|
|
739
|
+
if (S) {
|
|
740
740
|
const M = [...e.values()];
|
|
741
|
-
e.clear(), t.clear(),
|
|
742
|
-
e.set(
|
|
743
|
-
}), s(T, { created:
|
|
741
|
+
e.clear(), t.clear(), w.forEach((P) => {
|
|
742
|
+
e.set(P.id, P), P.bodies.forEach((G) => t.set(G.id, P.id));
|
|
743
|
+
}), s(T, { created: w, deleted: M });
|
|
744
744
|
} else {
|
|
745
|
-
const M =
|
|
746
|
-
const
|
|
747
|
-
return
|
|
745
|
+
const M = w.reduce((P, G) => {
|
|
746
|
+
const x = e.get(G.id);
|
|
747
|
+
return x ? [...P, x] : P;
|
|
748
748
|
}, []);
|
|
749
749
|
if (M.length > 0)
|
|
750
|
-
throw Error(`Bulk insert would overwrite the following annotations: ${M.map((
|
|
751
|
-
|
|
752
|
-
e.set(
|
|
753
|
-
}), s(T, { created:
|
|
750
|
+
throw Error(`Bulk insert would overwrite the following annotations: ${M.map((P) => P.id).join(", ")}`);
|
|
751
|
+
w.forEach((P) => {
|
|
752
|
+
e.set(P.id, P), P.bodies.forEach((G) => t.set(G.id, P.id));
|
|
753
|
+
}), s(T, { created: w });
|
|
754
754
|
}
|
|
755
|
-
}, m = (
|
|
756
|
-
const
|
|
755
|
+
}, m = (w) => {
|
|
756
|
+
const S = typeof w == "string" ? w : w.id, T = e.get(S);
|
|
757
757
|
if (T)
|
|
758
|
-
return e.delete(
|
|
759
|
-
console.warn(`Attempt to delete missing annotation: ${
|
|
760
|
-
}, y = (
|
|
761
|
-
const T = m(
|
|
762
|
-
T && s(
|
|
763
|
-
},
|
|
764
|
-
const T =
|
|
765
|
-
const
|
|
766
|
-
return
|
|
758
|
+
return e.delete(S), T.bodies.forEach((M) => t.delete(M.id)), T;
|
|
759
|
+
console.warn(`Attempt to delete missing annotation: ${S}`);
|
|
760
|
+
}, y = (w, S = H.LOCAL) => {
|
|
761
|
+
const T = m(w);
|
|
762
|
+
T && s(S, { deleted: [T] });
|
|
763
|
+
}, b = (w, S = H.LOCAL) => {
|
|
764
|
+
const T = w.reduce((M, P) => {
|
|
765
|
+
const G = m(P);
|
|
766
|
+
return G ? [...M, G] : M;
|
|
767
767
|
}, []);
|
|
768
|
-
T.length > 0 && s(
|
|
769
|
-
}, p = (
|
|
770
|
-
const
|
|
771
|
-
if (
|
|
772
|
-
const
|
|
773
|
-
if (
|
|
774
|
-
t.delete(
|
|
775
|
-
const
|
|
776
|
-
...
|
|
777
|
-
bodies:
|
|
768
|
+
T.length > 0 && s(S, { deleted: T });
|
|
769
|
+
}, p = (w) => {
|
|
770
|
+
const S = e.get(w.annotation);
|
|
771
|
+
if (S) {
|
|
772
|
+
const T = S.bodies.find((M) => M.id === w.id);
|
|
773
|
+
if (T) {
|
|
774
|
+
t.delete(T.id);
|
|
775
|
+
const M = {
|
|
776
|
+
...S,
|
|
777
|
+
bodies: S.bodies.filter((P) => P.id !== w.id)
|
|
778
|
+
};
|
|
779
|
+
return e.set(S.id, M), {
|
|
780
|
+
oldValue: S,
|
|
781
|
+
newValue: M,
|
|
782
|
+
bodiesDeleted: [T]
|
|
778
783
|
};
|
|
779
|
-
e.set(T.id, O), s(b, { updated: [{
|
|
780
|
-
oldValue: T,
|
|
781
|
-
newValue: O,
|
|
782
|
-
bodiesDeleted: [M]
|
|
783
|
-
}] });
|
|
784
784
|
} else
|
|
785
|
-
console.warn(`Attempt to delete missing body ${
|
|
785
|
+
console.warn(`Attempt to delete missing body ${w.id} from annotation ${w.annotation}`);
|
|
786
786
|
} else
|
|
787
|
-
console.warn(`Attempt to delete body from missing annotation ${
|
|
788
|
-
}, S =
|
|
789
|
-
const
|
|
790
|
-
|
|
791
|
-
}, w =
|
|
792
|
-
const
|
|
793
|
-
|
|
794
|
-
|
|
787
|
+
console.warn(`Attempt to delete body from missing annotation ${w.annotation}`);
|
|
788
|
+
}, A = (w, S = H.LOCAL) => {
|
|
789
|
+
const T = p(w);
|
|
790
|
+
T && s(S, { updated: [T] });
|
|
791
|
+
}, _ = (w, S = H.LOCAL) => {
|
|
792
|
+
const T = w.map((M) => p(M)).filter(Boolean);
|
|
793
|
+
T.length > 0 && s(S, { updated: T });
|
|
794
|
+
}, E = (w) => {
|
|
795
|
+
const S = e.get(w);
|
|
796
|
+
return S ? { ...S } : void 0;
|
|
797
|
+
}, B = (w) => {
|
|
798
|
+
const S = t.get(w);
|
|
799
|
+
if (S) {
|
|
800
|
+
const T = E(S).bodies.find((M) => M.id === w);
|
|
795
801
|
if (T)
|
|
796
802
|
return T;
|
|
797
|
-
console.error(`Store integrity error: body ${
|
|
803
|
+
console.error(`Store integrity error: body ${w} in index, but not in annotation`);
|
|
798
804
|
} else
|
|
799
|
-
console.warn(`Attempt to retrieve missing body: ${
|
|
800
|
-
},
|
|
801
|
-
if (
|
|
805
|
+
console.warn(`Attempt to retrieve missing body: ${w}`);
|
|
806
|
+
}, V = (w, S) => {
|
|
807
|
+
if (w.annotation !== S.annotation)
|
|
802
808
|
throw "Annotation integrity violation: annotation ID must be the same when updating bodies";
|
|
803
|
-
const T = e.get(
|
|
809
|
+
const T = e.get(w.annotation);
|
|
804
810
|
if (T) {
|
|
805
|
-
const M = T.bodies.find((
|
|
811
|
+
const M = T.bodies.find((G) => G.id === w.id), P = {
|
|
806
812
|
...T,
|
|
807
|
-
bodies: T.bodies.map((
|
|
813
|
+
bodies: T.bodies.map((G) => G.id === M.id ? S : G)
|
|
808
814
|
};
|
|
809
|
-
return e.set(T.id,
|
|
815
|
+
return e.set(T.id, P), M.id !== S.id && (t.delete(M.id), t.set(S.id, P.id)), {
|
|
810
816
|
oldValue: T,
|
|
811
|
-
newValue:
|
|
812
|
-
bodiesUpdated: [{ oldBody: M, newBody:
|
|
817
|
+
newValue: P,
|
|
818
|
+
bodiesUpdated: [{ oldBody: M, newBody: S }]
|
|
813
819
|
};
|
|
814
820
|
} else
|
|
815
|
-
console.warn(`Attempt to add body to missing annotation ${
|
|
816
|
-
},
|
|
817
|
-
const M =
|
|
821
|
+
console.warn(`Attempt to add body to missing annotation ${w.annotation}`);
|
|
822
|
+
}, U = (w, S, T = H.LOCAL) => {
|
|
823
|
+
const M = V(w, S);
|
|
818
824
|
M && s(T, { updated: [M] });
|
|
819
|
-
},
|
|
820
|
-
const T =
|
|
821
|
-
s(
|
|
822
|
-
},
|
|
823
|
-
const
|
|
824
|
-
if (
|
|
825
|
+
}, R = (w, S = H.LOCAL) => {
|
|
826
|
+
const T = w.map((M) => V({ id: M.id, annotation: M.annotation }, M)).filter(Boolean);
|
|
827
|
+
s(S, { updated: T });
|
|
828
|
+
}, Y = (w) => {
|
|
829
|
+
const S = e.get(w.annotation);
|
|
830
|
+
if (S) {
|
|
825
831
|
const T = {
|
|
826
|
-
...
|
|
832
|
+
...S,
|
|
827
833
|
target: {
|
|
828
|
-
...
|
|
829
|
-
...
|
|
834
|
+
...S.target,
|
|
835
|
+
...w
|
|
830
836
|
}
|
|
831
837
|
};
|
|
832
|
-
return e.set(
|
|
833
|
-
oldValue:
|
|
838
|
+
return e.set(S.id, T), {
|
|
839
|
+
oldValue: S,
|
|
834
840
|
newValue: T,
|
|
835
841
|
targetUpdated: {
|
|
836
|
-
oldTarget:
|
|
837
|
-
newTarget:
|
|
842
|
+
oldTarget: S.target,
|
|
843
|
+
newTarget: w
|
|
838
844
|
}
|
|
839
845
|
};
|
|
840
846
|
} else
|
|
841
|
-
console.warn(`Attempt to update target on missing annotation: ${
|
|
847
|
+
console.warn(`Attempt to update target on missing annotation: ${w.annotation}`);
|
|
842
848
|
};
|
|
843
849
|
return {
|
|
844
850
|
addAnnotation: r,
|
|
845
851
|
addBody: u,
|
|
846
852
|
all: f,
|
|
847
853
|
bulkAddAnnotation: g,
|
|
848
|
-
bulkDeleteAnnotation:
|
|
854
|
+
bulkDeleteAnnotation: b,
|
|
855
|
+
bulkDeleteBodies: _,
|
|
849
856
|
bulkUpdateAnnotation: c,
|
|
850
|
-
bulkUpdateBodies:
|
|
851
|
-
bulkUpdateTargets: (
|
|
852
|
-
const T =
|
|
853
|
-
T.length > 0 && s(
|
|
857
|
+
bulkUpdateBodies: R,
|
|
858
|
+
bulkUpdateTargets: (w, S = H.LOCAL) => {
|
|
859
|
+
const T = w.map((M) => Y(M)).filter(Boolean);
|
|
860
|
+
T.length > 0 && s(S, { updated: T });
|
|
854
861
|
},
|
|
855
862
|
clear: d,
|
|
856
863
|
deleteAnnotation: y,
|
|
857
|
-
deleteBody:
|
|
858
|
-
getAnnotation:
|
|
859
|
-
getBody:
|
|
864
|
+
deleteBody: A,
|
|
865
|
+
getAnnotation: E,
|
|
866
|
+
getBody: B,
|
|
860
867
|
observe: o,
|
|
861
868
|
unobserve: i,
|
|
862
869
|
updateAnnotation: a,
|
|
863
|
-
updateBody:
|
|
864
|
-
updateTarget: (
|
|
865
|
-
const T =
|
|
866
|
-
T && s(
|
|
870
|
+
updateBody: U,
|
|
871
|
+
updateTarget: (w, S = H.LOCAL) => {
|
|
872
|
+
const T = Y(w);
|
|
873
|
+
T && s(S, { updated: [T] });
|
|
867
874
|
}
|
|
868
875
|
};
|
|
869
876
|
}, Wn = (e) => ({
|
|
@@ -887,23 +894,23 @@ let Jn = () => ({
|
|
|
887
894
|
};
|
|
888
895
|
}
|
|
889
896
|
});
|
|
890
|
-
const
|
|
897
|
+
const Qn = 250, Zn = (e) => {
|
|
891
898
|
const t = Jn(), n = [];
|
|
892
899
|
let o = -1, i = !1, s = 0;
|
|
893
900
|
const r = (g) => {
|
|
894
901
|
if (!i) {
|
|
895
902
|
const { changes: m } = g, y = performance.now();
|
|
896
|
-
if (y - s >
|
|
903
|
+
if (y - s > Qn)
|
|
897
904
|
n.splice(o + 1), n.push(m), o = n.length - 1;
|
|
898
905
|
else {
|
|
899
|
-
const
|
|
900
|
-
n[
|
|
906
|
+
const b = n.length - 1;
|
|
907
|
+
n[b] = jn(n[b], m);
|
|
901
908
|
}
|
|
902
909
|
s = y;
|
|
903
910
|
}
|
|
904
911
|
i = !1;
|
|
905
912
|
};
|
|
906
|
-
e.observe(r, { origin:
|
|
913
|
+
e.observe(r, { origin: H.LOCAL });
|
|
907
914
|
const l = (g) => g && g.length > 0 && e.bulkDeleteAnnotation(g), a = (g) => g && g.length > 0 && e.bulkAddAnnotation(g, !1), c = (g) => g && g.length > 0 && e.bulkUpdateAnnotation(g.map(({ oldValue: m }) => m)), u = (g) => g && g.length > 0 && e.bulkUpdateAnnotation(g.map(({ newValue: m }) => m)), f = (g) => g && g.length > 0 && e.bulkAddAnnotation(g, !1), d = (g) => g && g.length > 0 && e.bulkDeleteAnnotation(g);
|
|
908
915
|
return {
|
|
909
916
|
canRedo: () => n.length - 1 > o,
|
|
@@ -934,75 +941,75 @@ const Zn = 250, Qn = (e) => {
|
|
|
934
941
|
}, $n = (e, t, n, o) => {
|
|
935
942
|
const { store: i, selection: s, hover: r, viewport: l } = e, a = /* @__PURE__ */ new Map();
|
|
936
943
|
let c = [], u, f;
|
|
937
|
-
const d = (p,
|
|
938
|
-
a.has(p) ? a.get(p).push(
|
|
939
|
-
}, g = (p,
|
|
940
|
-
const
|
|
941
|
-
|
|
942
|
-
}, m = (p,
|
|
944
|
+
const d = (p, A) => {
|
|
945
|
+
a.has(p) ? a.get(p).push(A) : a.set(p, [A]);
|
|
946
|
+
}, g = (p, A) => {
|
|
947
|
+
const _ = a.get(p);
|
|
948
|
+
_ && _.indexOf(A) > 0 && _.splice(_.indexOf(A), 1);
|
|
949
|
+
}, m = (p, A, _) => {
|
|
943
950
|
a.has(p) && setTimeout(() => {
|
|
944
|
-
a.get(p).forEach((
|
|
951
|
+
a.get(p).forEach((E) => {
|
|
945
952
|
if (n) {
|
|
946
|
-
const
|
|
947
|
-
|
|
953
|
+
const B = Array.isArray(A) ? A.map((U) => n.serialize(U)) : n.serialize(A), V = _ ? _ instanceof PointerEvent ? _ : n.serialize(_) : void 0;
|
|
954
|
+
E(B, V);
|
|
948
955
|
} else
|
|
949
|
-
A
|
|
956
|
+
E(A, _);
|
|
950
957
|
});
|
|
951
958
|
}, 1);
|
|
952
959
|
}, y = () => {
|
|
953
|
-
const { selected: p } = s,
|
|
954
|
-
|
|
955
|
-
const
|
|
956
|
-
(!
|
|
957
|
-
}), c = c.map((
|
|
960
|
+
const { selected: p } = s, A = (p || []).map(({ id: _ }) => i.getAnnotation(_));
|
|
961
|
+
A.forEach((_) => {
|
|
962
|
+
const E = c.find((B) => B.id === _.id);
|
|
963
|
+
(!E || !ge(E, _)) && m("updateAnnotation", _, E);
|
|
964
|
+
}), c = c.map((_) => A.find(({ id: B }) => B === _.id) || _);
|
|
958
965
|
};
|
|
959
966
|
s.subscribe(({ selected: p }) => {
|
|
960
967
|
if (!(c.length === 0 && p.length === 0)) {
|
|
961
968
|
if (c.length === 0 && p.length > 0)
|
|
962
|
-
c = p.map(({ id:
|
|
969
|
+
c = p.map(({ id: A }) => i.getAnnotation(A));
|
|
963
970
|
else if (c.length > 0 && p.length === 0)
|
|
964
|
-
c.forEach((
|
|
965
|
-
const
|
|
966
|
-
|
|
971
|
+
c.forEach((A) => {
|
|
972
|
+
const _ = i.getAnnotation(A.id);
|
|
973
|
+
_ && !ge(_, A) && m("updateAnnotation", _, A);
|
|
967
974
|
}), c = [];
|
|
968
975
|
else {
|
|
969
|
-
const
|
|
970
|
-
c.filter((
|
|
971
|
-
const
|
|
972
|
-
|
|
976
|
+
const A = new Set(c.map((E) => E.id)), _ = new Set(p.map(({ id: E }) => E));
|
|
977
|
+
c.filter((E) => !_.has(E.id)).forEach((E) => {
|
|
978
|
+
const B = i.getAnnotation(E.id);
|
|
979
|
+
B && !ge(B, E) && m("updateAnnotation", B, E);
|
|
973
980
|
}), c = [
|
|
974
981
|
// Remove annotations that were deselected
|
|
975
|
-
...c.filter((
|
|
982
|
+
...c.filter((E) => _.has(E.id)),
|
|
976
983
|
// Add editable annotations that were selected
|
|
977
|
-
...p.filter(({ id:
|
|
984
|
+
...p.filter(({ id: E }) => !A.has(E)).map(({ id: E }) => i.getAnnotation(E))
|
|
978
985
|
];
|
|
979
986
|
}
|
|
980
987
|
m("selectionChanged", c);
|
|
981
988
|
}
|
|
982
989
|
}), r.subscribe((p) => {
|
|
983
990
|
!u && p ? m("mouseEnterAnnotation", i.getAnnotation(p)) : u && !p ? m("mouseLeaveAnnotation", i.getAnnotation(u)) : u && p && (m("mouseLeaveAnnotation", i.getAnnotation(u)), m("mouseEnterAnnotation", i.getAnnotation(p))), u = p;
|
|
984
|
-
}), l == null || l.subscribe((p) => m("viewportIntersect", p.map((
|
|
991
|
+
}), l == null || l.subscribe((p) => m("viewportIntersect", p.map((A) => i.getAnnotation(A)))), i.observe((p) => {
|
|
985
992
|
o && (f && clearTimeout(f), f = setTimeout(y, 1e3));
|
|
986
|
-
const { created:
|
|
987
|
-
(
|
|
988
|
-
...
|
|
989
|
-
...
|
|
990
|
-
...
|
|
991
|
-
].length > 0).forEach(({ oldValue:
|
|
992
|
-
const
|
|
993
|
-
c = c.map((U) => U.id ===
|
|
993
|
+
const { created: A, deleted: _ } = p.changes;
|
|
994
|
+
(A || []).forEach((E) => m("createAnnotation", E)), (_ || []).forEach((E) => m("deleteAnnotation", E)), (p.changes.updated || []).filter((E) => [
|
|
995
|
+
...E.bodiesCreated || [],
|
|
996
|
+
...E.bodiesDeleted || [],
|
|
997
|
+
...E.bodiesUpdated || []
|
|
998
|
+
].length > 0).forEach(({ oldValue: E, newValue: B }) => {
|
|
999
|
+
const V = c.find((U) => U.id === E.id) || E;
|
|
1000
|
+
c = c.map((U) => U.id === E.id ? B : U), m("updateAnnotation", B, V);
|
|
994
1001
|
});
|
|
995
|
-
}, { origin:
|
|
1002
|
+
}, { origin: H.LOCAL }), i.observe((p) => {
|
|
996
1003
|
if (c) {
|
|
997
|
-
const
|
|
998
|
-
|
|
1004
|
+
const A = new Set(c.map((E) => E.id)), _ = (p.changes.updated || []).filter(({ newValue: E }) => A.has(E.id)).map(({ newValue: E }) => E);
|
|
1005
|
+
_.length > 0 && (c = c.map((E) => _.find((V) => V.id === E.id) || E));
|
|
999
1006
|
}
|
|
1000
|
-
}, { origin:
|
|
1001
|
-
const
|
|
1002
|
-
const { updated:
|
|
1003
|
-
p ? (
|
|
1007
|
+
}, { origin: H.REMOTE });
|
|
1008
|
+
const b = (p) => (A) => {
|
|
1009
|
+
const { updated: _ } = A;
|
|
1010
|
+
p ? (_ || []).forEach((E) => m("updateAnnotation", E.oldValue, E.newValue)) : (_ || []).forEach((E) => m("updateAnnotation", E.newValue, E.oldValue));
|
|
1004
1011
|
};
|
|
1005
|
-
return t.on("undo",
|
|
1012
|
+
return t.on("undo", b(!0)), t.on("redo", b(!1)), { on: d, off: g, emit: m };
|
|
1006
1013
|
}, eo = (e) => (t) => t.reduce((n, o) => {
|
|
1007
1014
|
const { parsed: i, error: s } = e.parse(o);
|
|
1008
1015
|
return s ? {
|
|
@@ -1015,44 +1022,44 @@ const Zn = 250, Qn = (e) => {
|
|
|
1015
1022
|
...n
|
|
1016
1023
|
};
|
|
1017
1024
|
}, { parsed: [], failed: [] }), to = (e, t, n) => {
|
|
1018
|
-
const { store: o, selection: i } = e, s = (
|
|
1025
|
+
const { store: o, selection: i } = e, s = (b) => {
|
|
1019
1026
|
if (n) {
|
|
1020
|
-
const { parsed: p, error:
|
|
1021
|
-
p ? o.addAnnotation(p,
|
|
1027
|
+
const { parsed: p, error: A } = n.parse(b);
|
|
1028
|
+
p ? o.addAnnotation(p, H.REMOTE) : console.error(A);
|
|
1022
1029
|
} else
|
|
1023
|
-
o.addAnnotation(
|
|
1024
|
-
}, r = () => i.clear(), l = () => o.clear(), a = (
|
|
1025
|
-
const p = o.getAnnotation(
|
|
1030
|
+
o.addAnnotation(b, H.REMOTE);
|
|
1031
|
+
}, r = () => i.clear(), l = () => o.clear(), a = (b) => {
|
|
1032
|
+
const p = o.getAnnotation(b);
|
|
1026
1033
|
return n && p ? n.serialize(p) : p;
|
|
1027
1034
|
}, c = () => n ? o.all().map(n.serialize) : o.all(), u = () => {
|
|
1028
|
-
var
|
|
1029
|
-
const p = (((
|
|
1035
|
+
var b;
|
|
1036
|
+
const p = (((b = i.selected) == null ? void 0 : b.map((A) => A.id)) || []).map((A) => o.getAnnotation(A)).filter(Boolean);
|
|
1030
1037
|
return n ? p.map(n.serialize) : p;
|
|
1031
|
-
}, f = (
|
|
1032
|
-
if (typeof
|
|
1033
|
-
const p = o.getAnnotation(
|
|
1034
|
-
if (o.deleteAnnotation(
|
|
1038
|
+
}, f = (b, p = !0) => fetch(b).then((A) => A.json()).then((A) => (g(A, p), A)), d = (b) => {
|
|
1039
|
+
if (typeof b == "string") {
|
|
1040
|
+
const p = o.getAnnotation(b);
|
|
1041
|
+
if (o.deleteAnnotation(b), p)
|
|
1035
1042
|
return n ? n.serialize(p) : p;
|
|
1036
1043
|
} else {
|
|
1037
|
-
const p = n ? n.parse(
|
|
1044
|
+
const p = n ? n.parse(b).parsed : b;
|
|
1038
1045
|
if (p)
|
|
1039
|
-
return o.deleteAnnotation(p),
|
|
1046
|
+
return o.deleteAnnotation(p), b;
|
|
1040
1047
|
}
|
|
1041
|
-
}, g = (
|
|
1048
|
+
}, g = (b, p = !0) => {
|
|
1042
1049
|
if (n) {
|
|
1043
|
-
const { parsed:
|
|
1044
|
-
|
|
1050
|
+
const { parsed: A, failed: _ } = eo(n)(b);
|
|
1051
|
+
_.length > 0 && console.warn(`Discarded ${_.length} invalid annotations`, _), o.bulkAddAnnotation(A, p, H.REMOTE);
|
|
1045
1052
|
} else
|
|
1046
|
-
o.bulkAddAnnotation(
|
|
1047
|
-
}, m = (
|
|
1048
|
-
|
|
1049
|
-
}, y = (
|
|
1053
|
+
o.bulkAddAnnotation(b, p, H.REMOTE);
|
|
1054
|
+
}, m = (b) => {
|
|
1055
|
+
b ? i.setSelected(b) : i.clear();
|
|
1056
|
+
}, y = (b) => {
|
|
1050
1057
|
if (n) {
|
|
1051
|
-
const p = n.parse(
|
|
1052
|
-
return o.updateAnnotation(p),
|
|
1058
|
+
const p = n.parse(b).parsed, A = n.serialize(o.getAnnotation(p.id));
|
|
1059
|
+
return o.updateAnnotation(p), A;
|
|
1053
1060
|
} else {
|
|
1054
|
-
const p = o.getAnnotation(
|
|
1055
|
-
return o.updateAnnotation(
|
|
1061
|
+
const p = o.getAnnotation(b.id);
|
|
1062
|
+
return o.updateAnnotation(b), p;
|
|
1056
1063
|
}
|
|
1057
1064
|
};
|
|
1058
1065
|
return {
|
|
@@ -1099,21 +1106,26 @@ const lo = () => ({ isGuest: !0, id: so("1234567890abcdefghijklmnopqrstuvwxyzABC
|
|
|
1099
1106
|
}
|
|
1100
1107
|
return `${n}`;
|
|
1101
1108
|
}, Jt = (e) => e ? typeof e == "object" ? { ...e } : e : void 0, co = (e, t) => (Array.isArray(e) ? e : [e]).map((n) => {
|
|
1102
|
-
const { id: o, type: i, purpose: s, value: r, created: l,
|
|
1109
|
+
const { id: o, type: i, purpose: s, value: r, created: l, modified: a, creator: c, ...u } = n;
|
|
1103
1110
|
return {
|
|
1104
1111
|
id: o || `temp-${ao(n)}`,
|
|
1105
1112
|
annotation: t,
|
|
1106
1113
|
type: i,
|
|
1107
1114
|
purpose: s,
|
|
1108
1115
|
value: r,
|
|
1116
|
+
creator: Jt(c),
|
|
1109
1117
|
created: l ? new Date(l) : void 0,
|
|
1110
|
-
|
|
1111
|
-
...
|
|
1118
|
+
updated: a ? new Date(a) : void 0,
|
|
1119
|
+
...u
|
|
1112
1120
|
};
|
|
1113
1121
|
}), fo = (e) => e.map((t) => {
|
|
1114
|
-
var n
|
|
1115
|
-
const i
|
|
1116
|
-
|
|
1122
|
+
var n;
|
|
1123
|
+
const { annotation: o, created: i, updated: s, ...r } = t, l = {
|
|
1124
|
+
...r,
|
|
1125
|
+
created: i == null ? void 0 : i.toISOString(),
|
|
1126
|
+
modified: s == null ? void 0 : s.toISOString()
|
|
1127
|
+
};
|
|
1128
|
+
return (n = l.id) != null && n.startsWith("temp-") && delete l.id, l;
|
|
1117
1129
|
});
|
|
1118
1130
|
ro();
|
|
1119
1131
|
const Yi = (e, t = !1) => ({ parse: (i) => uo(i, t), serialize: (i) => ho(i, e) }), uo = (e, t = !1) => {
|
|
@@ -1150,7 +1162,7 @@ const Yi = (e, t = !1) => ({ parse: (i) => uo(i, t), serialize: (i) => ho(i, e)
|
|
|
1150
1162
|
updatedBy: r,
|
|
1151
1163
|
// Excluded from serialization
|
|
1152
1164
|
...l
|
|
1153
|
-
} = e.target, a = n.type ==
|
|
1165
|
+
} = e.target, a = n.type == q.RECTANGLE ? Tn(n.geometry) : Bn(n), c = {
|
|
1154
1166
|
...e,
|
|
1155
1167
|
"@context": "http://www.w3.org/ns/anno.jsonld",
|
|
1156
1168
|
id: e.id,
|
|
@@ -1189,7 +1201,7 @@ function bt(e) {
|
|
|
1189
1201
|
)
|
|
1190
1202
|
}
|
|
1191
1203
|
}), t.$on("pointerdown", function() {
|
|
1192
|
-
|
|
1204
|
+
K(
|
|
1193
1205
|
/*grab*/
|
|
1194
1206
|
e[9](`HANDLE-${/*idx*/
|
|
1195
1207
|
e[12]}`)
|
|
@@ -1197,10 +1209,10 @@ function bt(e) {
|
|
|
1197
1209
|
e[12]}`).apply(this, arguments);
|
|
1198
1210
|
}), {
|
|
1199
1211
|
c() {
|
|
1200
|
-
|
|
1212
|
+
te(t.$$.fragment);
|
|
1201
1213
|
},
|
|
1202
1214
|
m(o, i) {
|
|
1203
|
-
|
|
1215
|
+
$(t, o, i), n = !0;
|
|
1204
1216
|
},
|
|
1205
1217
|
p(o, i) {
|
|
1206
1218
|
e = o;
|
|
@@ -1214,13 +1226,13 @@ function bt(e) {
|
|
|
1214
1226
|
e[3]), t.$set(s);
|
|
1215
1227
|
},
|
|
1216
1228
|
i(o) {
|
|
1217
|
-
n || (
|
|
1229
|
+
n || (I(t.$$.fragment, o), n = !0);
|
|
1218
1230
|
},
|
|
1219
1231
|
o(o) {
|
|
1220
|
-
|
|
1232
|
+
X(t.$$.fragment, o), n = !1;
|
|
1221
1233
|
},
|
|
1222
1234
|
d(o) {
|
|
1223
|
-
|
|
1235
|
+
ee(t, o);
|
|
1224
1236
|
}
|
|
1225
1237
|
};
|
|
1226
1238
|
}
|
|
@@ -1231,15 +1243,15 @@ function go(e) {
|
|
|
1231
1243
|
), g = [];
|
|
1232
1244
|
for (let y = 0; y < d.length; y += 1)
|
|
1233
1245
|
g[y] = bt(wt(e, d, y));
|
|
1234
|
-
const m = (y) =>
|
|
1246
|
+
const m = (y) => X(g[y], 1, 1, () => {
|
|
1235
1247
|
g[y] = null;
|
|
1236
1248
|
});
|
|
1237
1249
|
return {
|
|
1238
1250
|
c() {
|
|
1239
|
-
t =
|
|
1251
|
+
t = C("polygon"), i = ie(), s = C("polygon"), l = ie();
|
|
1240
1252
|
for (let y = 0; y < g.length; y += 1)
|
|
1241
1253
|
g[y].c();
|
|
1242
|
-
a =
|
|
1254
|
+
a = fe(), h(t, "class", "a9s-outer"), h(t, "style", n = /*computedStyle*/
|
|
1243
1255
|
e[1] ? "display:none;" : void 0), h(t, "points", o = /*geom*/
|
|
1244
1256
|
e[4].points.map(Et).join(" ")), h(s, "class", "a9s-inner a9s-shape-handle"), h(
|
|
1245
1257
|
s,
|
|
@@ -1249,39 +1261,39 @@ function go(e) {
|
|
|
1249
1261
|
), h(s, "points", r = /*geom*/
|
|
1250
1262
|
e[4].points.map(At).join(" "));
|
|
1251
1263
|
},
|
|
1252
|
-
m(y,
|
|
1253
|
-
|
|
1264
|
+
m(y, b) {
|
|
1265
|
+
O(y, t, b), O(y, i, b), O(y, s, b), O(y, l, b);
|
|
1254
1266
|
for (let p = 0; p < g.length; p += 1)
|
|
1255
|
-
g[p] && g[p].m(y,
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1267
|
+
g[p] && g[p].m(y, b);
|
|
1268
|
+
O(y, a, b), c = !0, u || (f = [
|
|
1269
|
+
j(t, "pointerdown", function() {
|
|
1270
|
+
K(
|
|
1259
1271
|
/*grab*/
|
|
1260
1272
|
e[9]("SHAPE")
|
|
1261
1273
|
) && e[9]("SHAPE").apply(this, arguments);
|
|
1262
1274
|
}),
|
|
1263
|
-
|
|
1264
|
-
|
|
1275
|
+
j(s, "pointerdown", function() {
|
|
1276
|
+
K(
|
|
1265
1277
|
/*grab*/
|
|
1266
1278
|
e[9]("SHAPE")
|
|
1267
1279
|
) && e[9]("SHAPE").apply(this, arguments);
|
|
1268
1280
|
})
|
|
1269
1281
|
], u = !0);
|
|
1270
1282
|
},
|
|
1271
|
-
p(y,
|
|
1272
|
-
if (e = y, (!c ||
|
|
1283
|
+
p(y, b) {
|
|
1284
|
+
if (e = y, (!c || b & /*computedStyle*/
|
|
1273
1285
|
2 && n !== (n = /*computedStyle*/
|
|
1274
|
-
e[1] ? "display:none;" : void 0)) && h(t, "style", n), (!c ||
|
|
1286
|
+
e[1] ? "display:none;" : void 0)) && h(t, "style", n), (!c || b & /*geom*/
|
|
1275
1287
|
16 && o !== (o = /*geom*/
|
|
1276
|
-
e[4].points.map(Et).join(" "))) && h(t, "points", o), (!c ||
|
|
1288
|
+
e[4].points.map(Et).join(" "))) && h(t, "points", o), (!c || b & /*computedStyle*/
|
|
1277
1289
|
2) && h(
|
|
1278
1290
|
s,
|
|
1279
1291
|
"style",
|
|
1280
1292
|
/*computedStyle*/
|
|
1281
1293
|
e[1]
|
|
1282
|
-
), (!c ||
|
|
1294
|
+
), (!c || b & /*geom*/
|
|
1283
1295
|
16 && r !== (r = /*geom*/
|
|
1284
|
-
e[4].points.map(At).join(" "))) && h(s, "points", r),
|
|
1296
|
+
e[4].points.map(At).join(" "))) && h(s, "points", r), b & /*geom, viewportScale, grab*/
|
|
1285
1297
|
536) {
|
|
1286
1298
|
d = Se(
|
|
1287
1299
|
/*geom*/
|
|
@@ -1289,35 +1301,35 @@ function go(e) {
|
|
|
1289
1301
|
);
|
|
1290
1302
|
let p;
|
|
1291
1303
|
for (p = 0; p < d.length; p += 1) {
|
|
1292
|
-
const
|
|
1293
|
-
g[p] ? (g[p].p(
|
|
1304
|
+
const A = wt(e, d, p);
|
|
1305
|
+
g[p] ? (g[p].p(A, b), I(g[p], 1)) : (g[p] = bt(A), g[p].c(), I(g[p], 1), g[p].m(a.parentNode, a));
|
|
1294
1306
|
}
|
|
1295
|
-
for (
|
|
1307
|
+
for (le(), p = d.length; p < g.length; p += 1)
|
|
1296
1308
|
m(p);
|
|
1297
|
-
|
|
1309
|
+
ae();
|
|
1298
1310
|
}
|
|
1299
1311
|
},
|
|
1300
1312
|
i(y) {
|
|
1301
1313
|
if (!c) {
|
|
1302
|
-
for (let
|
|
1303
|
-
|
|
1314
|
+
for (let b = 0; b < d.length; b += 1)
|
|
1315
|
+
I(g[b]);
|
|
1304
1316
|
c = !0;
|
|
1305
1317
|
}
|
|
1306
1318
|
},
|
|
1307
1319
|
o(y) {
|
|
1308
1320
|
g = g.filter(Boolean);
|
|
1309
|
-
for (let
|
|
1310
|
-
|
|
1321
|
+
for (let b = 0; b < g.length; b += 1)
|
|
1322
|
+
X(g[b]);
|
|
1311
1323
|
c = !1;
|
|
1312
1324
|
},
|
|
1313
1325
|
d(y) {
|
|
1314
|
-
y && (k(t), k(i), k(s), k(l), k(a)), rt(g, y), u = !1,
|
|
1326
|
+
y && (k(t), k(i), k(s), k(l), k(a)), rt(g, y), u = !1, ce(f);
|
|
1315
1327
|
}
|
|
1316
1328
|
};
|
|
1317
1329
|
}
|
|
1318
1330
|
function mo(e) {
|
|
1319
1331
|
let t, n;
|
|
1320
|
-
return t = new
|
|
1332
|
+
return t = new Zt({
|
|
1321
1333
|
props: {
|
|
1322
1334
|
shape: (
|
|
1323
1335
|
/*shape*/
|
|
@@ -1354,10 +1366,10 @@ function mo(e) {
|
|
|
1354
1366
|
e[8]
|
|
1355
1367
|
), {
|
|
1356
1368
|
c() {
|
|
1357
|
-
|
|
1369
|
+
te(t.$$.fragment);
|
|
1358
1370
|
},
|
|
1359
1371
|
m(o, i) {
|
|
1360
|
-
|
|
1372
|
+
$(t, o, i), n = !0;
|
|
1361
1373
|
},
|
|
1362
1374
|
p(o, [i]) {
|
|
1363
1375
|
const s = {};
|
|
@@ -1369,13 +1381,13 @@ function mo(e) {
|
|
|
1369
1381
|
8730 && (s.$$scope = { dirty: i, ctx: o }), t.$set(s);
|
|
1370
1382
|
},
|
|
1371
1383
|
i(o) {
|
|
1372
|
-
n || (
|
|
1384
|
+
n || (I(t.$$.fragment, o), n = !0);
|
|
1373
1385
|
},
|
|
1374
1386
|
o(o) {
|
|
1375
|
-
|
|
1387
|
+
X(t.$$.fragment, o), n = !1;
|
|
1376
1388
|
},
|
|
1377
1389
|
d(o) {
|
|
1378
|
-
|
|
1390
|
+
ee(t, o);
|
|
1379
1391
|
}
|
|
1380
1392
|
};
|
|
1381
1393
|
}
|
|
@@ -1384,19 +1396,19 @@ function po(e, t, n) {
|
|
|
1384
1396
|
let o, { shape: i } = t, { computedStyle: s } = t, { transform: r } = t, { viewportScale: l = 1 } = t;
|
|
1385
1397
|
const a = (d, g, m) => {
|
|
1386
1398
|
let y;
|
|
1387
|
-
const
|
|
1388
|
-
g === "SHAPE" ? y =
|
|
1399
|
+
const b = d.geometry;
|
|
1400
|
+
g === "SHAPE" ? y = b.points.map(([A, _]) => [A + m[0], _ + m[1]]) : y = b.points.map(([A, _], E) => g === `HANDLE-${E}` ? [A + m[0], _ + m[1]] : [A, _]);
|
|
1389
1401
|
const p = Fe(y);
|
|
1390
1402
|
return { ...d, geometry: { points: y, bounds: p } };
|
|
1391
1403
|
};
|
|
1392
1404
|
function c(d) {
|
|
1393
|
-
|
|
1405
|
+
de.call(this, e, d);
|
|
1394
1406
|
}
|
|
1395
1407
|
function u(d) {
|
|
1396
|
-
|
|
1408
|
+
de.call(this, e, d);
|
|
1397
1409
|
}
|
|
1398
1410
|
function f(d) {
|
|
1399
|
-
|
|
1411
|
+
de.call(this, e, d);
|
|
1400
1412
|
}
|
|
1401
1413
|
return e.$$set = (d) => {
|
|
1402
1414
|
"shape" in d && n(0, i = d.shape), "computedStyle" in d && n(1, s = d.computedStyle), "transform" in d && n(2, r = d.transform), "viewportScale" in d && n(3, l = d.viewportScale);
|
|
@@ -1415,9 +1427,9 @@ function po(e, t, n) {
|
|
|
1415
1427
|
f
|
|
1416
1428
|
];
|
|
1417
1429
|
}
|
|
1418
|
-
class yo extends
|
|
1430
|
+
class yo extends oe {
|
|
1419
1431
|
constructor(t) {
|
|
1420
|
-
super(),
|
|
1432
|
+
super(), ne(this, t, po, mo, J, {
|
|
1421
1433
|
shape: 0,
|
|
1422
1434
|
computedStyle: 1,
|
|
1423
1435
|
transform: 2,
|
|
@@ -1425,15 +1437,15 @@ class yo extends te {
|
|
|
1425
1437
|
});
|
|
1426
1438
|
}
|
|
1427
1439
|
}
|
|
1428
|
-
const
|
|
1440
|
+
const Ze = (e, t) => {
|
|
1429
1441
|
const n = Math.abs(t[0] - e[0]), o = Math.abs(t[1] - e[1]);
|
|
1430
1442
|
return Math.sqrt(Math.pow(n, 2) + Math.pow(o, 2));
|
|
1431
1443
|
}, ye = [];
|
|
1432
|
-
function _o(e, t =
|
|
1444
|
+
function _o(e, t = F) {
|
|
1433
1445
|
let n;
|
|
1434
1446
|
const o = /* @__PURE__ */ new Set();
|
|
1435
1447
|
function i(l) {
|
|
1436
|
-
if (
|
|
1448
|
+
if (J(e, l) && (e = l, n)) {
|
|
1437
1449
|
const a = !ye.length;
|
|
1438
1450
|
for (const c of o)
|
|
1439
1451
|
c[1](), ye.push(c, e);
|
|
@@ -1447,9 +1459,9 @@ function _o(e, t = G) {
|
|
|
1447
1459
|
function s(l) {
|
|
1448
1460
|
i(l(e));
|
|
1449
1461
|
}
|
|
1450
|
-
function r(l, a =
|
|
1462
|
+
function r(l, a = F) {
|
|
1451
1463
|
const c = [l, a];
|
|
1452
|
-
return o.add(c), o.size === 1 && (n = t(i, s) ||
|
|
1464
|
+
return o.add(c), o.size === 1 && (n = t(i, s) || F), l(e), () => {
|
|
1453
1465
|
o.delete(c), o.size === 0 && n && (n(), n = null);
|
|
1454
1466
|
};
|
|
1455
1467
|
}
|
|
@@ -1483,7 +1495,7 @@ function Ao(e) {
|
|
|
1483
1495
|
let t, n, o, i, s, r;
|
|
1484
1496
|
return {
|
|
1485
1497
|
c() {
|
|
1486
|
-
t =
|
|
1498
|
+
t = C("rect"), h(t, "class", n = ze(`a9s-handle ${/*$$props*/
|
|
1487
1499
|
e[8].class || ""}`.trim()) + " svelte-1sgkh33"), h(t, "x", o = /*x*/
|
|
1488
1500
|
e[0] - /*handleSize*/
|
|
1489
1501
|
e[5] / 2), h(t, "y", i = /*y*/
|
|
@@ -1501,7 +1513,7 @@ function Ao(e) {
|
|
|
1501
1513
|
);
|
|
1502
1514
|
},
|
|
1503
1515
|
m(l, a) {
|
|
1504
|
-
|
|
1516
|
+
O(l, t, a), s || (r = j(
|
|
1505
1517
|
t,
|
|
1506
1518
|
"pointerdown",
|
|
1507
1519
|
/*pointerdown_handler_2*/
|
|
@@ -1540,7 +1552,7 @@ function So(e) {
|
|
|
1540
1552
|
let t, n, o, i, s, r, l, a, c;
|
|
1541
1553
|
return {
|
|
1542
1554
|
c() {
|
|
1543
|
-
t =
|
|
1555
|
+
t = C("g"), n = C("circle"), i = C("rect"), h(
|
|
1544
1556
|
n,
|
|
1545
1557
|
"cx",
|
|
1546
1558
|
/*x*/
|
|
@@ -1575,38 +1587,38 @@ function So(e) {
|
|
|
1575
1587
|
), h(t, "class", "a9s-touch-handle");
|
|
1576
1588
|
},
|
|
1577
1589
|
m(u, f) {
|
|
1578
|
-
|
|
1579
|
-
|
|
1590
|
+
O(u, t, f), re(t, n), re(t, i), a || (c = [
|
|
1591
|
+
j(
|
|
1580
1592
|
n,
|
|
1581
1593
|
"pointerdown",
|
|
1582
1594
|
/*pointerdown_handler*/
|
|
1583
1595
|
e[10]
|
|
1584
1596
|
),
|
|
1585
|
-
|
|
1597
|
+
j(
|
|
1586
1598
|
n,
|
|
1587
1599
|
"pointerdown",
|
|
1588
1600
|
/*onPointerDown*/
|
|
1589
1601
|
e[6]
|
|
1590
1602
|
),
|
|
1591
|
-
|
|
1603
|
+
j(
|
|
1592
1604
|
n,
|
|
1593
1605
|
"pointerup",
|
|
1594
1606
|
/*onPointerUp*/
|
|
1595
1607
|
e[7]
|
|
1596
1608
|
),
|
|
1597
|
-
|
|
1609
|
+
j(
|
|
1598
1610
|
i,
|
|
1599
1611
|
"pointerdown",
|
|
1600
1612
|
/*pointerdown_handler_1*/
|
|
1601
1613
|
e[9]
|
|
1602
1614
|
),
|
|
1603
|
-
|
|
1615
|
+
j(
|
|
1604
1616
|
i,
|
|
1605
1617
|
"pointerdown",
|
|
1606
1618
|
/*onPointerDown*/
|
|
1607
1619
|
e[6]
|
|
1608
1620
|
),
|
|
1609
|
-
|
|
1621
|
+
j(
|
|
1610
1622
|
i,
|
|
1611
1623
|
"pointerup",
|
|
1612
1624
|
/*onPointerUp*/
|
|
@@ -1659,7 +1671,7 @@ function So(e) {
|
|
|
1659
1671
|
);
|
|
1660
1672
|
},
|
|
1661
1673
|
d(u) {
|
|
1662
|
-
u && k(t), a = !1,
|
|
1674
|
+
u && k(t), a = !1, ce(c);
|
|
1663
1675
|
}
|
|
1664
1676
|
};
|
|
1665
1677
|
}
|
|
@@ -1671,16 +1683,16 @@ function To(e) {
|
|
|
1671
1683
|
let i = n()(e);
|
|
1672
1684
|
return {
|
|
1673
1685
|
c() {
|
|
1674
|
-
i.c(), t =
|
|
1686
|
+
i.c(), t = fe();
|
|
1675
1687
|
},
|
|
1676
1688
|
m(s, r) {
|
|
1677
|
-
i.m(s, r),
|
|
1689
|
+
i.m(s, r), O(s, t, r);
|
|
1678
1690
|
},
|
|
1679
1691
|
p(s, [r]) {
|
|
1680
1692
|
i.p(s, r);
|
|
1681
1693
|
},
|
|
1682
|
-
i:
|
|
1683
|
-
o:
|
|
1694
|
+
i: F,
|
|
1695
|
+
o: F,
|
|
1684
1696
|
d(s) {
|
|
1685
1697
|
s && k(t), i.d(s);
|
|
1686
1698
|
}
|
|
@@ -1692,13 +1704,13 @@ function Mo(e, t, n) {
|
|
|
1692
1704
|
m.pointerType === "touch" && n(4, a = !0);
|
|
1693
1705
|
}, u = () => n(4, a = !1);
|
|
1694
1706
|
function f(m) {
|
|
1695
|
-
|
|
1707
|
+
de.call(this, e, m);
|
|
1696
1708
|
}
|
|
1697
1709
|
function d(m) {
|
|
1698
|
-
|
|
1710
|
+
de.call(this, e, m);
|
|
1699
1711
|
}
|
|
1700
1712
|
function g(m) {
|
|
1701
|
-
|
|
1713
|
+
de.call(this, e, m);
|
|
1702
1714
|
}
|
|
1703
1715
|
return e.$$set = (m) => {
|
|
1704
1716
|
n(8, t = nt(nt({}, t), gt(m))), "x" in m && n(0, i = m.x), "y" in m && n(1, s = m.y), "scale" in m && n(2, r = m.scale), "radius" in m && n(3, l = m.radius);
|
|
@@ -1720,14 +1732,14 @@ function Mo(e, t, n) {
|
|
|
1720
1732
|
g
|
|
1721
1733
|
];
|
|
1722
1734
|
}
|
|
1723
|
-
class ke extends
|
|
1735
|
+
class ke extends oe {
|
|
1724
1736
|
constructor(t) {
|
|
1725
|
-
super(),
|
|
1737
|
+
super(), ne(this, t, Mo, To, J, { x: 0, y: 1, scale: 2, radius: 3 });
|
|
1726
1738
|
}
|
|
1727
1739
|
}
|
|
1728
1740
|
function vo(e) {
|
|
1729
|
-
let t, n, o, i, s, r, l, a, c, u, f, d, g, m, y,
|
|
1730
|
-
return
|
|
1741
|
+
let t, n, o, i, s, r, l, a, c, u, f, d, g, m, y, b, p, A, _, E, B, V, U, R, Y, w, S, T, M, P, G, x, Me, se, ve, L, Q, z, ue, Z, N, qe, ut;
|
|
1742
|
+
return se = new ke({
|
|
1731
1743
|
props: {
|
|
1732
1744
|
class: "a9s-corner-handle-topleft",
|
|
1733
1745
|
x: (
|
|
@@ -1743,8 +1755,8 @@ function vo(e) {
|
|
|
1743
1755
|
e[3]
|
|
1744
1756
|
)
|
|
1745
1757
|
}
|
|
1746
|
-
}),
|
|
1747
|
-
|
|
1758
|
+
}), se.$on("pointerdown", function() {
|
|
1759
|
+
K(
|
|
1748
1760
|
/*grab*/
|
|
1749
1761
|
e[9]("TOP_LEFT")
|
|
1750
1762
|
) && e[9]("TOP_LEFT").apply(this, arguments);
|
|
@@ -1766,11 +1778,11 @@ function vo(e) {
|
|
|
1766
1778
|
)
|
|
1767
1779
|
}
|
|
1768
1780
|
}), L.$on("pointerdown", function() {
|
|
1769
|
-
|
|
1781
|
+
K(
|
|
1770
1782
|
/*grab*/
|
|
1771
1783
|
e[9]("TOP_RIGHT")
|
|
1772
1784
|
) && e[9]("TOP_RIGHT").apply(this, arguments);
|
|
1773
|
-
}),
|
|
1785
|
+
}), z = new ke({
|
|
1774
1786
|
props: {
|
|
1775
1787
|
class: "a9s-corner-handle-bottomright",
|
|
1776
1788
|
x: (
|
|
@@ -1788,12 +1800,12 @@ function vo(e) {
|
|
|
1788
1800
|
e[3]
|
|
1789
1801
|
)
|
|
1790
1802
|
}
|
|
1791
|
-
}),
|
|
1792
|
-
|
|
1803
|
+
}), z.$on("pointerdown", function() {
|
|
1804
|
+
K(
|
|
1793
1805
|
/*grab*/
|
|
1794
1806
|
e[9]("BOTTOM_RIGHT")
|
|
1795
1807
|
) && e[9]("BOTTOM_RIGHT").apply(this, arguments);
|
|
1796
|
-
}),
|
|
1808
|
+
}), Z = new ke({
|
|
1797
1809
|
props: {
|
|
1798
1810
|
class: "a9s-corner-handle-bottomleft",
|
|
1799
1811
|
x: (
|
|
@@ -1810,14 +1822,14 @@ function vo(e) {
|
|
|
1810
1822
|
e[3]
|
|
1811
1823
|
)
|
|
1812
1824
|
}
|
|
1813
|
-
}),
|
|
1814
|
-
|
|
1825
|
+
}), Z.$on("pointerdown", function() {
|
|
1826
|
+
K(
|
|
1815
1827
|
/*grab*/
|
|
1816
1828
|
e[9]("BOTTOM_LEFT")
|
|
1817
1829
|
) && e[9]("BOTTOM_LEFT").apply(this, arguments);
|
|
1818
1830
|
}), {
|
|
1819
1831
|
c() {
|
|
1820
|
-
t =
|
|
1832
|
+
t = C("rect"), l = ie(), a = C("rect"), g = ie(), m = C("rect"), A = ie(), _ = C("rect"), U = ie(), R = C("rect"), T = ie(), M = C("rect"), Me = ie(), te(se.$$.fragment), ve = ie(), te(L.$$.fragment), Q = ie(), te(z.$$.fragment), ue = ie(), te(Z.$$.fragment), h(t, "class", "a9s-outer"), h(t, "style", n = /*computedStyle*/
|
|
1821
1833
|
e[1] ? "display:none;" : void 0), h(t, "x", o = /*geom*/
|
|
1822
1834
|
e[4].x), h(t, "y", i = /*geom*/
|
|
1823
1835
|
e[4].y), h(t, "width", s = /*geom*/
|
|
@@ -1832,140 +1844,140 @@ function vo(e) {
|
|
|
1832
1844
|
e[4].y), h(a, "width", f = /*geom*/
|
|
1833
1845
|
e[4].w), h(a, "height", d = /*geom*/
|
|
1834
1846
|
e[4].h), h(m, "class", "a9s-edge-handle a9s-edge-handle-top"), h(m, "x", y = /*geom*/
|
|
1835
|
-
e[4].x), h(m, "y",
|
|
1847
|
+
e[4].x), h(m, "y", b = /*geom*/
|
|
1836
1848
|
e[4].y), h(m, "height", 1), h(m, "width", p = /*geom*/
|
|
1837
|
-
e[4].w), h(
|
|
1849
|
+
e[4].w), h(_, "class", "a9s-edge-handle a9s-edge-handle-right"), h(_, "x", E = /*geom*/
|
|
1838
1850
|
e[4].x + /*geom*/
|
|
1839
|
-
e[4].w), h(
|
|
1840
|
-
e[4].y), h(
|
|
1841
|
-
e[4].h), h(
|
|
1842
|
-
e[4].x), h(
|
|
1851
|
+
e[4].w), h(_, "y", B = /*geom*/
|
|
1852
|
+
e[4].y), h(_, "height", V = /*geom*/
|
|
1853
|
+
e[4].h), h(_, "width", 1), h(R, "class", "a9s-edge-handle a9s-edge-handle-bottom"), h(R, "x", Y = /*geom*/
|
|
1854
|
+
e[4].x), h(R, "y", w = /*geom*/
|
|
1843
1855
|
e[4].y + /*geom*/
|
|
1844
|
-
e[4].h), h(
|
|
1845
|
-
e[4].w), h(
|
|
1846
|
-
e[4].x), h(
|
|
1847
|
-
e[4].y), h(
|
|
1848
|
-
e[4].h), h(
|
|
1849
|
-
},
|
|
1850
|
-
m(
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1856
|
+
e[4].h), h(R, "height", 1), h(R, "width", S = /*geom*/
|
|
1857
|
+
e[4].w), h(M, "class", "a9s-edge-handle a9s-edge-handle-left"), h(M, "x", P = /*geom*/
|
|
1858
|
+
e[4].x), h(M, "y", G = /*geom*/
|
|
1859
|
+
e[4].y), h(M, "height", x = /*geom*/
|
|
1860
|
+
e[4].h), h(M, "width", 1);
|
|
1861
|
+
},
|
|
1862
|
+
m(D, v) {
|
|
1863
|
+
O(D, t, v), O(D, l, v), O(D, a, v), O(D, g, v), O(D, m, v), O(D, A, v), O(D, _, v), O(D, U, v), O(D, R, v), O(D, T, v), O(D, M, v), O(D, Me, v), $(se, D, v), O(D, ve, v), $(L, D, v), O(D, Q, v), $(z, D, v), O(D, ue, v), $(Z, D, v), N = !0, qe || (ut = [
|
|
1864
|
+
j(t, "pointerdown", function() {
|
|
1865
|
+
K(
|
|
1854
1866
|
/*grab*/
|
|
1855
1867
|
e[9]("SHAPE")
|
|
1856
1868
|
) && e[9]("SHAPE").apply(this, arguments);
|
|
1857
1869
|
}),
|
|
1858
|
-
|
|
1859
|
-
|
|
1870
|
+
j(a, "pointerdown", function() {
|
|
1871
|
+
K(
|
|
1860
1872
|
/*grab*/
|
|
1861
1873
|
e[9]("SHAPE")
|
|
1862
1874
|
) && e[9]("SHAPE").apply(this, arguments);
|
|
1863
1875
|
}),
|
|
1864
|
-
|
|
1865
|
-
|
|
1876
|
+
j(m, "pointerdown", function() {
|
|
1877
|
+
K(
|
|
1866
1878
|
/*grab*/
|
|
1867
1879
|
e[9]("TOP")
|
|
1868
1880
|
) && e[9]("TOP").apply(this, arguments);
|
|
1869
1881
|
}),
|
|
1870
|
-
|
|
1871
|
-
|
|
1882
|
+
j(_, "pointerdown", function() {
|
|
1883
|
+
K(
|
|
1872
1884
|
/*grab*/
|
|
1873
1885
|
e[9]("RIGHT")
|
|
1874
1886
|
) && e[9]("RIGHT").apply(this, arguments);
|
|
1875
1887
|
}),
|
|
1876
|
-
|
|
1877
|
-
|
|
1888
|
+
j(R, "pointerdown", function() {
|
|
1889
|
+
K(
|
|
1878
1890
|
/*grab*/
|
|
1879
1891
|
e[9]("BOTTOM")
|
|
1880
1892
|
) && e[9]("BOTTOM").apply(this, arguments);
|
|
1881
1893
|
}),
|
|
1882
|
-
|
|
1883
|
-
|
|
1894
|
+
j(M, "pointerdown", function() {
|
|
1895
|
+
K(
|
|
1884
1896
|
/*grab*/
|
|
1885
1897
|
e[9]("LEFT")
|
|
1886
1898
|
) && e[9]("LEFT").apply(this, arguments);
|
|
1887
1899
|
})
|
|
1888
1900
|
], qe = !0);
|
|
1889
1901
|
},
|
|
1890
|
-
p(
|
|
1891
|
-
e =
|
|
1902
|
+
p(D, v) {
|
|
1903
|
+
e = D, (!N || v & /*computedStyle*/
|
|
1892
1904
|
2 && n !== (n = /*computedStyle*/
|
|
1893
|
-
e[1] ? "display:none;" : void 0)) && h(t, "style", n), (!
|
|
1905
|
+
e[1] ? "display:none;" : void 0)) && h(t, "style", n), (!N || v & /*geom*/
|
|
1894
1906
|
16 && o !== (o = /*geom*/
|
|
1895
|
-
e[4].x)) && h(t, "x", o), (!
|
|
1907
|
+
e[4].x)) && h(t, "x", o), (!N || v & /*geom*/
|
|
1896
1908
|
16 && i !== (i = /*geom*/
|
|
1897
|
-
e[4].y)) && h(t, "y", i), (!
|
|
1909
|
+
e[4].y)) && h(t, "y", i), (!N || v & /*geom*/
|
|
1898
1910
|
16 && s !== (s = /*geom*/
|
|
1899
|
-
e[4].w)) && h(t, "width", s), (!
|
|
1911
|
+
e[4].w)) && h(t, "width", s), (!N || v & /*geom*/
|
|
1900
1912
|
16 && r !== (r = /*geom*/
|
|
1901
|
-
e[4].h)) && h(t, "height", r), (!
|
|
1913
|
+
e[4].h)) && h(t, "height", r), (!N || v & /*computedStyle*/
|
|
1902
1914
|
2) && h(
|
|
1903
1915
|
a,
|
|
1904
1916
|
"style",
|
|
1905
1917
|
/*computedStyle*/
|
|
1906
1918
|
e[1]
|
|
1907
|
-
), (!
|
|
1919
|
+
), (!N || v & /*geom*/
|
|
1908
1920
|
16 && c !== (c = /*geom*/
|
|
1909
|
-
e[4].x)) && h(a, "x", c), (!
|
|
1921
|
+
e[4].x)) && h(a, "x", c), (!N || v & /*geom*/
|
|
1910
1922
|
16 && u !== (u = /*geom*/
|
|
1911
|
-
e[4].y)) && h(a, "y", u), (!
|
|
1923
|
+
e[4].y)) && h(a, "y", u), (!N || v & /*geom*/
|
|
1912
1924
|
16 && f !== (f = /*geom*/
|
|
1913
|
-
e[4].w)) && h(a, "width", f), (!
|
|
1925
|
+
e[4].w)) && h(a, "width", f), (!N || v & /*geom*/
|
|
1914
1926
|
16 && d !== (d = /*geom*/
|
|
1915
|
-
e[4].h)) && h(a, "height", d), (!
|
|
1927
|
+
e[4].h)) && h(a, "height", d), (!N || v & /*geom*/
|
|
1916
1928
|
16 && y !== (y = /*geom*/
|
|
1917
|
-
e[4].x)) && h(m, "x", y), (!
|
|
1918
|
-
16 &&
|
|
1919
|
-
e[4].y)) && h(m, "y",
|
|
1929
|
+
e[4].x)) && h(m, "x", y), (!N || v & /*geom*/
|
|
1930
|
+
16 && b !== (b = /*geom*/
|
|
1931
|
+
e[4].y)) && h(m, "y", b), (!N || v & /*geom*/
|
|
1920
1932
|
16 && p !== (p = /*geom*/
|
|
1921
|
-
e[4].w)) && h(m, "width", p), (!
|
|
1922
|
-
16 &&
|
|
1933
|
+
e[4].w)) && h(m, "width", p), (!N || v & /*geom*/
|
|
1934
|
+
16 && E !== (E = /*geom*/
|
|
1923
1935
|
e[4].x + /*geom*/
|
|
1924
|
-
e[4].w)) && h(
|
|
1925
|
-
16 &&
|
|
1926
|
-
e[4].y)) && h(
|
|
1927
|
-
16 &&
|
|
1928
|
-
e[4].h)) && h(
|
|
1929
|
-
16 &&
|
|
1930
|
-
e[4].x)) && h(
|
|
1931
|
-
16 &&
|
|
1936
|
+
e[4].w)) && h(_, "x", E), (!N || v & /*geom*/
|
|
1937
|
+
16 && B !== (B = /*geom*/
|
|
1938
|
+
e[4].y)) && h(_, "y", B), (!N || v & /*geom*/
|
|
1939
|
+
16 && V !== (V = /*geom*/
|
|
1940
|
+
e[4].h)) && h(_, "height", V), (!N || v & /*geom*/
|
|
1941
|
+
16 && Y !== (Y = /*geom*/
|
|
1942
|
+
e[4].x)) && h(R, "x", Y), (!N || v & /*geom*/
|
|
1943
|
+
16 && w !== (w = /*geom*/
|
|
1932
1944
|
e[4].y + /*geom*/
|
|
1933
|
-
e[4].h)) && h(
|
|
1934
|
-
16 &&
|
|
1935
|
-
e[4].w)) && h(
|
|
1936
|
-
16 &&
|
|
1937
|
-
e[4].x)) && h(
|
|
1938
|
-
16 &&
|
|
1939
|
-
e[4].y)) && h(
|
|
1940
|
-
16 &&
|
|
1941
|
-
e[4].h)) && h(
|
|
1942
|
-
const Ce = {};
|
|
1943
|
-
v & /*geom*/
|
|
1944
|
-
16 && (Ce.x = /*geom*/
|
|
1945
|
-
e[4].x), v & /*geom*/
|
|
1946
|
-
16 && (Ce.y = /*geom*/
|
|
1947
|
-
e[4].y), v & /*viewportScale*/
|
|
1948
|
-
8 && (Ce.scale = /*viewportScale*/
|
|
1949
|
-
e[3]), oe.$set(Ce);
|
|
1945
|
+
e[4].h)) && h(R, "y", w), (!N || v & /*geom*/
|
|
1946
|
+
16 && S !== (S = /*geom*/
|
|
1947
|
+
e[4].w)) && h(R, "width", S), (!N || v & /*geom*/
|
|
1948
|
+
16 && P !== (P = /*geom*/
|
|
1949
|
+
e[4].x)) && h(M, "x", P), (!N || v & /*geom*/
|
|
1950
|
+
16 && G !== (G = /*geom*/
|
|
1951
|
+
e[4].y)) && h(M, "y", G), (!N || v & /*geom*/
|
|
1952
|
+
16 && x !== (x = /*geom*/
|
|
1953
|
+
e[4].h)) && h(M, "height", x);
|
|
1950
1954
|
const De = {};
|
|
1951
1955
|
v & /*geom*/
|
|
1952
1956
|
16 && (De.x = /*geom*/
|
|
1953
|
-
e[4].x
|
|
1954
|
-
e[4].w), v & /*geom*/
|
|
1957
|
+
e[4].x), v & /*geom*/
|
|
1955
1958
|
16 && (De.y = /*geom*/
|
|
1956
1959
|
e[4].y), v & /*viewportScale*/
|
|
1957
1960
|
8 && (De.scale = /*viewportScale*/
|
|
1958
|
-
e[3]),
|
|
1961
|
+
e[3]), se.$set(De);
|
|
1959
1962
|
const Xe = {};
|
|
1960
1963
|
v & /*geom*/
|
|
1961
1964
|
16 && (Xe.x = /*geom*/
|
|
1962
1965
|
e[4].x + /*geom*/
|
|
1963
1966
|
e[4].w), v & /*geom*/
|
|
1964
1967
|
16 && (Xe.y = /*geom*/
|
|
1968
|
+
e[4].y), v & /*viewportScale*/
|
|
1969
|
+
8 && (Xe.scale = /*viewportScale*/
|
|
1970
|
+
e[3]), L.$set(Xe);
|
|
1971
|
+
const Ce = {};
|
|
1972
|
+
v & /*geom*/
|
|
1973
|
+
16 && (Ce.x = /*geom*/
|
|
1974
|
+
e[4].x + /*geom*/
|
|
1975
|
+
e[4].w), v & /*geom*/
|
|
1976
|
+
16 && (Ce.y = /*geom*/
|
|
1965
1977
|
e[4].y + /*geom*/
|
|
1966
1978
|
e[4].h), v & /*viewportScale*/
|
|
1967
|
-
8 && (
|
|
1968
|
-
e[3]),
|
|
1979
|
+
8 && (Ce.scale = /*viewportScale*/
|
|
1980
|
+
e[3]), z.$set(Ce);
|
|
1969
1981
|
const Re = {};
|
|
1970
1982
|
v & /*geom*/
|
|
1971
1983
|
16 && (Re.x = /*geom*/
|
|
@@ -1974,22 +1986,22 @@ function vo(e) {
|
|
|
1974
1986
|
e[4].y + /*geom*/
|
|
1975
1987
|
e[4].h), v & /*viewportScale*/
|
|
1976
1988
|
8 && (Re.scale = /*viewportScale*/
|
|
1977
|
-
e[3]),
|
|
1989
|
+
e[3]), Z.$set(Re);
|
|
1978
1990
|
},
|
|
1979
|
-
i(
|
|
1980
|
-
|
|
1991
|
+
i(D) {
|
|
1992
|
+
N || (I(se.$$.fragment, D), I(L.$$.fragment, D), I(z.$$.fragment, D), I(Z.$$.fragment, D), N = !0);
|
|
1981
1993
|
},
|
|
1982
|
-
o(
|
|
1983
|
-
|
|
1994
|
+
o(D) {
|
|
1995
|
+
X(se.$$.fragment, D), X(L.$$.fragment, D), X(z.$$.fragment, D), X(Z.$$.fragment, D), N = !1;
|
|
1984
1996
|
},
|
|
1985
|
-
d(
|
|
1986
|
-
|
|
1997
|
+
d(D) {
|
|
1998
|
+
D && (k(t), k(l), k(a), k(g), k(m), k(A), k(_), k(U), k(R), k(T), k(M), k(Me), k(ve), k(Q), k(ue)), ee(se, D), ee(L, D), ee(z, D), ee(Z, D), qe = !1, ce(ut);
|
|
1987
1999
|
}
|
|
1988
2000
|
};
|
|
1989
2001
|
}
|
|
1990
2002
|
function Lo(e) {
|
|
1991
2003
|
let t, n;
|
|
1992
|
-
return t = new
|
|
2004
|
+
return t = new Zt({
|
|
1993
2005
|
props: {
|
|
1994
2006
|
shape: (
|
|
1995
2007
|
/*shape*/
|
|
@@ -2026,10 +2038,10 @@ function Lo(e) {
|
|
|
2026
2038
|
e[8]
|
|
2027
2039
|
), {
|
|
2028
2040
|
c() {
|
|
2029
|
-
|
|
2041
|
+
te(t.$$.fragment);
|
|
2030
2042
|
},
|
|
2031
2043
|
m(o, i) {
|
|
2032
|
-
|
|
2044
|
+
$(t, o, i), n = !0;
|
|
2033
2045
|
},
|
|
2034
2046
|
p(o, [i]) {
|
|
2035
2047
|
const s = {};
|
|
@@ -2041,13 +2053,13 @@ function Lo(e) {
|
|
|
2041
2053
|
1562 && (s.$$scope = { dirty: i, ctx: o }), t.$set(s);
|
|
2042
2054
|
},
|
|
2043
2055
|
i(o) {
|
|
2044
|
-
n || (
|
|
2056
|
+
n || (I(t.$$.fragment, o), n = !0);
|
|
2045
2057
|
},
|
|
2046
2058
|
o(o) {
|
|
2047
|
-
|
|
2059
|
+
X(t.$$.fragment, o), n = !1;
|
|
2048
2060
|
},
|
|
2049
2061
|
d(o) {
|
|
2050
|
-
|
|
2062
|
+
ee(t, o);
|
|
2051
2063
|
}
|
|
2052
2064
|
};
|
|
2053
2065
|
}
|
|
@@ -2055,22 +2067,22 @@ function ko(e, t, n) {
|
|
|
2055
2067
|
let o, { shape: i } = t, { computedStyle: s } = t, { transform: r } = t, { viewportScale: l = 1 } = t;
|
|
2056
2068
|
const a = (d, g, m) => {
|
|
2057
2069
|
const y = d.geometry.bounds;
|
|
2058
|
-
let [
|
|
2059
|
-
const [
|
|
2070
|
+
let [b, p] = [y.minX, y.minY], [A, _] = [y.maxX, y.maxY];
|
|
2071
|
+
const [E, B] = m;
|
|
2060
2072
|
if (g === "SHAPE")
|
|
2061
|
-
|
|
2073
|
+
b += E, A += E, p += B, _ += B;
|
|
2062
2074
|
else {
|
|
2063
2075
|
switch (g) {
|
|
2064
2076
|
case "TOP":
|
|
2065
2077
|
case "TOP_LEFT":
|
|
2066
2078
|
case "TOP_RIGHT": {
|
|
2067
|
-
p +=
|
|
2079
|
+
p += B;
|
|
2068
2080
|
break;
|
|
2069
2081
|
}
|
|
2070
2082
|
case "BOTTOM":
|
|
2071
2083
|
case "BOTTOM_LEFT":
|
|
2072
2084
|
case "BOTTOM_RIGHT": {
|
|
2073
|
-
|
|
2085
|
+
_ += B;
|
|
2074
2086
|
break;
|
|
2075
2087
|
}
|
|
2076
2088
|
}
|
|
@@ -2078,42 +2090,42 @@ function ko(e, t, n) {
|
|
|
2078
2090
|
case "LEFT":
|
|
2079
2091
|
case "TOP_LEFT":
|
|
2080
2092
|
case "BOTTOM_LEFT": {
|
|
2081
|
-
|
|
2093
|
+
b += E;
|
|
2082
2094
|
break;
|
|
2083
2095
|
}
|
|
2084
2096
|
case "RIGHT":
|
|
2085
2097
|
case "TOP_RIGHT":
|
|
2086
2098
|
case "BOTTOM_RIGHT": {
|
|
2087
|
-
|
|
2099
|
+
A += E;
|
|
2088
2100
|
break;
|
|
2089
2101
|
}
|
|
2090
2102
|
}
|
|
2091
2103
|
}
|
|
2092
|
-
const
|
|
2104
|
+
const V = Math.min(b, A), U = Math.min(p, _), R = Math.abs(A - b), Y = Math.abs(_ - p);
|
|
2093
2105
|
return {
|
|
2094
2106
|
...d,
|
|
2095
2107
|
geometry: {
|
|
2096
|
-
x:
|
|
2108
|
+
x: V,
|
|
2097
2109
|
y: U,
|
|
2098
|
-
w:
|
|
2099
|
-
h:
|
|
2110
|
+
w: R,
|
|
2111
|
+
h: Y,
|
|
2100
2112
|
bounds: {
|
|
2101
|
-
minX:
|
|
2113
|
+
minX: V,
|
|
2102
2114
|
minY: U,
|
|
2103
|
-
maxX:
|
|
2104
|
-
maxY: U +
|
|
2115
|
+
maxX: V + R,
|
|
2116
|
+
maxY: U + Y
|
|
2105
2117
|
}
|
|
2106
2118
|
}
|
|
2107
2119
|
};
|
|
2108
2120
|
};
|
|
2109
2121
|
function c(d) {
|
|
2110
|
-
|
|
2122
|
+
de.call(this, e, d);
|
|
2111
2123
|
}
|
|
2112
2124
|
function u(d) {
|
|
2113
|
-
|
|
2125
|
+
de.call(this, e, d);
|
|
2114
2126
|
}
|
|
2115
2127
|
function f(d) {
|
|
2116
|
-
|
|
2128
|
+
de.call(this, e, d);
|
|
2117
2129
|
}
|
|
2118
2130
|
return e.$$set = (d) => {
|
|
2119
2131
|
"shape" in d && n(0, i = d.shape), "computedStyle" in d && n(1, s = d.computedStyle), "transform" in d && n(2, r = d.transform), "viewportScale" in d && n(3, l = d.viewportScale);
|
|
@@ -2132,9 +2144,9 @@ function ko(e, t, n) {
|
|
|
2132
2144
|
f
|
|
2133
2145
|
];
|
|
2134
2146
|
}
|
|
2135
|
-
class Oo extends
|
|
2147
|
+
class Oo extends oe {
|
|
2136
2148
|
constructor(t) {
|
|
2137
|
-
super(),
|
|
2149
|
+
super(), ne(this, t, ko, Lo, J, {
|
|
2138
2150
|
shape: 0,
|
|
2139
2151
|
computedStyle: 1,
|
|
2140
2152
|
transform: 2,
|
|
@@ -2142,10 +2154,10 @@ class Oo extends te {
|
|
|
2142
2154
|
});
|
|
2143
2155
|
}
|
|
2144
2156
|
}
|
|
2145
|
-
const
|
|
2146
|
-
[
|
|
2147
|
-
[
|
|
2148
|
-
]), Bo = (e) =>
|
|
2157
|
+
const Qt = /* @__PURE__ */ new Map([
|
|
2158
|
+
[q.RECTANGLE, Oo],
|
|
2159
|
+
[q.POLYGON, yo]
|
|
2160
|
+
]), Bo = (e) => Qt.get(e.type), Io = (e, t) => Qt.set(e, t), Po = (e) => ({}), St = (e) => ({ grab: (
|
|
2149
2161
|
/*onGrab*/
|
|
2150
2162
|
e[0]
|
|
2151
2163
|
) });
|
|
@@ -2163,17 +2175,17 @@ function Yo(e) {
|
|
|
2163
2175
|
);
|
|
2164
2176
|
return {
|
|
2165
2177
|
c() {
|
|
2166
|
-
t =
|
|
2178
|
+
t = C("g"), r && r.c(), h(t, "class", "a9s-annotation selected");
|
|
2167
2179
|
},
|
|
2168
2180
|
m(l, a) {
|
|
2169
|
-
|
|
2170
|
-
|
|
2181
|
+
O(l, t, a), r && r.m(t, null), n = !0, o || (i = [
|
|
2182
|
+
j(
|
|
2171
2183
|
t,
|
|
2172
2184
|
"pointerup",
|
|
2173
2185
|
/*onRelease*/
|
|
2174
2186
|
e[2]
|
|
2175
2187
|
),
|
|
2176
|
-
|
|
2188
|
+
j(
|
|
2177
2189
|
t,
|
|
2178
2190
|
"pointermove",
|
|
2179
2191
|
/*onPointerMove*/
|
|
@@ -2203,26 +2215,26 @@ function Yo(e) {
|
|
|
2203
2215
|
);
|
|
2204
2216
|
},
|
|
2205
2217
|
i(l) {
|
|
2206
|
-
n || (
|
|
2218
|
+
n || (I(r, l), n = !0);
|
|
2207
2219
|
},
|
|
2208
2220
|
o(l) {
|
|
2209
|
-
|
|
2221
|
+
X(r, l), n = !1;
|
|
2210
2222
|
},
|
|
2211
2223
|
d(l) {
|
|
2212
|
-
l && k(t), r && r.d(l), o = !1,
|
|
2224
|
+
l && k(t), r && r.d(l), o = !1, ce(i);
|
|
2213
2225
|
}
|
|
2214
2226
|
};
|
|
2215
2227
|
}
|
|
2216
|
-
function
|
|
2228
|
+
function Do(e, t, n) {
|
|
2217
2229
|
let { $$slots: o = {}, $$scope: i } = t;
|
|
2218
2230
|
const s = Te();
|
|
2219
2231
|
let { shape: r } = t, { editor: l } = t, { transform: a } = t, c, u, f;
|
|
2220
|
-
const d = (y) => (
|
|
2221
|
-
c = y, u = a.elementToImage(
|
|
2232
|
+
const d = (y) => (b) => {
|
|
2233
|
+
c = y, u = a.elementToImage(b.offsetX, b.offsetY), f = r, b.target.setPointerCapture(b.pointerId), s("grab", b);
|
|
2222
2234
|
}, g = (y) => {
|
|
2223
2235
|
if (c) {
|
|
2224
|
-
const [
|
|
2225
|
-
n(3, r = l(f, c,
|
|
2236
|
+
const [b, p] = a.elementToImage(y.offsetX, y.offsetY), A = [b - u[0], p - u[1]];
|
|
2237
|
+
n(3, r = l(f, c, A)), s("change", r);
|
|
2226
2238
|
}
|
|
2227
2239
|
}, m = (y) => {
|
|
2228
2240
|
y.target.releasePointerCapture(y.pointerId), c = void 0, f = r, s("release", y);
|
|
@@ -2231,9 +2243,9 @@ function Co(e, t, n) {
|
|
|
2231
2243
|
"shape" in y && n(3, r = y.shape), "editor" in y && n(4, l = y.editor), "transform" in y && n(5, a = y.transform), "$$scope" in y && n(6, i = y.$$scope);
|
|
2232
2244
|
}, [d, g, m, r, l, a, i, o];
|
|
2233
2245
|
}
|
|
2234
|
-
class
|
|
2246
|
+
class Zt extends oe {
|
|
2235
2247
|
constructor(t) {
|
|
2236
|
-
super(),
|
|
2248
|
+
super(), ne(this, t, Do, Yo, J, { shape: 3, editor: 4, transform: 5 });
|
|
2237
2249
|
}
|
|
2238
2250
|
}
|
|
2239
2251
|
const je = (e, t) => {
|
|
@@ -2244,7 +2256,7 @@ const je = (e, t) => {
|
|
|
2244
2256
|
return o && (s += `fill:${o};stroke:${o};`), s += `fill-opacity:${i || "0.25"};`, s;
|
|
2245
2257
|
}
|
|
2246
2258
|
};
|
|
2247
|
-
function
|
|
2259
|
+
function Xo(e, t, n) {
|
|
2248
2260
|
let o;
|
|
2249
2261
|
const i = Te();
|
|
2250
2262
|
let { annotation: s } = t, { editor: r } = t, { style: l } = t, { target: a } = t, { transform: c } = t, { viewportScale: u } = t, f;
|
|
@@ -2270,9 +2282,9 @@ function Do(e, t, n) {
|
|
|
2270
2282
|
96 && f && f.$set({ viewportScale: u });
|
|
2271
2283
|
}, [s, r, l, a, c, u, f];
|
|
2272
2284
|
}
|
|
2273
|
-
class
|
|
2285
|
+
class Co extends oe {
|
|
2274
2286
|
constructor(t) {
|
|
2275
|
-
super(),
|
|
2287
|
+
super(), ne(this, t, Xo, null, J, {
|
|
2276
2288
|
annotation: 0,
|
|
2277
2289
|
editor: 1,
|
|
2278
2290
|
style: 2,
|
|
@@ -2308,9 +2320,9 @@ function Ro(e, t, n) {
|
|
|
2308
2320
|
48 && c && c.$set({ viewportScale: a });
|
|
2309
2321
|
}, [i, s, r, l, a, c];
|
|
2310
2322
|
}
|
|
2311
|
-
class
|
|
2323
|
+
class No extends oe {
|
|
2312
2324
|
constructor(t) {
|
|
2313
|
-
super(),
|
|
2325
|
+
super(), ne(this, t, Ro, null, J, {
|
|
2314
2326
|
drawingMode: 0,
|
|
2315
2327
|
target: 1,
|
|
2316
2328
|
tool: 2,
|
|
@@ -2323,7 +2335,7 @@ function Tt(e) {
|
|
|
2323
2335
|
let t, n;
|
|
2324
2336
|
return {
|
|
2325
2337
|
c() {
|
|
2326
|
-
t =
|
|
2338
|
+
t = C("rect"), n = C("rect"), h(t, "class", "a9s-outer"), h(
|
|
2327
2339
|
t,
|
|
2328
2340
|
"x",
|
|
2329
2341
|
/*x*/
|
|
@@ -2366,7 +2378,7 @@ function Tt(e) {
|
|
|
2366
2378
|
);
|
|
2367
2379
|
},
|
|
2368
2380
|
m(o, i) {
|
|
2369
|
-
|
|
2381
|
+
O(o, t, i), O(o, n, i);
|
|
2370
2382
|
},
|
|
2371
2383
|
p(o, i) {
|
|
2372
2384
|
i & /*x*/
|
|
@@ -2424,24 +2436,24 @@ function Tt(e) {
|
|
|
2424
2436
|
}
|
|
2425
2437
|
};
|
|
2426
2438
|
}
|
|
2427
|
-
function
|
|
2439
|
+
function Uo(e) {
|
|
2428
2440
|
let t, n = (
|
|
2429
2441
|
/*origin*/
|
|
2430
2442
|
e[0] && Tt(e)
|
|
2431
2443
|
);
|
|
2432
2444
|
return {
|
|
2433
2445
|
c() {
|
|
2434
|
-
t =
|
|
2446
|
+
t = C("g"), n && n.c(), h(t, "class", "a9s-annotation a9s-rubberband");
|
|
2435
2447
|
},
|
|
2436
2448
|
m(o, i) {
|
|
2437
|
-
|
|
2449
|
+
O(o, t, i), n && n.m(t, null);
|
|
2438
2450
|
},
|
|
2439
2451
|
p(o, [i]) {
|
|
2440
2452
|
/*origin*/
|
|
2441
2453
|
o[0] ? n ? n.p(o, i) : (n = Tt(o), n.c(), n.m(t, null)) : n && (n.d(1), n = null);
|
|
2442
2454
|
},
|
|
2443
|
-
i:
|
|
2444
|
-
o:
|
|
2455
|
+
i: F,
|
|
2456
|
+
o: F,
|
|
2445
2457
|
d(o) {
|
|
2446
2458
|
o && k(t), n && n.d();
|
|
2447
2459
|
}
|
|
@@ -2450,24 +2462,24 @@ function No(e) {
|
|
|
2450
2462
|
function Vo(e, t, n) {
|
|
2451
2463
|
const o = Te();
|
|
2452
2464
|
let { addEventListener: i } = t, { drawingMode: s } = t, { transform: r } = t, l, a, c, u, f, d, g;
|
|
2453
|
-
const m = (
|
|
2454
|
-
const
|
|
2455
|
-
l = performance.now(), s === "drag" && (n(0, a = r.elementToImage(
|
|
2456
|
-
}, y = (
|
|
2457
|
-
const
|
|
2458
|
-
a && (c = r.elementToImage(
|
|
2459
|
-
},
|
|
2460
|
-
const
|
|
2465
|
+
const m = (A) => {
|
|
2466
|
+
const _ = A;
|
|
2467
|
+
l = performance.now(), s === "drag" && (n(0, a = r.elementToImage(_.offsetX, _.offsetY)), c = a, n(1, u = a[0]), n(2, f = a[1]), n(3, d = 1), n(4, g = 1));
|
|
2468
|
+
}, y = (A) => {
|
|
2469
|
+
const _ = A;
|
|
2470
|
+
a && (c = r.elementToImage(_.offsetX, _.offsetY), n(1, u = Math.min(c[0], a[0])), n(2, f = Math.min(c[1], a[1])), n(3, d = Math.abs(c[0] - a[0])), n(4, g = Math.abs(c[1] - a[1])));
|
|
2471
|
+
}, b = (A) => {
|
|
2472
|
+
const _ = A, E = performance.now() - l;
|
|
2461
2473
|
if (s === "click") {
|
|
2462
|
-
if (
|
|
2474
|
+
if (E > 300)
|
|
2463
2475
|
return;
|
|
2464
|
-
|
|
2476
|
+
_.stopPropagation(), a ? p() : (n(0, a = r.elementToImage(_.offsetX, _.offsetY)), c = a, n(1, u = a[0]), n(2, f = a[1]), n(3, d = 1), n(4, g = 1));
|
|
2465
2477
|
} else
|
|
2466
|
-
a && (
|
|
2478
|
+
a && (E > 300 || d * g > 100 ? (_.stopPropagation(), p()) : (n(0, a = void 0), c = void 0));
|
|
2467
2479
|
}, p = () => {
|
|
2468
2480
|
if (d * g > 15) {
|
|
2469
|
-
const
|
|
2470
|
-
type:
|
|
2481
|
+
const A = {
|
|
2482
|
+
type: q.RECTANGLE,
|
|
2471
2483
|
geometry: {
|
|
2472
2484
|
bounds: {
|
|
2473
2485
|
minX: u,
|
|
@@ -2481,19 +2493,19 @@ function Vo(e, t, n) {
|
|
|
2481
2493
|
h: g
|
|
2482
2494
|
}
|
|
2483
2495
|
};
|
|
2484
|
-
o("create",
|
|
2496
|
+
o("create", A);
|
|
2485
2497
|
}
|
|
2486
2498
|
n(0, a = void 0), c = void 0;
|
|
2487
2499
|
};
|
|
2488
2500
|
return Ye(() => {
|
|
2489
|
-
i("pointerdown", m), i("pointermove", y), i("pointerup",
|
|
2490
|
-
}), e.$$set = (
|
|
2491
|
-
"addEventListener" in
|
|
2501
|
+
i("pointerdown", m), i("pointermove", y), i("pointerup", b, !0);
|
|
2502
|
+
}), e.$$set = (A) => {
|
|
2503
|
+
"addEventListener" in A && n(5, i = A.addEventListener), "drawingMode" in A && n(6, s = A.drawingMode), "transform" in A && n(7, r = A.transform);
|
|
2492
2504
|
}, [a, u, f, d, g, i, s, r];
|
|
2493
2505
|
}
|
|
2494
|
-
class Go extends
|
|
2506
|
+
class Go extends oe {
|
|
2495
2507
|
constructor(t) {
|
|
2496
|
-
super(),
|
|
2508
|
+
super(), ne(this, t, Vo, Uo, J, {
|
|
2497
2509
|
addEventListener: 5,
|
|
2498
2510
|
drawingMode: 6,
|
|
2499
2511
|
transform: 7
|
|
@@ -2522,12 +2534,12 @@ function Mt(e) {
|
|
|
2522
2534
|
);
|
|
2523
2535
|
return {
|
|
2524
2536
|
c() {
|
|
2525
|
-
t =
|
|
2537
|
+
t = C("polygon"), o = C("polygon"), r && r.c(), s = fe(), h(t, "class", "a9s-outer"), h(t, "points", n = /*coords*/
|
|
2526
2538
|
e[16]), h(o, "class", "a9s-inner"), h(o, "points", i = /*coords*/
|
|
2527
2539
|
e[16]);
|
|
2528
2540
|
},
|
|
2529
2541
|
m(l, a) {
|
|
2530
|
-
|
|
2542
|
+
O(l, t, a), O(l, o, a), r && r.m(l, a), O(l, s, a);
|
|
2531
2543
|
},
|
|
2532
2544
|
p(l, a) {
|
|
2533
2545
|
a & /*isClosable, points, cursor*/
|
|
@@ -2546,7 +2558,7 @@ function vt(e) {
|
|
|
2546
2558
|
let t, n, o;
|
|
2547
2559
|
return {
|
|
2548
2560
|
c() {
|
|
2549
|
-
t =
|
|
2561
|
+
t = C("rect"), h(t, "class", "a9s-corner-handle"), h(t, "x", n = /*points*/
|
|
2550
2562
|
e[0][0][0] - /*handleSize*/
|
|
2551
2563
|
e[3] / 2), h(t, "y", o = /*points*/
|
|
2552
2564
|
e[0][0][1] - /*handleSize*/
|
|
@@ -2563,7 +2575,7 @@ function vt(e) {
|
|
|
2563
2575
|
);
|
|
2564
2576
|
},
|
|
2565
2577
|
m(i, s) {
|
|
2566
|
-
|
|
2578
|
+
O(i, t, s);
|
|
2567
2579
|
},
|
|
2568
2580
|
p(i, s) {
|
|
2569
2581
|
s & /*points, handleSize*/
|
|
@@ -2598,17 +2610,17 @@ function zo(e) {
|
|
|
2598
2610
|
);
|
|
2599
2611
|
return {
|
|
2600
2612
|
c() {
|
|
2601
|
-
t =
|
|
2613
|
+
t = C("g"), n && n.c(), h(t, "class", "a9s-annotation a9s-rubberband");
|
|
2602
2614
|
},
|
|
2603
2615
|
m(o, i) {
|
|
2604
|
-
|
|
2616
|
+
O(o, t, i), n && n.m(t, null);
|
|
2605
2617
|
},
|
|
2606
2618
|
p(o, [i]) {
|
|
2607
2619
|
/*cursor*/
|
|
2608
2620
|
o[1] ? n ? n.p(xe(o), i) : (n = Mt(xe(o)), n.c(), n.m(t, null)) : n && (n.d(1), n = null);
|
|
2609
2621
|
},
|
|
2610
|
-
i:
|
|
2611
|
-
o:
|
|
2622
|
+
i: F,
|
|
2623
|
+
o: F,
|
|
2612
2624
|
d(o) {
|
|
2613
2625
|
o && k(t), n && n.d();
|
|
2614
2626
|
}
|
|
@@ -2619,68 +2631,68 @@ function jo(e, t, n) {
|
|
|
2619
2631
|
let o;
|
|
2620
2632
|
const i = Te();
|
|
2621
2633
|
let { addEventListener: s } = t, { drawingMode: r } = t, { transform: l } = t, { viewportScale: a = 1 } = t, c, u = [], f, d, g = !1;
|
|
2622
|
-
const m = (
|
|
2623
|
-
const
|
|
2624
|
-
if (c = { timeStamp:
|
|
2625
|
-
const
|
|
2626
|
-
u.push(
|
|
2634
|
+
const m = (_) => {
|
|
2635
|
+
const E = _, { timeStamp: B, offsetX: V, offsetY: U } = E;
|
|
2636
|
+
if (c = { timeStamp: B, offsetX: V, offsetY: U }, r === "drag" && u.length === 0) {
|
|
2637
|
+
const R = l.elementToImage(E.offsetX, E.offsetY);
|
|
2638
|
+
u.push(R), n(1, f = R);
|
|
2627
2639
|
}
|
|
2628
|
-
}, y = (
|
|
2629
|
-
const
|
|
2640
|
+
}, y = (_) => {
|
|
2641
|
+
const E = _;
|
|
2630
2642
|
if (d && clearTimeout(d), u.length > 0) {
|
|
2631
|
-
if (n(1, f = l.elementToImage(
|
|
2632
|
-
const
|
|
2633
|
-
n(2, g =
|
|
2643
|
+
if (n(1, f = l.elementToImage(E.offsetX, E.offsetY)), u.length > 2) {
|
|
2644
|
+
const B = Ze(f, u[0]) * a;
|
|
2645
|
+
n(2, g = B < Ho);
|
|
2634
2646
|
}
|
|
2635
|
-
|
|
2647
|
+
E.pointerType === "touch" && (d = setTimeout(
|
|
2636
2648
|
() => {
|
|
2637
2649
|
p();
|
|
2638
2650
|
},
|
|
2639
2651
|
Fo
|
|
2640
2652
|
));
|
|
2641
2653
|
}
|
|
2642
|
-
},
|
|
2643
|
-
const
|
|
2654
|
+
}, b = (_) => {
|
|
2655
|
+
const E = _;
|
|
2644
2656
|
if (d && clearTimeout(d), r === "click") {
|
|
2645
|
-
const
|
|
2646
|
-
if (
|
|
2657
|
+
const B = E.timeStamp - c.timeStamp, V = Ze([c.offsetX, c.offsetY], [E.offsetX, E.offsetY]);
|
|
2658
|
+
if (B > 300 || V > 15)
|
|
2647
2659
|
return;
|
|
2648
2660
|
if (g)
|
|
2649
|
-
|
|
2661
|
+
A();
|
|
2650
2662
|
else if (u.length === 0) {
|
|
2651
|
-
const U = l.elementToImage(
|
|
2663
|
+
const U = l.elementToImage(E.offsetX, E.offsetY);
|
|
2652
2664
|
u.push(U), n(1, f = U);
|
|
2653
2665
|
} else
|
|
2654
2666
|
u.push(f);
|
|
2655
2667
|
} else {
|
|
2656
|
-
if (u.length === 1 &&
|
|
2668
|
+
if (u.length === 1 && Ze(u[0], f) <= 4) {
|
|
2657
2669
|
n(0, u = []), n(1, f = void 0);
|
|
2658
2670
|
return;
|
|
2659
2671
|
}
|
|
2660
|
-
|
|
2672
|
+
E.stopImmediatePropagation(), g ? A() : u.push(f);
|
|
2661
2673
|
}
|
|
2662
2674
|
}, p = () => {
|
|
2663
2675
|
if (!f)
|
|
2664
2676
|
return;
|
|
2665
|
-
const
|
|
2666
|
-
type:
|
|
2667
|
-
geometry: { bounds: Fe(
|
|
2677
|
+
const _ = [...u, f], E = {
|
|
2678
|
+
type: q.POLYGON,
|
|
2679
|
+
geometry: { bounds: Fe(_), points: _ }
|
|
2668
2680
|
};
|
|
2669
|
-
st(
|
|
2670
|
-
},
|
|
2671
|
-
const
|
|
2672
|
-
type:
|
|
2681
|
+
st(E) > 4 && (n(0, u = []), n(1, f = void 0), i("create", E));
|
|
2682
|
+
}, A = () => {
|
|
2683
|
+
const _ = {
|
|
2684
|
+
type: q.POLYGON,
|
|
2673
2685
|
geometry: {
|
|
2674
2686
|
bounds: Fe(u),
|
|
2675
2687
|
points: [...u]
|
|
2676
2688
|
}
|
|
2677
2689
|
};
|
|
2678
|
-
n(0, u = []), n(1, f = void 0), i("create",
|
|
2690
|
+
n(0, u = []), n(1, f = void 0), i("create", _);
|
|
2679
2691
|
};
|
|
2680
2692
|
return Ye(() => {
|
|
2681
|
-
s("pointerdown", m, !0), s("pointermove", y), s("pointerup",
|
|
2682
|
-
}), e.$$set = (
|
|
2683
|
-
"addEventListener" in
|
|
2693
|
+
s("pointerdown", m, !0), s("pointermove", y), s("pointerup", b, !0), s("dblclick", p, !0);
|
|
2694
|
+
}), e.$$set = (_) => {
|
|
2695
|
+
"addEventListener" in _ && n(4, s = _.addEventListener), "drawingMode" in _ && n(5, r = _.drawingMode), "transform" in _ && n(6, l = _.transform), "viewportScale" in _ && n(7, a = _.viewportScale);
|
|
2684
2696
|
}, e.$$.update = () => {
|
|
2685
2697
|
e.$$.dirty & /*viewportScale*/
|
|
2686
2698
|
128 && n(3, o = 10 / a);
|
|
@@ -2695,9 +2707,9 @@ function jo(e, t, n) {
|
|
|
2695
2707
|
a
|
|
2696
2708
|
];
|
|
2697
2709
|
}
|
|
2698
|
-
class qo extends
|
|
2710
|
+
class qo extends oe {
|
|
2699
2711
|
constructor(t) {
|
|
2700
|
-
super(),
|
|
2712
|
+
super(), ne(this, t, jo, zo, J, {
|
|
2701
2713
|
addEventListener: 4,
|
|
2702
2714
|
drawingMode: 5,
|
|
2703
2715
|
transform: 6,
|
|
@@ -2713,7 +2725,7 @@ function Wo(e) {
|
|
|
2713
2725
|
let t, n, o, i, s;
|
|
2714
2726
|
return {
|
|
2715
2727
|
c() {
|
|
2716
|
-
t =
|
|
2728
|
+
t = C("g"), n = C("ellipse"), i = C("ellipse"), h(n, "class", "a9s-outer"), h(n, "style", o = /*computedStyle*/
|
|
2717
2729
|
e[1] ? "display:none;" : void 0), h(
|
|
2718
2730
|
n,
|
|
2719
2731
|
"cx",
|
|
@@ -2763,7 +2775,7 @@ function Wo(e) {
|
|
|
2763
2775
|
e[0].id);
|
|
2764
2776
|
},
|
|
2765
2777
|
m(r, l) {
|
|
2766
|
-
|
|
2778
|
+
O(r, t, l), re(t, n), re(t, i);
|
|
2767
2779
|
},
|
|
2768
2780
|
p(r, [l]) {
|
|
2769
2781
|
l & /*computedStyle*/
|
|
@@ -2778,8 +2790,8 @@ function Wo(e) {
|
|
|
2778
2790
|
1 && s !== (s = /*annotation*/
|
|
2779
2791
|
r[0].id) && h(t, "data-id", s);
|
|
2780
2792
|
},
|
|
2781
|
-
i:
|
|
2782
|
-
o:
|
|
2793
|
+
i: F,
|
|
2794
|
+
o: F,
|
|
2783
2795
|
d(r) {
|
|
2784
2796
|
r && k(t);
|
|
2785
2797
|
}
|
|
@@ -2795,16 +2807,16 @@ function Jo(e, t, n) {
|
|
|
2795
2807
|
129 && n(1, o = je(i, r));
|
|
2796
2808
|
}, [i, o, l, a, c, u, s, r];
|
|
2797
2809
|
}
|
|
2798
|
-
class
|
|
2810
|
+
class Qo extends oe {
|
|
2799
2811
|
constructor(t) {
|
|
2800
|
-
super(),
|
|
2812
|
+
super(), ne(this, t, Jo, Wo, J, { annotation: 0, geom: 6, style: 7 });
|
|
2801
2813
|
}
|
|
2802
2814
|
}
|
|
2803
|
-
function
|
|
2815
|
+
function Zo(e) {
|
|
2804
2816
|
let t, n, o, i, s;
|
|
2805
2817
|
return {
|
|
2806
2818
|
c() {
|
|
2807
|
-
t =
|
|
2819
|
+
t = C("g"), n = C("polygon"), i = C("polygon"), h(n, "class", "a9s-outer"), h(n, "style", o = /*computedStyle*/
|
|
2808
2820
|
e[1] ? "display:none;" : void 0), h(
|
|
2809
2821
|
n,
|
|
2810
2822
|
"points",
|
|
@@ -2824,7 +2836,7 @@ function Qo(e) {
|
|
|
2824
2836
|
e[0].id);
|
|
2825
2837
|
},
|
|
2826
2838
|
m(r, l) {
|
|
2827
|
-
|
|
2839
|
+
O(r, t, l), re(t, n), re(t, i);
|
|
2828
2840
|
},
|
|
2829
2841
|
p(r, [l]) {
|
|
2830
2842
|
l & /*computedStyle*/
|
|
@@ -2839,8 +2851,8 @@ function Qo(e) {
|
|
|
2839
2851
|
1 && s !== (s = /*annotation*/
|
|
2840
2852
|
r[0].id) && h(t, "data-id", s);
|
|
2841
2853
|
},
|
|
2842
|
-
i:
|
|
2843
|
-
o:
|
|
2854
|
+
i: F,
|
|
2855
|
+
o: F,
|
|
2844
2856
|
d(r) {
|
|
2845
2857
|
r && k(t);
|
|
2846
2858
|
}
|
|
@@ -2857,16 +2869,16 @@ function ei(e, t, n) {
|
|
|
2857
2869
|
17 && n(1, o = je(i, r));
|
|
2858
2870
|
}, [i, o, l, s, r];
|
|
2859
2871
|
}
|
|
2860
|
-
class ti extends
|
|
2872
|
+
class ti extends oe {
|
|
2861
2873
|
constructor(t) {
|
|
2862
|
-
super(),
|
|
2874
|
+
super(), ne(this, t, ei, Zo, J, { annotation: 0, geom: 3, style: 4 });
|
|
2863
2875
|
}
|
|
2864
2876
|
}
|
|
2865
2877
|
function ni(e) {
|
|
2866
2878
|
let t, n, o, i, s;
|
|
2867
2879
|
return {
|
|
2868
2880
|
c() {
|
|
2869
|
-
t =
|
|
2881
|
+
t = C("g"), n = C("rect"), i = C("rect"), h(n, "class", "a9s-outer"), h(n, "style", o = /*computedStyle*/
|
|
2870
2882
|
e[5] ? "display:none;" : void 0), h(
|
|
2871
2883
|
n,
|
|
2872
2884
|
"x",
|
|
@@ -2916,7 +2928,7 @@ function ni(e) {
|
|
|
2916
2928
|
e[0].id);
|
|
2917
2929
|
},
|
|
2918
2930
|
m(r, l) {
|
|
2919
|
-
|
|
2931
|
+
O(r, t, l), re(t, n), re(t, i);
|
|
2920
2932
|
},
|
|
2921
2933
|
p(r, [l]) {
|
|
2922
2934
|
l & /*computedStyle*/
|
|
@@ -2979,8 +2991,8 @@ function ni(e) {
|
|
|
2979
2991
|
1 && s !== (s = /*annotation*/
|
|
2980
2992
|
r[0].id) && h(t, "data-id", s);
|
|
2981
2993
|
},
|
|
2982
|
-
i:
|
|
2983
|
-
o:
|
|
2994
|
+
i: F,
|
|
2995
|
+
o: F,
|
|
2984
2996
|
d(r) {
|
|
2985
2997
|
r && k(t);
|
|
2986
2998
|
}
|
|
@@ -2996,12 +3008,12 @@ function oi(e, t, n) {
|
|
|
2996
3008
|
64 && n(4, { x: i, y: s, w: r, h: l } = c, i, (n(3, s), n(6, c)), (n(2, r), n(6, c)), (n(1, l), n(6, c)));
|
|
2997
3009
|
}, [a, l, r, s, i, o, c, u];
|
|
2998
3010
|
}
|
|
2999
|
-
class ii extends
|
|
3011
|
+
class ii extends oe {
|
|
3000
3012
|
constructor(t) {
|
|
3001
|
-
super(),
|
|
3013
|
+
super(), ne(this, t, oi, ni, J, { annotation: 0, geom: 6, style: 7 });
|
|
3002
3014
|
}
|
|
3003
3015
|
}
|
|
3004
|
-
const
|
|
3016
|
+
const Di = {
|
|
3005
3017
|
elementToImage: (e, t) => [e, t]
|
|
3006
3018
|
}, si = (e) => ({
|
|
3007
3019
|
elementToImage: (t, n) => {
|
|
@@ -3045,21 +3057,21 @@ function Ot(e) {
|
|
|
3045
3057
|
), n, o, i = Bt(e);
|
|
3046
3058
|
return {
|
|
3047
3059
|
c() {
|
|
3048
|
-
i.c(), n =
|
|
3060
|
+
i.c(), n = fe();
|
|
3049
3061
|
},
|
|
3050
3062
|
m(s, r) {
|
|
3051
|
-
i.m(s, r),
|
|
3063
|
+
i.m(s, r), O(s, n, r), o = !0;
|
|
3052
3064
|
},
|
|
3053
3065
|
p(s, r) {
|
|
3054
3066
|
r[0] & /*$store*/
|
|
3055
|
-
16384 &&
|
|
3056
|
-
s[34].id) ? (
|
|
3067
|
+
16384 && J(t, t = /*annotation*/
|
|
3068
|
+
s[34].id) ? (le(), X(i, 1, 1, F), ae(), i = Bt(s), i.c(), I(i, 1), i.m(n.parentNode, n)) : i.p(s, r);
|
|
3057
3069
|
},
|
|
3058
3070
|
i(s) {
|
|
3059
|
-
o || (
|
|
3071
|
+
o || (I(i), o = !0);
|
|
3060
3072
|
},
|
|
3061
3073
|
o(s) {
|
|
3062
|
-
|
|
3074
|
+
X(i), o = !1;
|
|
3063
3075
|
},
|
|
3064
3076
|
d(s) {
|
|
3065
3077
|
s && k(n), i.d(s);
|
|
@@ -3085,10 +3097,10 @@ function ci(e) {
|
|
|
3085
3097
|
}
|
|
3086
3098
|
}), {
|
|
3087
3099
|
c() {
|
|
3088
|
-
|
|
3100
|
+
te(t.$$.fragment);
|
|
3089
3101
|
},
|
|
3090
3102
|
m(o, i) {
|
|
3091
|
-
|
|
3103
|
+
$(t, o, i), n = !0;
|
|
3092
3104
|
},
|
|
3093
3105
|
p(o, i) {
|
|
3094
3106
|
const s = {};
|
|
@@ -3101,13 +3113,13 @@ function ci(e) {
|
|
|
3101
3113
|
o[1]), t.$set(s);
|
|
3102
3114
|
},
|
|
3103
3115
|
i(o) {
|
|
3104
|
-
n || (
|
|
3116
|
+
n || (I(t.$$.fragment, o), n = !0);
|
|
3105
3117
|
},
|
|
3106
3118
|
o(o) {
|
|
3107
|
-
|
|
3119
|
+
X(t.$$.fragment, o), n = !1;
|
|
3108
3120
|
},
|
|
3109
3121
|
d(o) {
|
|
3110
|
-
|
|
3122
|
+
ee(t, o);
|
|
3111
3123
|
}
|
|
3112
3124
|
};
|
|
3113
3125
|
}
|
|
@@ -3130,10 +3142,10 @@ function fi(e) {
|
|
|
3130
3142
|
}
|
|
3131
3143
|
}), {
|
|
3132
3144
|
c() {
|
|
3133
|
-
|
|
3145
|
+
te(t.$$.fragment);
|
|
3134
3146
|
},
|
|
3135
3147
|
m(o, i) {
|
|
3136
|
-
|
|
3148
|
+
$(t, o, i), n = !0;
|
|
3137
3149
|
},
|
|
3138
3150
|
p(o, i) {
|
|
3139
3151
|
const s = {};
|
|
@@ -3146,19 +3158,19 @@ function fi(e) {
|
|
|
3146
3158
|
o[1]), t.$set(s);
|
|
3147
3159
|
},
|
|
3148
3160
|
i(o) {
|
|
3149
|
-
n || (
|
|
3161
|
+
n || (I(t.$$.fragment, o), n = !0);
|
|
3150
3162
|
},
|
|
3151
3163
|
o(o) {
|
|
3152
|
-
|
|
3164
|
+
X(t.$$.fragment, o), n = !1;
|
|
3153
3165
|
},
|
|
3154
3166
|
d(o) {
|
|
3155
|
-
|
|
3167
|
+
ee(t, o);
|
|
3156
3168
|
}
|
|
3157
3169
|
};
|
|
3158
3170
|
}
|
|
3159
3171
|
function ui(e) {
|
|
3160
3172
|
let t, n;
|
|
3161
|
-
return t = new
|
|
3173
|
+
return t = new Qo({
|
|
3162
3174
|
props: {
|
|
3163
3175
|
annotation: (
|
|
3164
3176
|
/*annotation*/
|
|
@@ -3175,10 +3187,10 @@ function ui(e) {
|
|
|
3175
3187
|
}
|
|
3176
3188
|
}), {
|
|
3177
3189
|
c() {
|
|
3178
|
-
|
|
3190
|
+
te(t.$$.fragment);
|
|
3179
3191
|
},
|
|
3180
3192
|
m(o, i) {
|
|
3181
|
-
|
|
3193
|
+
$(t, o, i), n = !0;
|
|
3182
3194
|
},
|
|
3183
3195
|
p(o, i) {
|
|
3184
3196
|
const s = {};
|
|
@@ -3191,13 +3203,13 @@ function ui(e) {
|
|
|
3191
3203
|
o[1]), t.$set(s);
|
|
3192
3204
|
},
|
|
3193
3205
|
i(o) {
|
|
3194
|
-
n || (
|
|
3206
|
+
n || (I(t.$$.fragment, o), n = !0);
|
|
3195
3207
|
},
|
|
3196
3208
|
o(o) {
|
|
3197
|
-
|
|
3209
|
+
X(t.$$.fragment, o), n = !1;
|
|
3198
3210
|
},
|
|
3199
3211
|
d(o) {
|
|
3200
|
-
|
|
3212
|
+
ee(t, o);
|
|
3201
3213
|
}
|
|
3202
3214
|
};
|
|
3203
3215
|
}
|
|
@@ -3207,33 +3219,33 @@ function Bt(e) {
|
|
|
3207
3219
|
function l(a, c) {
|
|
3208
3220
|
return (
|
|
3209
3221
|
/*selector*/
|
|
3210
|
-
a[37].type ===
|
|
3222
|
+
a[37].type === q.ELLIPSE ? 0 : (
|
|
3211
3223
|
/*selector*/
|
|
3212
|
-
a[37].type ===
|
|
3224
|
+
a[37].type === q.RECTANGLE ? 1 : (
|
|
3213
3225
|
/*selector*/
|
|
3214
|
-
a[37].type ===
|
|
3226
|
+
a[37].type === q.POLYGON ? 2 : -1
|
|
3215
3227
|
)
|
|
3216
3228
|
)
|
|
3217
3229
|
);
|
|
3218
3230
|
}
|
|
3219
3231
|
return ~(t = l(e)) && (n = r[t] = s[t](e)), {
|
|
3220
3232
|
c() {
|
|
3221
|
-
n && n.c(), o =
|
|
3233
|
+
n && n.c(), o = fe();
|
|
3222
3234
|
},
|
|
3223
3235
|
m(a, c) {
|
|
3224
|
-
~t && r[t].m(a, c),
|
|
3236
|
+
~t && r[t].m(a, c), O(a, o, c), i = !0;
|
|
3225
3237
|
},
|
|
3226
3238
|
p(a, c) {
|
|
3227
3239
|
let u = t;
|
|
3228
|
-
t = l(a), t === u ? ~t && r[t].p(a, c) : (n && (
|
|
3240
|
+
t = l(a), t === u ? ~t && r[t].p(a, c) : (n && (le(), X(r[u], 1, 1, () => {
|
|
3229
3241
|
r[u] = null;
|
|
3230
|
-
}),
|
|
3242
|
+
}), ae()), ~t ? (n = r[t], n ? n.p(a, c) : (n = r[t] = s[t](a), n.c()), I(n, 1), n.m(o.parentNode, o)) : n = null);
|
|
3231
3243
|
},
|
|
3232
3244
|
i(a) {
|
|
3233
|
-
i || (
|
|
3245
|
+
i || (I(n), i = !0);
|
|
3234
3246
|
},
|
|
3235
3247
|
o(a) {
|
|
3236
|
-
|
|
3248
|
+
X(n), i = !1;
|
|
3237
3249
|
},
|
|
3238
3250
|
d(a) {
|
|
3239
3251
|
a && k(o), ~t && r[t].d(a);
|
|
@@ -3248,10 +3260,10 @@ function It(e) {
|
|
|
3248
3260
|
), n, o, i = t && Ot($e(e));
|
|
3249
3261
|
return {
|
|
3250
3262
|
c() {
|
|
3251
|
-
i && i.c(), n =
|
|
3263
|
+
i && i.c(), n = fe();
|
|
3252
3264
|
},
|
|
3253
3265
|
m(s, r) {
|
|
3254
|
-
i && i.m(s, r),
|
|
3266
|
+
i && i.m(s, r), O(s, n, r), o = !0;
|
|
3255
3267
|
},
|
|
3256
3268
|
p(s, r) {
|
|
3257
3269
|
r[0] & /*isEditable, $store*/
|
|
@@ -3260,15 +3272,15 @@ function It(e) {
|
|
|
3260
3272
|
/*annotation*/
|
|
3261
3273
|
s[34]
|
|
3262
3274
|
)), t ? i ? (i.p($e(s), r), r[0] & /*isEditable, $store*/
|
|
3263
|
-
16640 &&
|
|
3275
|
+
16640 && I(i, 1)) : (i = Ot($e(s)), i.c(), I(i, 1), i.m(n.parentNode, n)) : i && (le(), X(i, 1, 1, () => {
|
|
3264
3276
|
i = null;
|
|
3265
|
-
}),
|
|
3277
|
+
}), ae());
|
|
3266
3278
|
},
|
|
3267
3279
|
i(s) {
|
|
3268
|
-
o || (
|
|
3280
|
+
o || (I(i), o = !0);
|
|
3269
3281
|
},
|
|
3270
3282
|
o(s) {
|
|
3271
|
-
|
|
3283
|
+
X(i), o = !1;
|
|
3272
3284
|
},
|
|
3273
3285
|
d(s) {
|
|
3274
3286
|
s && k(n), i && i.d(s);
|
|
@@ -3290,22 +3302,22 @@ function Pt(e) {
|
|
|
3290
3302
|
}
|
|
3291
3303
|
return ~(t = l(e)) && (n = r[t] = s[t](e)), {
|
|
3292
3304
|
c() {
|
|
3293
|
-
n && n.c(), o =
|
|
3305
|
+
n && n.c(), o = fe();
|
|
3294
3306
|
},
|
|
3295
3307
|
m(a, c) {
|
|
3296
|
-
~t && r[t].m(a, c),
|
|
3308
|
+
~t && r[t].m(a, c), O(a, o, c), i = !0;
|
|
3297
3309
|
},
|
|
3298
3310
|
p(a, c) {
|
|
3299
3311
|
let u = t;
|
|
3300
|
-
t = l(a), t === u ? ~t && r[t].p(a, c) : (n && (
|
|
3312
|
+
t = l(a), t === u ? ~t && r[t].p(a, c) : (n && (le(), X(r[u], 1, 1, () => {
|
|
3301
3313
|
r[u] = null;
|
|
3302
|
-
}),
|
|
3314
|
+
}), ae()), ~t ? (n = r[t], n ? n.p(a, c) : (n = r[t] = s[t](a), n.c()), I(n, 1), n.m(o.parentNode, o)) : n = null);
|
|
3303
3315
|
},
|
|
3304
3316
|
i(a) {
|
|
3305
|
-
i || (
|
|
3317
|
+
i || (I(n), i = !0);
|
|
3306
3318
|
},
|
|
3307
3319
|
o(a) {
|
|
3308
|
-
|
|
3320
|
+
X(n), i = !1;
|
|
3309
3321
|
},
|
|
3310
3322
|
d(a) {
|
|
3311
3323
|
a && k(o), ~t && r[t].d(a);
|
|
@@ -3319,21 +3331,21 @@ function di(e) {
|
|
|
3319
3331
|
), n, o, i = Yt(e);
|
|
3320
3332
|
return {
|
|
3321
3333
|
c() {
|
|
3322
|
-
i.c(), n =
|
|
3334
|
+
i.c(), n = fe();
|
|
3323
3335
|
},
|
|
3324
3336
|
m(s, r) {
|
|
3325
|
-
i.m(s, r),
|
|
3337
|
+
i.m(s, r), O(s, n, r), o = !0;
|
|
3326
3338
|
},
|
|
3327
3339
|
p(s, r) {
|
|
3328
3340
|
r[0] & /*toolName*/
|
|
3329
|
-
4 &&
|
|
3330
|
-
s[2]) ? (
|
|
3341
|
+
4 && J(t, t = /*toolName*/
|
|
3342
|
+
s[2]) ? (le(), X(i, 1, 1, F), ae(), i = Yt(s), i.c(), I(i, 1), i.m(n.parentNode, n)) : i.p(s, r);
|
|
3331
3343
|
},
|
|
3332
3344
|
i(s) {
|
|
3333
|
-
o || (
|
|
3345
|
+
o || (I(i), o = !0);
|
|
3334
3346
|
},
|
|
3335
3347
|
o(s) {
|
|
3336
|
-
|
|
3348
|
+
X(i), o = !1;
|
|
3337
3349
|
},
|
|
3338
3350
|
d(s) {
|
|
3339
3351
|
s && k(n), i.d(s);
|
|
@@ -3346,20 +3358,20 @@ function hi(e) {
|
|
|
3346
3358
|
e[7]
|
|
3347
3359
|
), i = [];
|
|
3348
3360
|
for (let r = 0; r < o.length; r += 1)
|
|
3349
|
-
i[r] =
|
|
3350
|
-
const s = (r) =>
|
|
3361
|
+
i[r] = Xt(Lt(e, o, r));
|
|
3362
|
+
const s = (r) => X(i[r], 1, 1, () => {
|
|
3351
3363
|
i[r] = null;
|
|
3352
3364
|
});
|
|
3353
3365
|
return {
|
|
3354
3366
|
c() {
|
|
3355
3367
|
for (let r = 0; r < i.length; r += 1)
|
|
3356
3368
|
i[r].c();
|
|
3357
|
-
t =
|
|
3369
|
+
t = fe();
|
|
3358
3370
|
},
|
|
3359
3371
|
m(r, l) {
|
|
3360
3372
|
for (let a = 0; a < i.length; a += 1)
|
|
3361
3373
|
i[a] && i[a].m(r, l);
|
|
3362
|
-
|
|
3374
|
+
O(r, t, l), n = !0;
|
|
3363
3375
|
},
|
|
3364
3376
|
p(r, l) {
|
|
3365
3377
|
if (l[0] & /*editableAnnotations, drawingEl, getEditor, style, transform, $scale, onChangeSelected*/
|
|
@@ -3371,24 +3383,24 @@ function hi(e) {
|
|
|
3371
3383
|
let a;
|
|
3372
3384
|
for (a = 0; a < o.length; a += 1) {
|
|
3373
3385
|
const c = Lt(r, o, a);
|
|
3374
|
-
i[a] ? (i[a].p(c, l),
|
|
3386
|
+
i[a] ? (i[a].p(c, l), I(i[a], 1)) : (i[a] = Xt(c), i[a].c(), I(i[a], 1), i[a].m(t.parentNode, t));
|
|
3375
3387
|
}
|
|
3376
|
-
for (
|
|
3388
|
+
for (le(), a = o.length; a < i.length; a += 1)
|
|
3377
3389
|
s(a);
|
|
3378
|
-
|
|
3390
|
+
ae();
|
|
3379
3391
|
}
|
|
3380
3392
|
},
|
|
3381
3393
|
i(r) {
|
|
3382
3394
|
if (!n) {
|
|
3383
3395
|
for (let l = 0; l < o.length; l += 1)
|
|
3384
|
-
|
|
3396
|
+
I(i[l]);
|
|
3385
3397
|
n = !0;
|
|
3386
3398
|
}
|
|
3387
3399
|
},
|
|
3388
3400
|
o(r) {
|
|
3389
3401
|
i = i.filter(en);
|
|
3390
3402
|
for (let l = 0; l < i.length; l += 1)
|
|
3391
|
-
|
|
3403
|
+
X(i[l]);
|
|
3392
3404
|
n = !1;
|
|
3393
3405
|
},
|
|
3394
3406
|
d(r) {
|
|
@@ -3398,7 +3410,7 @@ function hi(e) {
|
|
|
3398
3410
|
}
|
|
3399
3411
|
function Yt(e) {
|
|
3400
3412
|
let t, n;
|
|
3401
|
-
return t = new
|
|
3413
|
+
return t = new No({
|
|
3402
3414
|
props: {
|
|
3403
3415
|
target: (
|
|
3404
3416
|
/*drawingEl*/
|
|
@@ -3427,10 +3439,10 @@ function Yt(e) {
|
|
|
3427
3439
|
e[18]
|
|
3428
3440
|
), {
|
|
3429
3441
|
c() {
|
|
3430
|
-
|
|
3442
|
+
te(t.$$.fragment);
|
|
3431
3443
|
},
|
|
3432
3444
|
m(o, i) {
|
|
3433
|
-
|
|
3445
|
+
$(t, o, i), n = !0;
|
|
3434
3446
|
},
|
|
3435
3447
|
p(o, i) {
|
|
3436
3448
|
const s = {};
|
|
@@ -3447,19 +3459,19 @@ function Yt(e) {
|
|
|
3447
3459
|
o[15]), t.$set(s);
|
|
3448
3460
|
},
|
|
3449
3461
|
i(o) {
|
|
3450
|
-
n || (
|
|
3462
|
+
n || (I(t.$$.fragment, o), n = !0);
|
|
3451
3463
|
},
|
|
3452
3464
|
o(o) {
|
|
3453
|
-
|
|
3465
|
+
X(t.$$.fragment, o), n = !1;
|
|
3454
3466
|
},
|
|
3455
3467
|
d(o) {
|
|
3456
|
-
|
|
3468
|
+
ee(t, o);
|
|
3457
3469
|
}
|
|
3458
3470
|
};
|
|
3459
3471
|
}
|
|
3460
|
-
function
|
|
3472
|
+
function Dt(e) {
|
|
3461
3473
|
let t, n;
|
|
3462
|
-
return t = new
|
|
3474
|
+
return t = new Co({
|
|
3463
3475
|
props: {
|
|
3464
3476
|
target: (
|
|
3465
3477
|
/*drawingEl*/
|
|
@@ -3490,7 +3502,7 @@ function Ct(e) {
|
|
|
3490
3502
|
)
|
|
3491
3503
|
}
|
|
3492
3504
|
}), t.$on("change", function() {
|
|
3493
|
-
|
|
3505
|
+
K(
|
|
3494
3506
|
/*onChangeSelected*/
|
|
3495
3507
|
e[19](
|
|
3496
3508
|
/*editable*/
|
|
@@ -3502,10 +3514,10 @@ function Ct(e) {
|
|
|
3502
3514
|
).apply(this, arguments);
|
|
3503
3515
|
}), {
|
|
3504
3516
|
c() {
|
|
3505
|
-
|
|
3517
|
+
te(t.$$.fragment);
|
|
3506
3518
|
},
|
|
3507
3519
|
m(o, i) {
|
|
3508
|
-
|
|
3520
|
+
$(t, o, i), n = !0;
|
|
3509
3521
|
},
|
|
3510
3522
|
p(o, i) {
|
|
3511
3523
|
e = o;
|
|
@@ -3528,38 +3540,38 @@ function Ct(e) {
|
|
|
3528
3540
|
e[15]), t.$set(s);
|
|
3529
3541
|
},
|
|
3530
3542
|
i(o) {
|
|
3531
|
-
n || (
|
|
3543
|
+
n || (I(t.$$.fragment, o), n = !0);
|
|
3532
3544
|
},
|
|
3533
3545
|
o(o) {
|
|
3534
|
-
|
|
3546
|
+
X(t.$$.fragment, o), n = !1;
|
|
3535
3547
|
},
|
|
3536
3548
|
d(o) {
|
|
3537
|
-
|
|
3549
|
+
ee(t, o);
|
|
3538
3550
|
}
|
|
3539
3551
|
};
|
|
3540
3552
|
}
|
|
3541
|
-
function
|
|
3553
|
+
function Xt(e) {
|
|
3542
3554
|
let t = (
|
|
3543
3555
|
/*editable*/
|
|
3544
3556
|
e[31].id
|
|
3545
|
-
), n, o, i =
|
|
3557
|
+
), n, o, i = Dt(e);
|
|
3546
3558
|
return {
|
|
3547
3559
|
c() {
|
|
3548
|
-
i.c(), n =
|
|
3560
|
+
i.c(), n = fe();
|
|
3549
3561
|
},
|
|
3550
3562
|
m(s, r) {
|
|
3551
|
-
i.m(s, r),
|
|
3563
|
+
i.m(s, r), O(s, n, r), o = !0;
|
|
3552
3564
|
},
|
|
3553
3565
|
p(s, r) {
|
|
3554
3566
|
r[0] & /*editableAnnotations*/
|
|
3555
|
-
128 &&
|
|
3556
|
-
s[31].id) ? (
|
|
3567
|
+
128 && J(t, t = /*editable*/
|
|
3568
|
+
s[31].id) ? (le(), X(i, 1, 1, F), ae(), i = Dt(s), i.c(), I(i, 1), i.m(n.parentNode, n)) : i.p(s, r);
|
|
3557
3569
|
},
|
|
3558
3570
|
i(s) {
|
|
3559
|
-
o || (
|
|
3571
|
+
o || (I(i), o = !0);
|
|
3560
3572
|
},
|
|
3561
3573
|
o(s) {
|
|
3562
|
-
|
|
3574
|
+
X(i), o = !1;
|
|
3563
3575
|
},
|
|
3564
3576
|
d(s) {
|
|
3565
3577
|
s && k(n), i.d(s);
|
|
@@ -3573,7 +3585,7 @@ function gi(e) {
|
|
|
3573
3585
|
), a = [];
|
|
3574
3586
|
for (let f = 0; f < l.length; f += 1)
|
|
3575
3587
|
a[f] = It(kt(e, l, f));
|
|
3576
|
-
const c = (f) =>
|
|
3588
|
+
const c = (f) => X(a[f], 1, 1, () => {
|
|
3577
3589
|
a[f] = null;
|
|
3578
3590
|
});
|
|
3579
3591
|
let u = (
|
|
@@ -3582,10 +3594,10 @@ function gi(e) {
|
|
|
3582
3594
|
);
|
|
3583
3595
|
return {
|
|
3584
3596
|
c() {
|
|
3585
|
-
t =
|
|
3597
|
+
t = C("svg"), n = C("g");
|
|
3586
3598
|
for (let f = 0; f < a.length; f += 1)
|
|
3587
3599
|
a[f].c();
|
|
3588
|
-
o =
|
|
3600
|
+
o = C("g"), u && u.c(), h(o, "class", "drawing"), h(t, "class", "a9s-annotationlayer"), Ee(
|
|
3589
3601
|
t,
|
|
3590
3602
|
"drawing",
|
|
3591
3603
|
/*tool*/
|
|
@@ -3594,18 +3606,18 @@ function gi(e) {
|
|
|
3594
3606
|
e[3]);
|
|
3595
3607
|
},
|
|
3596
3608
|
m(f, d) {
|
|
3597
|
-
|
|
3609
|
+
O(f, t, d), re(t, n);
|
|
3598
3610
|
for (let g = 0; g < a.length; g += 1)
|
|
3599
3611
|
a[g] && a[g].m(n, null);
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3612
|
+
re(t, o), u && u.m(o, null), e[27](o), e[28](t), i = !0, s || (r = [
|
|
3613
|
+
j(t, "pointerup", function() {
|
|
3614
|
+
K(
|
|
3603
3615
|
/*onPointerUp*/
|
|
3604
3616
|
e[9]
|
|
3605
3617
|
) && e[9].apply(this, arguments);
|
|
3606
3618
|
}),
|
|
3607
|
-
|
|
3608
|
-
|
|
3619
|
+
j(t, "pointerdown", function() {
|
|
3620
|
+
K(
|
|
3609
3621
|
/*onPointerDown*/
|
|
3610
3622
|
e[10]
|
|
3611
3623
|
) && e[10].apply(this, arguments);
|
|
@@ -3622,17 +3634,17 @@ function gi(e) {
|
|
|
3622
3634
|
let g;
|
|
3623
3635
|
for (g = 0; g < l.length; g += 1) {
|
|
3624
3636
|
const m = kt(e, l, g);
|
|
3625
|
-
a[g] ? (a[g].p(m, d),
|
|
3637
|
+
a[g] ? (a[g].p(m, d), I(a[g], 1)) : (a[g] = It(m), a[g].c(), I(a[g], 1), a[g].m(n, null));
|
|
3626
3638
|
}
|
|
3627
|
-
for (
|
|
3639
|
+
for (le(), g = l.length; g < a.length; g += 1)
|
|
3628
3640
|
c(g);
|
|
3629
|
-
|
|
3641
|
+
ae();
|
|
3630
3642
|
}
|
|
3631
3643
|
/*drawingEl*/
|
|
3632
3644
|
e[5] ? u ? (u.p(e, d), d[0] & /*drawingEl*/
|
|
3633
|
-
32 &&
|
|
3645
|
+
32 && I(u, 1)) : (u = Pt(e), u.c(), I(u, 1), u.m(o, null)) : u && (le(), X(u, 1, 1, () => {
|
|
3634
3646
|
u = null;
|
|
3635
|
-
}),
|
|
3647
|
+
}), ae()), (!i || d[0] & /*tool*/
|
|
3636
3648
|
8192) && Ee(
|
|
3637
3649
|
t,
|
|
3638
3650
|
"drawing",
|
|
@@ -3645,88 +3657,88 @@ function gi(e) {
|
|
|
3645
3657
|
i(f) {
|
|
3646
3658
|
if (!i) {
|
|
3647
3659
|
for (let d = 0; d < l.length; d += 1)
|
|
3648
|
-
|
|
3649
|
-
|
|
3660
|
+
I(a[d]);
|
|
3661
|
+
I(u), i = !0;
|
|
3650
3662
|
}
|
|
3651
3663
|
},
|
|
3652
3664
|
o(f) {
|
|
3653
3665
|
a = a.filter(en);
|
|
3654
3666
|
for (let d = 0; d < a.length; d += 1)
|
|
3655
|
-
|
|
3656
|
-
|
|
3667
|
+
X(a[d]);
|
|
3668
|
+
X(u), i = !1;
|
|
3657
3669
|
},
|
|
3658
3670
|
d(f) {
|
|
3659
|
-
f && k(t), rt(a, f), u && u.d(), e[27](null), e[28](null), s = !1,
|
|
3671
|
+
f && k(t), rt(a, f), u && u.d(), e[27](null), e[28](null), s = !1, ce(r);
|
|
3660
3672
|
}
|
|
3661
3673
|
};
|
|
3662
3674
|
}
|
|
3663
3675
|
function mi(e, t, n) {
|
|
3664
|
-
let o, i, s, r, l, a, c, u, f, d, g =
|
|
3676
|
+
let o, i, s, r, l, a, c, u, f, d, g = F, m = () => (g(), g = Vt(Y, (L) => n(15, d = L)), Y);
|
|
3665
3677
|
e.$$.on_destroy.push(() => g());
|
|
3666
|
-
let { drawingEnabled: y } = t, { image:
|
|
3667
|
-
Ye(() => m(n(6,
|
|
3668
|
-
const { selection:
|
|
3669
|
-
ht(e,
|
|
3670
|
-
let
|
|
3671
|
-
const
|
|
3672
|
-
|
|
3673
|
-
const
|
|
3674
|
-
|
|
3675
|
-
const { updated:
|
|
3676
|
-
n(7,
|
|
3677
|
-
},
|
|
3678
|
-
},
|
|
3679
|
-
const
|
|
3680
|
-
id:
|
|
3678
|
+
let { drawingEnabled: y } = t, { image: b } = t, { preferredDrawingMode: p } = t, { state: A } = t, { style: _ = void 0 } = t, { toolName: E = xt()[0] } = t, { user: B } = t, { visible: V = !0 } = t, U, R, Y;
|
|
3679
|
+
Ye(() => m(n(6, Y = bo(b, R))));
|
|
3680
|
+
const { selection: w, store: S } = A;
|
|
3681
|
+
ht(e, w, (L) => n(26, u = L)), ht(e, S, (L) => n(14, f = L));
|
|
3682
|
+
let T, M;
|
|
3683
|
+
const P = (L) => {
|
|
3684
|
+
T && S.unobserve(T);
|
|
3685
|
+
const Q = L.filter(({ editable: z }) => z).map(({ id: z }) => z);
|
|
3686
|
+
Q.length > 0 ? (n(7, M = Q.map((z) => S.getAnnotation(z)).filter(Boolean)), T = (z) => {
|
|
3687
|
+
const { updated: ue } = z.changes;
|
|
3688
|
+
n(7, M = ue == null ? void 0 : ue.map((Z) => Z.newValue));
|
|
3689
|
+
}, S.observe(T, { annotations: Q })) : n(7, M = void 0);
|
|
3690
|
+
}, G = (L) => {
|
|
3691
|
+
const Q = qt(), z = {
|
|
3692
|
+
id: Q,
|
|
3681
3693
|
bodies: [],
|
|
3682
3694
|
target: {
|
|
3683
|
-
annotation:
|
|
3695
|
+
annotation: Q,
|
|
3684
3696
|
selector: L.detail,
|
|
3685
|
-
creator:
|
|
3697
|
+
creator: B,
|
|
3686
3698
|
created: /* @__PURE__ */ new Date()
|
|
3687
3699
|
}
|
|
3688
3700
|
};
|
|
3689
|
-
|
|
3690
|
-
},
|
|
3691
|
-
var
|
|
3692
|
-
const { target:
|
|
3693
|
-
|
|
3694
|
-
...
|
|
3695
|
-
selector:
|
|
3696
|
-
created:
|
|
3697
|
-
updated:
|
|
3698
|
-
updatedBy:
|
|
3701
|
+
S.addAnnotation(z), w.setSelected(z.id);
|
|
3702
|
+
}, x = (L) => (Q) => {
|
|
3703
|
+
var N;
|
|
3704
|
+
const { target: z } = L, ue = 10 * 60 * 1e3, Z = ((N = z.creator) == null ? void 0 : N.id) !== B.id || !z.created || (/* @__PURE__ */ new Date()).getTime() - z.created.getTime() > ue;
|
|
3705
|
+
S.updateTarget({
|
|
3706
|
+
...z,
|
|
3707
|
+
selector: Q.detail,
|
|
3708
|
+
created: Z ? z.created : /* @__PURE__ */ new Date(),
|
|
3709
|
+
updated: Z ? /* @__PURE__ */ new Date() : void 0,
|
|
3710
|
+
updatedBy: Z ? B : void 0
|
|
3699
3711
|
});
|
|
3700
3712
|
}, Me = (L) => Bo(L);
|
|
3701
|
-
function
|
|
3713
|
+
function se(L) {
|
|
3702
3714
|
He[L ? "unshift" : "push"](() => {
|
|
3703
3715
|
U = L, n(5, U);
|
|
3704
3716
|
});
|
|
3705
3717
|
}
|
|
3706
3718
|
function ve(L) {
|
|
3707
3719
|
He[L ? "unshift" : "push"](() => {
|
|
3708
|
-
|
|
3720
|
+
R = L, n(4, R);
|
|
3709
3721
|
});
|
|
3710
3722
|
}
|
|
3711
3723
|
return e.$$set = (L) => {
|
|
3712
|
-
"drawingEnabled" in L && n(0, y = L.drawingEnabled), "image" in L && n(21,
|
|
3724
|
+
"drawingEnabled" in L && n(0, y = L.drawingEnabled), "image" in L && n(21, b = L.image), "preferredDrawingMode" in L && n(22, p = L.preferredDrawingMode), "state" in L && n(23, A = L.state), "style" in L && n(1, _ = L.style), "toolName" in L && n(2, E = L.toolName), "user" in L && n(24, B = L.user), "visible" in L && n(3, V = L.visible);
|
|
3713
3725
|
}, e.$$.update = () => {
|
|
3714
3726
|
e.$$.dirty[0] & /*toolName*/
|
|
3715
|
-
4 && n(13, { tool: o, opts: i } = $t(
|
|
3727
|
+
4 && n(13, { tool: o, opts: i } = $t(E) || { tool: void 0, opts: void 0 }, o, (n(25, i), n(2, E))), e.$$.dirty[0] & /*opts, preferredDrawingMode*/
|
|
3716
3728
|
37748736 && n(12, s = (i == null ? void 0 : i.drawingMode) || p), e.$$.dirty[0] & /*svgEl*/
|
|
3717
|
-
16 && n(11, r = si(
|
|
3718
|
-
16 && n(10, { onPointerDown: l, onPointerUp: a } = li(
|
|
3719
|
-
67108864 && n(8, c = (L) => u.selected.find((
|
|
3720
|
-
67108864 &&
|
|
3729
|
+
16 && n(11, r = si(R)), e.$$.dirty[0] & /*svgEl*/
|
|
3730
|
+
16 && n(10, { onPointerDown: l, onPointerUp: a } = li(R, S), l, (n(9, a), n(4, R))), e.$$.dirty[0] & /*$selection*/
|
|
3731
|
+
67108864 && n(8, c = (L) => u.selected.find((Q) => Q.id === L.id && Q.editable)), e.$$.dirty[0] & /*$selection*/
|
|
3732
|
+
67108864 && P(u.selected);
|
|
3721
3733
|
}, [
|
|
3722
3734
|
y,
|
|
3723
|
-
w,
|
|
3724
|
-
A,
|
|
3725
|
-
N,
|
|
3726
3735
|
_,
|
|
3736
|
+
E,
|
|
3737
|
+
V,
|
|
3738
|
+
R,
|
|
3727
3739
|
U,
|
|
3728
|
-
b,
|
|
3729
3740
|
Y,
|
|
3741
|
+
M,
|
|
3730
3742
|
c,
|
|
3731
3743
|
a,
|
|
3732
3744
|
l,
|
|
@@ -3735,29 +3747,29 @@ function mi(e, t, n) {
|
|
|
3735
3747
|
o,
|
|
3736
3748
|
f,
|
|
3737
3749
|
d,
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3750
|
+
w,
|
|
3751
|
+
S,
|
|
3752
|
+
G,
|
|
3753
|
+
x,
|
|
3742
3754
|
Me,
|
|
3743
|
-
|
|
3755
|
+
b,
|
|
3744
3756
|
p,
|
|
3745
|
-
|
|
3746
|
-
|
|
3757
|
+
A,
|
|
3758
|
+
B,
|
|
3747
3759
|
i,
|
|
3748
3760
|
u,
|
|
3749
|
-
|
|
3761
|
+
se,
|
|
3750
3762
|
ve
|
|
3751
3763
|
];
|
|
3752
3764
|
}
|
|
3753
|
-
class pi extends
|
|
3765
|
+
class pi extends oe {
|
|
3754
3766
|
constructor(t) {
|
|
3755
|
-
super(),
|
|
3767
|
+
super(), ne(
|
|
3756
3768
|
this,
|
|
3757
3769
|
t,
|
|
3758
3770
|
mi,
|
|
3759
3771
|
gi,
|
|
3760
|
-
|
|
3772
|
+
J,
|
|
3761
3773
|
{
|
|
3762
3774
|
drawingEnabled: 0,
|
|
3763
3775
|
image: 21,
|
|
@@ -3911,10 +3923,10 @@ class wi {
|
|
|
3911
3923
|
return l = be(t.slice(n, o + 1)), _e(l, this.toBBox), l;
|
|
3912
3924
|
i || (i = Math.ceil(Math.log(s) / Math.log(r)), r = Math.ceil(s / Math.pow(r, i - 1))), l = be([]), l.leaf = !1, l.height = i;
|
|
3913
3925
|
const a = Math.ceil(s / r), c = a * Math.ceil(Math.sqrt(r));
|
|
3914
|
-
|
|
3926
|
+
Ct(t, n, o, c, this.compareMinX);
|
|
3915
3927
|
for (let u = n; u <= o; u += c) {
|
|
3916
3928
|
const f = Math.min(u + c - 1, o);
|
|
3917
|
-
|
|
3929
|
+
Ct(t, u, f, a, this.compareMinY);
|
|
3918
3930
|
for (let d = u; d <= f; d += a) {
|
|
3919
3931
|
const g = Math.min(d + a - 1, f);
|
|
3920
3932
|
l.children.push(this._build(t, d, g, i - 1));
|
|
@@ -3966,14 +3978,14 @@ class wi {
|
|
|
3966
3978
|
_allDistMargin(t, n, o, i) {
|
|
3967
3979
|
t.children.sort(i);
|
|
3968
3980
|
const s = this.toBBox, r = Oe(t, 0, n, s), l = Oe(t, o - n, o, s);
|
|
3969
|
-
let a =
|
|
3981
|
+
let a = Ue(r) + Ue(l);
|
|
3970
3982
|
for (let c = n; c < o - n; c++) {
|
|
3971
3983
|
const u = t.children[c];
|
|
3972
|
-
Be(r, t.leaf ? s(u) : u), a +=
|
|
3984
|
+
Be(r, t.leaf ? s(u) : u), a += Ue(r);
|
|
3973
3985
|
}
|
|
3974
3986
|
for (let c = o - n - 1; c >= n; c--) {
|
|
3975
3987
|
const u = t.children[c];
|
|
3976
|
-
Be(l, t.leaf ? s(u) : u), a +=
|
|
3988
|
+
Be(l, t.leaf ? s(u) : u), a += Ue(l);
|
|
3977
3989
|
}
|
|
3978
3990
|
return a;
|
|
3979
3991
|
}
|
|
@@ -4017,7 +4029,7 @@ function Ai(e, t) {
|
|
|
4017
4029
|
function et(e) {
|
|
4018
4030
|
return (e.maxX - e.minX) * (e.maxY - e.minY);
|
|
4019
4031
|
}
|
|
4020
|
-
function
|
|
4032
|
+
function Ue(e) {
|
|
4021
4033
|
return e.maxX - e.minX + (e.maxY - e.minY);
|
|
4022
4034
|
}
|
|
4023
4035
|
function Si(e, t) {
|
|
@@ -4044,7 +4056,7 @@ function be(e) {
|
|
|
4044
4056
|
maxY: -1 / 0
|
|
4045
4057
|
};
|
|
4046
4058
|
}
|
|
4047
|
-
function
|
|
4059
|
+
function Ct(e, t, n, o, i) {
|
|
4048
4060
|
const s = [t, n];
|
|
4049
4061
|
for (; s.length; ) {
|
|
4050
4062
|
if (n = s.pop(), t = s.pop(), n - t <= o)
|
|
@@ -4057,8 +4069,8 @@ const Mi = () => {
|
|
|
4057
4069
|
const e = new wi(), t = /* @__PURE__ */ new Map(), n = () => [...t.values()], o = () => {
|
|
4058
4070
|
e.clear(), t.clear();
|
|
4059
4071
|
}, i = (f) => {
|
|
4060
|
-
const { minX: d, minY: g, maxX: m, maxY: y } = f.selector.geometry.bounds,
|
|
4061
|
-
e.insert(
|
|
4072
|
+
const { minX: d, minY: g, maxX: m, maxY: y } = f.selector.geometry.bounds, b = { minX: d, minY: g, maxX: m, maxY: y, target: f };
|
|
4073
|
+
e.insert(b), t.set(f.annotation, b);
|
|
4062
4074
|
}, s = (f) => {
|
|
4063
4075
|
const d = t.get(f.annotation);
|
|
4064
4076
|
d && e.remove(d), t.delete(f.annotation);
|
|
@@ -4072,9 +4084,9 @@ const Mi = () => {
|
|
|
4072
4084
|
minY: d,
|
|
4073
4085
|
maxX: f,
|
|
4074
4086
|
maxY: d
|
|
4075
|
-
}).map((y) => y.target).filter((y) => y.selector.type ===
|
|
4087
|
+
}).map((y) => y.target).filter((y) => y.selector.type === q.RECTANGLE || wn(y.selector, f, d));
|
|
4076
4088
|
if (m.length > 0)
|
|
4077
|
-
return m.sort((y,
|
|
4089
|
+
return m.sort((y, b) => st(y.selector) - st(b.selector)), m[0];
|
|
4078
4090
|
},
|
|
4079
4091
|
getIntersecting: (f, d, g, m) => e.search({
|
|
4080
4092
|
minX: f,
|
|
@@ -4087,8 +4099,8 @@ const Mi = () => {
|
|
|
4087
4099
|
set: (f, d = !0) => {
|
|
4088
4100
|
d && o();
|
|
4089
4101
|
const g = f.map((m) => {
|
|
4090
|
-
const { minX: y, minY:
|
|
4091
|
-
return { minX: y, minY:
|
|
4102
|
+
const { minX: y, minY: b, maxX: p, maxY: A } = m.selector.geometry.bounds;
|
|
4103
|
+
return { minX: y, minY: b, maxX: p, maxY: A, target: m };
|
|
4092
4104
|
});
|
|
4093
4105
|
g.forEach((m) => t.set(m.target.annotation, m)), e.load(g);
|
|
4094
4106
|
},
|
|
@@ -4098,7 +4110,7 @@ const Mi = () => {
|
|
|
4098
4110
|
}
|
|
4099
4111
|
};
|
|
4100
4112
|
}, vi = (e) => {
|
|
4101
|
-
const t = Kn(), n = Mi(), o = Rn(t, e.pointerSelectAction), i =
|
|
4113
|
+
const t = Kn(), n = Mi(), o = Rn(t, e.pointerSelectAction), i = Cn(t), s = xn();
|
|
4102
4114
|
return t.observe(({ changes: a }) => {
|
|
4103
4115
|
n.set((a.created || []).map((c) => c.target), !1), (a.deleted || []).forEach((c) => n.remove(c.target)), (a.updated || []).forEach(({ oldValue: c, newValue: u }) => n.update(c.target, u.target));
|
|
4104
4116
|
}), {
|
|
@@ -4144,7 +4156,7 @@ const Mi = () => {
|
|
|
4144
4156
|
drawingMode: e.drawingMode || t.drawingMode,
|
|
4145
4157
|
pointerSelectAction: e.pointerSelectAction || t.pointerSelectAction,
|
|
4146
4158
|
theme: e.theme || t.theme
|
|
4147
|
-
}),
|
|
4159
|
+
}), Nt = navigator.userAgent.indexOf("Mac OS X") !== -1, Ii = (e, t) => {
|
|
4148
4160
|
const n = t || document, o = (r) => {
|
|
4149
4161
|
const l = r;
|
|
4150
4162
|
l.key === "z" && l.ctrlKey ? e.undo() : l.key === "y" && l.ctrlKey && e.redo();
|
|
@@ -4152,12 +4164,12 @@ const Mi = () => {
|
|
|
4152
4164
|
const l = r;
|
|
4153
4165
|
l.key === "z" && l.metaKey && (l.shiftKey ? e.redo() : e.undo());
|
|
4154
4166
|
}, s = () => {
|
|
4155
|
-
|
|
4167
|
+
Nt ? n.removeEventListener("keydown", i) : n.removeEventListener("keydown", o);
|
|
4156
4168
|
};
|
|
4157
|
-
return
|
|
4169
|
+
return Nt ? n.addEventListener("keydown", i) : n.addEventListener("keydown", o), {
|
|
4158
4170
|
destroy: s
|
|
4159
4171
|
};
|
|
4160
|
-
},
|
|
4172
|
+
}, Xi = (e, t = {}) => {
|
|
4161
4173
|
if (!e)
|
|
4162
4174
|
throw "Missing argument: image";
|
|
4163
4175
|
const n = typeof e == "string" ? document.getElementById(e) : e, o = Bi(t, {
|
|
@@ -4165,7 +4177,7 @@ const Mi = () => {
|
|
|
4165
4177
|
drawingMode: "drag",
|
|
4166
4178
|
pointerSelectAction: Kt.EDIT,
|
|
4167
4179
|
theme: "light"
|
|
4168
|
-
}), i = Li(o), { selection: s, store: r } = i, l =
|
|
4180
|
+
}), i = Li(o), { selection: s, store: r } = i, l = Zn(r), a = $n(
|
|
4169
4181
|
i,
|
|
4170
4182
|
l,
|
|
4171
4183
|
o.adapter,
|
|
@@ -4186,23 +4198,23 @@ const Mi = () => {
|
|
|
4186
4198
|
user: f
|
|
4187
4199
|
}
|
|
4188
4200
|
});
|
|
4189
|
-
d.$on("click", (
|
|
4190
|
-
const { originalEvent:
|
|
4191
|
-
|
|
4201
|
+
d.$on("click", (Y) => {
|
|
4202
|
+
const { originalEvent: w, annotation: S } = Y.detail;
|
|
4203
|
+
S ? s.clickSelect(S.id, w) : s.isEmpty() || s.clear();
|
|
4192
4204
|
});
|
|
4193
4205
|
const g = to(i, l, o.adapter), m = () => {
|
|
4194
4206
|
d.$destroy(), c.parentNode.insertBefore(n, c), c.parentNode.removeChild(c), u.destroy(), l.destroy();
|
|
4195
|
-
}, y = () => f,
|
|
4196
|
-
if (!$t(
|
|
4197
|
-
throw `No drawing tool named ${
|
|
4198
|
-
d.$set({ toolName:
|
|
4199
|
-
},
|
|
4207
|
+
}, y = () => f, b = (Y, w, S) => Ko(Y, w, S), p = (Y, w) => Io(Y, w), A = (Y) => {
|
|
4208
|
+
if (!$t(Y))
|
|
4209
|
+
throw `No drawing tool named ${Y}`;
|
|
4210
|
+
d.$set({ toolName: Y });
|
|
4211
|
+
}, _ = (Y) => d.$set({ drawingEnabled: Y }), E = (Y) => {
|
|
4200
4212
|
console.warn("Filter not implemented yet");
|
|
4201
|
-
},
|
|
4202
|
-
f =
|
|
4203
|
-
},
|
|
4213
|
+
}, B = (Y) => d.$set({ style: Y }), V = (Y) => Rt(n, c, Y), U = (Y) => {
|
|
4214
|
+
f = Y, d.$set({ user: Y });
|
|
4215
|
+
}, R = (Y) => (
|
|
4204
4216
|
// @ts-ignore
|
|
4205
|
-
d.$set({ visible:
|
|
4217
|
+
d.$set({ visible: Y })
|
|
4206
4218
|
);
|
|
4207
4219
|
return {
|
|
4208
4220
|
...g,
|
|
@@ -4211,40 +4223,40 @@ const Mi = () => {
|
|
|
4211
4223
|
listDrawingTools: xt,
|
|
4212
4224
|
on: a.on,
|
|
4213
4225
|
off: a.off,
|
|
4214
|
-
registerDrawingTool:
|
|
4226
|
+
registerDrawingTool: b,
|
|
4215
4227
|
registerShapeEditor: p,
|
|
4216
|
-
setDrawingEnabled:
|
|
4217
|
-
setDrawingTool:
|
|
4218
|
-
setFilter:
|
|
4219
|
-
setStyle:
|
|
4220
|
-
setTheme:
|
|
4228
|
+
setDrawingEnabled: _,
|
|
4229
|
+
setDrawingTool: A,
|
|
4230
|
+
setFilter: E,
|
|
4231
|
+
setStyle: B,
|
|
4232
|
+
setTheme: V,
|
|
4221
4233
|
setUser: U,
|
|
4222
|
-
setVisible:
|
|
4234
|
+
setVisible: R,
|
|
4223
4235
|
state: i
|
|
4224
4236
|
};
|
|
4225
4237
|
};
|
|
4226
4238
|
export {
|
|
4227
|
-
|
|
4228
|
-
|
|
4239
|
+
Zt as Editor,
|
|
4240
|
+
Co as EditorMount,
|
|
4229
4241
|
ke as Handle,
|
|
4230
|
-
|
|
4242
|
+
Di as IdentityTransform,
|
|
4231
4243
|
yo as PolygonEditor,
|
|
4232
4244
|
Oo as RectangleEditor,
|
|
4233
4245
|
An as RectangleUtil,
|
|
4234
4246
|
Go as RubberbandRectangle,
|
|
4235
4247
|
pi as SVGAnnotationLayer,
|
|
4236
|
-
|
|
4237
|
-
|
|
4248
|
+
q as ShapeType,
|
|
4249
|
+
No as ToolMount,
|
|
4238
4250
|
Yi as W3CImageFormat,
|
|
4239
4251
|
li as addEventListeners,
|
|
4240
4252
|
Fe as boundsFromPoints,
|
|
4241
4253
|
st as computeArea,
|
|
4242
|
-
|
|
4254
|
+
Xi as createImageAnnotator,
|
|
4243
4255
|
vi as createImageAnnotatorState,
|
|
4244
4256
|
si as createSVGTransform,
|
|
4245
4257
|
Li as createSvelteImageAnnotatorState,
|
|
4246
4258
|
Oi as detectTheme,
|
|
4247
|
-
|
|
4259
|
+
Ze as distance,
|
|
4248
4260
|
bo as enableResponsive,
|
|
4249
4261
|
Bi as fillDefaults,
|
|
4250
4262
|
Bo as getEditor,
|