@annotorious/annotorious 3.0.0-rc.27 → 3.0.0-rc.29
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.es.js +710 -729
- package/dist/annotorious.es.js.map +1 -1
- package/dist/annotorious.js +1 -1
- package/dist/annotorious.js.map +1 -1
- package/package.json +7 -7
- package/src/Annotorious.ts +3 -3
package/dist/annotorious.es.js
CHANGED
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var Ke = (e, t, n) => (
|
|
1
|
+
var rn = Object.defineProperty;
|
|
2
|
+
var ln = (e, t, n) => t in e ? rn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var Ke = (e, t, n) => ln(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
function F() {
|
|
5
5
|
}
|
|
6
|
-
function
|
|
7
|
-
for (const n in t)
|
|
8
|
-
e[n] = t[n];
|
|
6
|
+
function it(e, t) {
|
|
7
|
+
for (const n in t) e[n] = t[n];
|
|
9
8
|
return (
|
|
10
9
|
/** @type {T & S} */
|
|
11
10
|
e
|
|
12
11
|
);
|
|
13
12
|
}
|
|
14
|
-
function
|
|
13
|
+
function zt(e) {
|
|
15
14
|
return e();
|
|
16
15
|
}
|
|
17
|
-
function
|
|
16
|
+
function gt() {
|
|
18
17
|
return /* @__PURE__ */ Object.create(null);
|
|
19
18
|
}
|
|
20
19
|
function ce(e) {
|
|
21
|
-
e.forEach(
|
|
20
|
+
e.forEach(zt);
|
|
22
21
|
}
|
|
23
22
|
function K(e) {
|
|
24
23
|
return typeof e == "function";
|
|
@@ -26,10 +25,10 @@ function K(e) {
|
|
|
26
25
|
function J(e, t) {
|
|
27
26
|
return e != e ? t == t : e !== t || e && typeof e == "object" || typeof e == "function";
|
|
28
27
|
}
|
|
29
|
-
function
|
|
28
|
+
function an(e) {
|
|
30
29
|
return Object.keys(e).length === 0;
|
|
31
30
|
}
|
|
32
|
-
function
|
|
31
|
+
function Ht(e, ...t) {
|
|
33
32
|
if (e == null) {
|
|
34
33
|
for (const o of t)
|
|
35
34
|
o(void 0);
|
|
@@ -38,19 +37,19 @@ function Vt(e, ...t) {
|
|
|
38
37
|
const n = e.subscribe(...t);
|
|
39
38
|
return n.unsubscribe ? () => n.unsubscribe() : n;
|
|
40
39
|
}
|
|
41
|
-
function
|
|
42
|
-
e.$$.on_destroy.push(
|
|
40
|
+
function mt(e, t, n) {
|
|
41
|
+
e.$$.on_destroy.push(Ht(t, n));
|
|
43
42
|
}
|
|
44
|
-
function
|
|
43
|
+
function cn(e, t, n, o) {
|
|
45
44
|
if (e) {
|
|
46
|
-
const i =
|
|
45
|
+
const i = Ft(e, t, n, o);
|
|
47
46
|
return e[0](i);
|
|
48
47
|
}
|
|
49
48
|
}
|
|
50
|
-
function
|
|
51
|
-
return e[1] && o ?
|
|
49
|
+
function Ft(e, t, n, o) {
|
|
50
|
+
return e[1] && o ? it(n.ctx.slice(), e[1](o(t))) : n.ctx;
|
|
52
51
|
}
|
|
53
|
-
function
|
|
52
|
+
function fn(e, t, n, o) {
|
|
54
53
|
if (e[2] && o) {
|
|
55
54
|
const i = e[2](o(n));
|
|
56
55
|
if (t.dirty === void 0)
|
|
@@ -65,13 +64,13 @@ function ln(e, t, n, o) {
|
|
|
65
64
|
}
|
|
66
65
|
return t.dirty;
|
|
67
66
|
}
|
|
68
|
-
function
|
|
67
|
+
function un(e, t, n, o, i, s) {
|
|
69
68
|
if (i) {
|
|
70
|
-
const r =
|
|
69
|
+
const r = Ft(t, n, o, s);
|
|
71
70
|
e.p(r, i);
|
|
72
71
|
}
|
|
73
72
|
}
|
|
74
|
-
function
|
|
73
|
+
function dn(e) {
|
|
75
74
|
if (e.ctx.length > 32) {
|
|
76
75
|
const t = [], n = e.ctx.length / 32;
|
|
77
76
|
for (let o = 0; o < n; o++)
|
|
@@ -80,16 +79,15 @@ function cn(e) {
|
|
|
80
79
|
}
|
|
81
80
|
return -1;
|
|
82
81
|
}
|
|
83
|
-
function
|
|
82
|
+
function pt(e) {
|
|
84
83
|
const t = {};
|
|
85
|
-
for (const n in e)
|
|
86
|
-
n[0] !== "$" && (t[n] = e[n]);
|
|
84
|
+
for (const n in e) n[0] !== "$" && (t[n] = e[n]);
|
|
87
85
|
return t;
|
|
88
86
|
}
|
|
89
87
|
function ze(e) {
|
|
90
88
|
return e ?? "";
|
|
91
89
|
}
|
|
92
|
-
const
|
|
90
|
+
const hn = typeof window < "u" ? window : typeof globalThis < "u" ? globalThis : (
|
|
93
91
|
// @ts-ignore Node typings have this
|
|
94
92
|
global
|
|
95
93
|
);
|
|
@@ -102,21 +100,21 @@ function O(e, t, n) {
|
|
|
102
100
|
function k(e) {
|
|
103
101
|
e.parentNode && e.parentNode.removeChild(e);
|
|
104
102
|
}
|
|
105
|
-
function
|
|
103
|
+
function at(e, t) {
|
|
106
104
|
for (let n = 0; n < e.length; n += 1)
|
|
107
105
|
e[n] && e[n].d(t);
|
|
108
106
|
}
|
|
109
|
-
function
|
|
107
|
+
function X(e) {
|
|
110
108
|
return document.createElementNS("http://www.w3.org/2000/svg", e);
|
|
111
109
|
}
|
|
112
|
-
function
|
|
110
|
+
function jt(e) {
|
|
113
111
|
return document.createTextNode(e);
|
|
114
112
|
}
|
|
115
113
|
function ie() {
|
|
116
|
-
return
|
|
114
|
+
return jt(" ");
|
|
117
115
|
}
|
|
118
116
|
function fe() {
|
|
119
|
-
return
|
|
117
|
+
return jt("");
|
|
120
118
|
}
|
|
121
119
|
function j(e, t, n, o) {
|
|
122
120
|
return e.addEventListener(t, n, o), () => e.removeEventListener(t, n, o);
|
|
@@ -124,33 +122,32 @@ function j(e, t, n, o) {
|
|
|
124
122
|
function h(e, t, n) {
|
|
125
123
|
n == null ? e.removeAttribute(t) : e.getAttribute(t) !== n && e.setAttribute(t, n);
|
|
126
124
|
}
|
|
127
|
-
function
|
|
125
|
+
function gn(e) {
|
|
128
126
|
return Array.from(e.childNodes);
|
|
129
127
|
}
|
|
130
128
|
function Ee(e, t, n) {
|
|
131
129
|
e.classList.toggle(t, !!n);
|
|
132
130
|
}
|
|
133
|
-
function
|
|
131
|
+
function mn(e, t, { bubbles: n = !1, cancelable: o = !1 } = {}) {
|
|
134
132
|
return new CustomEvent(e, { detail: t, bubbles: n, cancelable: o });
|
|
135
133
|
}
|
|
136
134
|
let Pe;
|
|
137
135
|
function Ie(e) {
|
|
138
136
|
Pe = e;
|
|
139
137
|
}
|
|
140
|
-
function
|
|
141
|
-
if (!Pe)
|
|
142
|
-
throw new Error("Function called outside component initialization");
|
|
138
|
+
function qt() {
|
|
139
|
+
if (!Pe) throw new Error("Function called outside component initialization");
|
|
143
140
|
return Pe;
|
|
144
141
|
}
|
|
145
142
|
function Ye(e) {
|
|
146
|
-
|
|
143
|
+
qt().$$.on_mount.push(e);
|
|
147
144
|
}
|
|
148
145
|
function Te() {
|
|
149
|
-
const e =
|
|
146
|
+
const e = qt();
|
|
150
147
|
return (t, n, { cancelable: o = !1 } = {}) => {
|
|
151
148
|
const i = e.$$.callbacks[t];
|
|
152
149
|
if (i) {
|
|
153
|
-
const s =
|
|
150
|
+
const s = mn(
|
|
154
151
|
/** @type {string} */
|
|
155
152
|
t,
|
|
156
153
|
n,
|
|
@@ -169,17 +166,17 @@ function de(e, t) {
|
|
|
169
166
|
}
|
|
170
167
|
const we = [], He = [];
|
|
171
168
|
let Ae = [];
|
|
172
|
-
const
|
|
173
|
-
let
|
|
174
|
-
function
|
|
175
|
-
|
|
169
|
+
const yt = [], pn = /* @__PURE__ */ Promise.resolve();
|
|
170
|
+
let st = !1;
|
|
171
|
+
function yn() {
|
|
172
|
+
st || (st = !0, pn.then(Kt));
|
|
176
173
|
}
|
|
177
|
-
function
|
|
174
|
+
function rt(e) {
|
|
178
175
|
Ae.push(e);
|
|
179
176
|
}
|
|
180
177
|
const We = /* @__PURE__ */ new Set();
|
|
181
178
|
let me = 0;
|
|
182
|
-
function
|
|
179
|
+
function Kt() {
|
|
183
180
|
if (me !== 0)
|
|
184
181
|
return;
|
|
185
182
|
const e = Pe;
|
|
@@ -187,31 +184,30 @@ function Ft() {
|
|
|
187
184
|
try {
|
|
188
185
|
for (; me < we.length; ) {
|
|
189
186
|
const t = we[me];
|
|
190
|
-
me++, Ie(t),
|
|
187
|
+
me++, Ie(t), _n(t.$$);
|
|
191
188
|
}
|
|
192
189
|
} catch (t) {
|
|
193
190
|
throw we.length = 0, me = 0, t;
|
|
194
191
|
}
|
|
195
|
-
for (Ie(null), we.length = 0, me = 0; He.length; )
|
|
196
|
-
He.pop()();
|
|
192
|
+
for (Ie(null), we.length = 0, me = 0; He.length; ) He.pop()();
|
|
197
193
|
for (let t = 0; t < Ae.length; t += 1) {
|
|
198
194
|
const n = Ae[t];
|
|
199
195
|
We.has(n) || (We.add(n), n());
|
|
200
196
|
}
|
|
201
197
|
Ae.length = 0;
|
|
202
198
|
} while (we.length);
|
|
203
|
-
for (;
|
|
204
|
-
|
|
205
|
-
|
|
199
|
+
for (; yt.length; )
|
|
200
|
+
yt.pop()();
|
|
201
|
+
st = !1, We.clear(), Ie(e);
|
|
206
202
|
}
|
|
207
|
-
function
|
|
203
|
+
function _n(e) {
|
|
208
204
|
if (e.fragment !== null) {
|
|
209
205
|
e.update(), ce(e.before_update);
|
|
210
206
|
const t = e.dirty;
|
|
211
|
-
e.dirty = [-1], e.fragment && e.fragment.p(e.ctx, t), e.after_update.forEach(
|
|
207
|
+
e.dirty = [-1], e.fragment && e.fragment.p(e.ctx, t), e.after_update.forEach(rt);
|
|
212
208
|
}
|
|
213
209
|
}
|
|
214
|
-
function
|
|
210
|
+
function wn(e) {
|
|
215
211
|
const t = [], n = [];
|
|
216
212
|
Ae.forEach((o) => e.indexOf(o) === -1 ? t.push(o) : n.push(o)), n.forEach((o) => o()), Ae = t;
|
|
217
213
|
}
|
|
@@ -231,15 +227,13 @@ function ae() {
|
|
|
231
227
|
function I(e, t) {
|
|
232
228
|
e && e.i && (Ge.delete(e), e.i(t));
|
|
233
229
|
}
|
|
234
|
-
function
|
|
230
|
+
function C(e, t, n, o) {
|
|
235
231
|
if (e && e.o) {
|
|
236
|
-
if (Ge.has(e))
|
|
237
|
-
return;
|
|
232
|
+
if (Ge.has(e)) return;
|
|
238
233
|
Ge.add(e), he.c.push(() => {
|
|
239
234
|
Ge.delete(e), o && (n && e.d(1), o());
|
|
240
235
|
}), e.o(t);
|
|
241
|
-
} else
|
|
242
|
-
o && o();
|
|
236
|
+
} else o && o();
|
|
243
237
|
}
|
|
244
238
|
function Se(e) {
|
|
245
239
|
return (e == null ? void 0 : e.length) !== void 0 ? e : Array.from(e);
|
|
@@ -249,17 +243,17 @@ function te(e) {
|
|
|
249
243
|
}
|
|
250
244
|
function $(e, t, n) {
|
|
251
245
|
const { fragment: o, after_update: i } = e.$$;
|
|
252
|
-
o && o.m(t, n),
|
|
253
|
-
const s = e.$$.on_mount.map(
|
|
246
|
+
o && o.m(t, n), rt(() => {
|
|
247
|
+
const s = e.$$.on_mount.map(zt).filter(K);
|
|
254
248
|
e.$$.on_destroy ? e.$$.on_destroy.push(...s) : ce(s), e.$$.on_mount = [];
|
|
255
|
-
}), i.forEach(
|
|
249
|
+
}), i.forEach(rt);
|
|
256
250
|
}
|
|
257
251
|
function ee(e, t) {
|
|
258
252
|
const n = e.$$;
|
|
259
|
-
n.fragment !== null && (
|
|
253
|
+
n.fragment !== null && (wn(n.after_update), ce(n.on_destroy), n.fragment && n.fragment.d(t), n.on_destroy = n.fragment = null, n.ctx = []);
|
|
260
254
|
}
|
|
261
|
-
function
|
|
262
|
-
e.$$.dirty[0] === -1 && (we.push(e),
|
|
255
|
+
function bn(e, t) {
|
|
256
|
+
e.$$.dirty[0] === -1 && (we.push(e), yn(), e.$$.dirty.fill(0)), e.$$.dirty[t / 31 | 0] |= 1 << t % 31;
|
|
263
257
|
}
|
|
264
258
|
function ne(e, t, n, o, i, s, r = null, l = [-1]) {
|
|
265
259
|
const a = Pe;
|
|
@@ -271,7 +265,7 @@ function ne(e, t, n, o, i, s, r = null, l = [-1]) {
|
|
|
271
265
|
props: s,
|
|
272
266
|
update: F,
|
|
273
267
|
not_equal: i,
|
|
274
|
-
bound:
|
|
268
|
+
bound: gt(),
|
|
275
269
|
// lifecycle
|
|
276
270
|
on_mount: [],
|
|
277
271
|
on_destroy: [],
|
|
@@ -280,7 +274,7 @@ function ne(e, t, n, o, i, s, r = null, l = [-1]) {
|
|
|
280
274
|
after_update: [],
|
|
281
275
|
context: new Map(t.context || (a ? a.$$.context : [])),
|
|
282
276
|
// everything else
|
|
283
|
-
callbacks:
|
|
277
|
+
callbacks: gt(),
|
|
284
278
|
dirty: l,
|
|
285
279
|
skip_bound: !1,
|
|
286
280
|
root: t.target || a.$$.root
|
|
@@ -289,14 +283,14 @@ function ne(e, t, n, o, i, s, r = null, l = [-1]) {
|
|
|
289
283
|
let u = !1;
|
|
290
284
|
if (c.ctx = n ? n(e, t.props || {}, (f, d, ...g) => {
|
|
291
285
|
const m = g.length ? g[0] : d;
|
|
292
|
-
return c.ctx && i(c.ctx[f], c.ctx[f] = m) && (!c.skip_bound && c.bound[f] && c.bound[f](m), u &&
|
|
286
|
+
return c.ctx && i(c.ctx[f], c.ctx[f] = m) && (!c.skip_bound && c.bound[f] && c.bound[f](m), u && bn(e, f)), d;
|
|
293
287
|
}) : [], c.update(), u = !0, ce(c.before_update), c.fragment = o ? o(c.ctx) : !1, t.target) {
|
|
294
288
|
if (t.hydrate) {
|
|
295
|
-
const f =
|
|
289
|
+
const f = gn(t.target);
|
|
296
290
|
c.fragment && c.fragment.l(f), f.forEach(k);
|
|
297
291
|
} else
|
|
298
292
|
c.fragment && c.fragment.c();
|
|
299
|
-
t.intro && I(e.$$.fragment), $(e, t.target, t.anchor),
|
|
293
|
+
t.intro && I(e.$$.fragment), $(e, t.target, t.anchor), Kt();
|
|
300
294
|
}
|
|
301
295
|
Ie(a);
|
|
302
296
|
}
|
|
@@ -343,26 +337,26 @@ class oe {
|
|
|
343
337
|
* @returns {void}
|
|
344
338
|
*/
|
|
345
339
|
$set(t) {
|
|
346
|
-
this.$$set && !
|
|
340
|
+
this.$$set && !an(t) && (this.$$.skip_bound = !0, this.$$set(t), this.$$.skip_bound = !1);
|
|
347
341
|
}
|
|
348
342
|
}
|
|
349
|
-
const
|
|
350
|
-
typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(
|
|
343
|
+
const En = "4";
|
|
344
|
+
typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(En);
|
|
351
345
|
var q = /* @__PURE__ */ ((e) => (e.ELLIPSE = "ELLIPSE", e.POLYGON = "POLYGON", e.RECTANGLE = "RECTANGLE", e))(q || {});
|
|
352
|
-
const
|
|
346
|
+
const ct = {}, ft = (e, t) => ct[e] = t, lt = (e) => ct[e.type].area(e), An = (e, t, n) => ct[e.type].intersects(e, t, n), Fe = (e) => {
|
|
353
347
|
let t = 1 / 0, n = 1 / 0, o = -1 / 0, i = -1 / 0;
|
|
354
348
|
return e.forEach(([s, r]) => {
|
|
355
349
|
t = Math.min(t, s), n = Math.min(n, r), o = Math.max(o, s), i = Math.max(i, r);
|
|
356
350
|
}), { minX: t, minY: n, maxX: o, maxY: i };
|
|
357
|
-
},
|
|
351
|
+
}, Sn = {
|
|
358
352
|
area: (e) => Math.PI * e.geometry.rx * e.geometry.ry,
|
|
359
353
|
intersects: (e, t, n) => {
|
|
360
354
|
const { cx: o, cy: i, rx: s, ry: r } = e.geometry, l = 0, a = Math.cos(l), c = Math.sin(l), u = t - o, f = n - i, d = a * u + c * f, g = c * u - a * f;
|
|
361
355
|
return d * d / (s * s) + g * g / (r * r) <= 1;
|
|
362
356
|
}
|
|
363
357
|
};
|
|
364
|
-
|
|
365
|
-
const
|
|
358
|
+
ft(q.ELLIPSE, Sn);
|
|
359
|
+
const Tn = {
|
|
366
360
|
area: (e) => {
|
|
367
361
|
const { points: t } = e.geometry;
|
|
368
362
|
let n = 0, o = t.length - 1;
|
|
@@ -380,18 +374,16 @@ const En = {
|
|
|
380
374
|
return i;
|
|
381
375
|
}
|
|
382
376
|
};
|
|
383
|
-
|
|
384
|
-
const
|
|
377
|
+
ft(q.POLYGON, Tn);
|
|
378
|
+
const vn = {
|
|
385
379
|
area: (e) => e.geometry.w * e.geometry.h,
|
|
386
380
|
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
381
|
};
|
|
388
|
-
|
|
389
|
-
const
|
|
382
|
+
ft(q.RECTANGLE, vn);
|
|
383
|
+
const Mn = (e, t = !1) => {
|
|
390
384
|
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
|
-
if (r !== "xywh")
|
|
392
|
-
|
|
393
|
-
if (l && l !== "pixel")
|
|
394
|
-
throw new Error(`Unsupported MediaFragment unit: ${l}`);
|
|
385
|
+
if (r !== "xywh") throw new Error("Unsupported MediaFragment: " + n);
|
|
386
|
+
if (l && l !== "pixel") throw new Error(`Unsupported MediaFragment unit: ${l}`);
|
|
395
387
|
const [d, g, m, y] = [a, c, u, f].map(parseFloat);
|
|
396
388
|
return {
|
|
397
389
|
type: q.RECTANGLE,
|
|
@@ -408,27 +400,27 @@ const Sn = (e, t = !1) => {
|
|
|
408
400
|
}
|
|
409
401
|
}
|
|
410
402
|
};
|
|
411
|
-
},
|
|
403
|
+
}, Ln = (e) => {
|
|
412
404
|
const { x: t, y: n, w: o, h: i } = e;
|
|
413
405
|
return {
|
|
414
406
|
type: "FragmentSelector",
|
|
415
407
|
conformsTo: "http://www.w3.org/TR/media-frags/",
|
|
416
408
|
value: `xywh=pixel:${t},${n},${o},${i}`
|
|
417
409
|
};
|
|
418
|
-
},
|
|
410
|
+
}, Wt = "http://www.w3.org/2000/svg", _t = (e) => {
|
|
419
411
|
const t = (o) => {
|
|
420
412
|
Array.from(o.attributes).forEach((i) => {
|
|
421
413
|
i.name.startsWith("on") && o.removeAttribute(i.name);
|
|
422
414
|
});
|
|
423
415
|
}, n = e.getElementsByTagName("script");
|
|
424
416
|
return Array.from(n).reverse().forEach((o) => o.parentNode.removeChild(o)), Array.from(e.querySelectorAll("*")).forEach(t), e;
|
|
425
|
-
},
|
|
426
|
-
const o = new XMLSerializer().serializeToString(e.documentElement).replace("<svg>", `<svg xmlns="${
|
|
417
|
+
}, kn = (e) => {
|
|
418
|
+
const o = new XMLSerializer().serializeToString(e.documentElement).replace("<svg>", `<svg xmlns="${Wt}">`);
|
|
427
419
|
return new DOMParser().parseFromString(o, "image/svg+xml").documentElement;
|
|
428
|
-
},
|
|
429
|
-
const n = new DOMParser().parseFromString(e, "image/svg+xml"), o = n.lookupPrefix(
|
|
430
|
-
return o || i ?
|
|
431
|
-
},
|
|
420
|
+
}, On = (e) => {
|
|
421
|
+
const n = new DOMParser().parseFromString(e, "image/svg+xml"), o = n.lookupPrefix(Wt), i = n.lookupNamespaceURI(null);
|
|
422
|
+
return o || i ? _t(n).firstChild : _t(kn(n)).firstChild;
|
|
423
|
+
}, Bn = (e) => {
|
|
432
424
|
const [t, n, o] = e.match(/(<polygon points=["|'])([^("|')]*)/) || [], i = o.split(" ").map((s) => s.split(",").map(parseFloat));
|
|
433
425
|
return {
|
|
434
426
|
type: q.POLYGON,
|
|
@@ -437,8 +429,8 @@ const Sn = (e, t = !1) => {
|
|
|
437
429
|
bounds: Fe(i)
|
|
438
430
|
}
|
|
439
431
|
};
|
|
440
|
-
},
|
|
441
|
-
const t =
|
|
432
|
+
}, In = (e) => {
|
|
433
|
+
const t = On(e), n = parseFloat(t.getAttribute("cx")), o = parseFloat(t.getAttribute("cy")), i = parseFloat(t.getAttribute("rx")), s = parseFloat(t.getAttribute("ry")), r = {
|
|
442
434
|
minX: n - i,
|
|
443
435
|
minY: o - s,
|
|
444
436
|
maxX: n + i,
|
|
@@ -454,14 +446,14 @@ const Sn = (e, t = !1) => {
|
|
|
454
446
|
bounds: r
|
|
455
447
|
}
|
|
456
448
|
};
|
|
457
|
-
},
|
|
449
|
+
}, Pn = (e) => {
|
|
458
450
|
const t = typeof e == "string" ? e : e.value;
|
|
459
451
|
if (t.includes("<polygon points="))
|
|
460
|
-
return
|
|
452
|
+
return Bn(t);
|
|
461
453
|
if (t.includes("<ellipse "))
|
|
462
|
-
return
|
|
454
|
+
return In(t);
|
|
463
455
|
throw "Unsupported SVG shape: " + t;
|
|
464
|
-
},
|
|
456
|
+
}, Yn = (e) => {
|
|
465
457
|
let t;
|
|
466
458
|
if (e.type === q.POLYGON) {
|
|
467
459
|
const n = e.geometry, { points: o } = n;
|
|
@@ -474,66 +466,61 @@ const Sn = (e, t = !1) => {
|
|
|
474
466
|
return { type: "SvgSelector", value: t };
|
|
475
467
|
throw `Unsupported shape type: ${e.type}`;
|
|
476
468
|
};
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
469
|
+
var W = [];
|
|
470
|
+
for (var Je = 0; Je < 256; ++Je)
|
|
471
|
+
W.push((Je + 256).toString(16).slice(1));
|
|
472
|
+
function Dn(e, t = 0) {
|
|
473
|
+
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]]).toLowerCase();
|
|
474
|
+
}
|
|
475
|
+
var Ne, Cn = new Uint8Array(16);
|
|
476
|
+
function Xn() {
|
|
480
477
|
if (!Ne && (Ne = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !Ne))
|
|
481
478
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
482
|
-
return Ne(
|
|
479
|
+
return Ne(Cn);
|
|
483
480
|
}
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
function Yn(e, t = 0) {
|
|
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
|
-
}
|
|
490
|
-
const Dn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), yt = {
|
|
491
|
-
randomUUID: Dn
|
|
481
|
+
var Rn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
482
|
+
const wt = {
|
|
483
|
+
randomUUID: Rn
|
|
492
484
|
};
|
|
493
|
-
function
|
|
494
|
-
if (
|
|
495
|
-
return
|
|
485
|
+
function Jt(e, t, n) {
|
|
486
|
+
if (wt.randomUUID && !t && !e)
|
|
487
|
+
return wt.randomUUID();
|
|
496
488
|
e = e || {};
|
|
497
|
-
|
|
498
|
-
return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128,
|
|
489
|
+
var o = e.random || (e.rng || Xn)();
|
|
490
|
+
return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, Dn(o);
|
|
499
491
|
}
|
|
500
|
-
var
|
|
492
|
+
var bt = Object.prototype.hasOwnProperty;
|
|
501
493
|
function ge(e, t) {
|
|
502
494
|
var n, o;
|
|
503
|
-
if (e === t)
|
|
504
|
-
return !0;
|
|
495
|
+
if (e === t) return !0;
|
|
505
496
|
if (e && t && (n = e.constructor) === t.constructor) {
|
|
506
|
-
if (n === Date)
|
|
507
|
-
|
|
508
|
-
if (n === RegExp)
|
|
509
|
-
return e.toString() === t.toString();
|
|
497
|
+
if (n === Date) return e.getTime() === t.getTime();
|
|
498
|
+
if (n === RegExp) return e.toString() === t.toString();
|
|
510
499
|
if (n === Array) {
|
|
511
500
|
if ((o = e.length) === t.length)
|
|
512
|
-
for (; o-- && ge(e[o], t[o]); )
|
|
513
|
-
;
|
|
501
|
+
for (; o-- && ge(e[o], t[o]); ) ;
|
|
514
502
|
return o === -1;
|
|
515
503
|
}
|
|
516
504
|
if (!n || typeof e == "object") {
|
|
517
505
|
o = 0;
|
|
518
506
|
for (n in e)
|
|
519
|
-
if (
|
|
520
|
-
return !1;
|
|
507
|
+
if (bt.call(e, n) && ++o && !bt.call(t, n) || !(n in t) || !ge(e[n], t[n])) return !1;
|
|
521
508
|
return Object.keys(t).length === o;
|
|
522
509
|
}
|
|
523
510
|
}
|
|
524
511
|
return e !== e && t !== t;
|
|
525
512
|
}
|
|
526
|
-
function
|
|
513
|
+
function Qe() {
|
|
527
514
|
}
|
|
528
|
-
function
|
|
515
|
+
function Nn(e, t) {
|
|
529
516
|
return e != e ? t == t : e !== t || e && typeof e == "object" || typeof e == "function";
|
|
530
517
|
}
|
|
531
518
|
const pe = [];
|
|
532
|
-
function
|
|
519
|
+
function ut(e, t = Qe) {
|
|
533
520
|
let n;
|
|
534
521
|
const o = /* @__PURE__ */ new Set();
|
|
535
522
|
function i(l) {
|
|
536
|
-
if (
|
|
523
|
+
if (Nn(e, l) && (e = l, n)) {
|
|
537
524
|
const a = !pe.length;
|
|
538
525
|
for (const c of o)
|
|
539
526
|
c[1](), pe.push(c, e);
|
|
@@ -547,16 +534,16 @@ function ct(e, t = Je) {
|
|
|
547
534
|
function s(l) {
|
|
548
535
|
i(l(e));
|
|
549
536
|
}
|
|
550
|
-
function r(l, a =
|
|
537
|
+
function r(l, a = Qe) {
|
|
551
538
|
const c = [l, a];
|
|
552
|
-
return o.add(c), o.size === 1 && (n = t(i, s) ||
|
|
539
|
+
return o.add(c), o.size === 1 && (n = t(i, s) || Qe), l(e), () => {
|
|
553
540
|
o.delete(c), o.size === 0 && n && (n(), n = null);
|
|
554
541
|
};
|
|
555
542
|
}
|
|
556
543
|
return { set: i, update: s, subscribe: r };
|
|
557
544
|
}
|
|
558
|
-
const
|
|
559
|
-
const { subscribe: t, set: n } =
|
|
545
|
+
const Un = (e) => {
|
|
546
|
+
const { subscribe: t, set: n } = ut();
|
|
560
547
|
let o;
|
|
561
548
|
return t((i) => o = i), e.observe(({ changes: i }) => {
|
|
562
549
|
if (o) {
|
|
@@ -572,12 +559,12 @@ const Cn = (e) => {
|
|
|
572
559
|
set: n
|
|
573
560
|
};
|
|
574
561
|
};
|
|
575
|
-
var
|
|
576
|
-
const
|
|
577
|
-
const { subscribe: n, set: o } =
|
|
578
|
-
let i =
|
|
562
|
+
var Qt = /* @__PURE__ */ ((e) => (e.EDIT = "EDIT", e.SELECT = "SELECT", e.NONE = "NONE", e))(Qt || {});
|
|
563
|
+
const Ze = { selected: [] }, Vn = (e, t = "EDIT") => {
|
|
564
|
+
const { subscribe: n, set: o } = ut(Ze);
|
|
565
|
+
let i = Ze;
|
|
579
566
|
n((f) => i = f);
|
|
580
|
-
const s = () => o(
|
|
567
|
+
const s = () => o(Ze), r = () => {
|
|
581
568
|
var f;
|
|
582
569
|
return ((f = i.selected) == null ? void 0 : f.length) === 0;
|
|
583
570
|
}, l = (f) => {
|
|
@@ -588,13 +575,18 @@ const Qe = { selected: [] }, Rn = (e, t = "EDIT") => {
|
|
|
588
575
|
}, a = (f, d) => {
|
|
589
576
|
const g = e.getAnnotation(f);
|
|
590
577
|
if (g) {
|
|
591
|
-
const m =
|
|
578
|
+
const m = Et(g, t);
|
|
592
579
|
o(m === "EDIT" ? { selected: [{ id: f, editable: !0 }], pointerEvent: d } : m === "SELECT" ? { selected: [{ id: f }], pointerEvent: d } : { selected: [], pointerEvent: d });
|
|
593
580
|
} else
|
|
594
581
|
console.warn("Invalid selection: " + f);
|
|
595
|
-
}, c = (f, d
|
|
582
|
+
}, c = (f, d) => {
|
|
596
583
|
const g = Array.isArray(f) ? f : [f], m = g.map((y) => e.getAnnotation(y)).filter(Boolean);
|
|
597
|
-
o({
|
|
584
|
+
o({
|
|
585
|
+
selected: m.map((y) => {
|
|
586
|
+
const w = d === void 0 ? Et(y, t) === "EDIT" : d;
|
|
587
|
+
return { id: y.id, editable: w };
|
|
588
|
+
})
|
|
589
|
+
}), m.length !== g.length && console.warn("Invalid selection", f);
|
|
598
590
|
}, u = (f) => {
|
|
599
591
|
if (i.selected.length === 0)
|
|
600
592
|
return !1;
|
|
@@ -615,32 +607,33 @@ const Qe = { selected: [] }, Rn = (e, t = "EDIT") => {
|
|
|
615
607
|
setSelected: c,
|
|
616
608
|
subscribe: n
|
|
617
609
|
};
|
|
618
|
-
},
|
|
619
|
-
|
|
620
|
-
|
|
610
|
+
}, Et = (e, t) => typeof t == "function" ? t(e) || "EDIT" : t || "EDIT";
|
|
611
|
+
var Gn = [];
|
|
612
|
+
for (var xe = 0; xe < 256; ++xe)
|
|
613
|
+
Gn.push((xe + 256).toString(16).slice(1));
|
|
621
614
|
typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
622
|
-
const
|
|
615
|
+
const zn = (e, t) => {
|
|
623
616
|
const n = new Set(e.bodies.map((o) => o.id));
|
|
624
617
|
return t.bodies.filter((o) => !n.has(o.id));
|
|
625
|
-
},
|
|
618
|
+
}, Hn = (e, t) => {
|
|
626
619
|
const n = new Set(t.bodies.map((o) => o.id));
|
|
627
620
|
return e.bodies.filter((o) => !n.has(o.id));
|
|
628
|
-
},
|
|
621
|
+
}, Fn = (e, t) => t.bodies.map((n) => {
|
|
629
622
|
const o = e.bodies.find((i) => i.id === n.id);
|
|
630
623
|
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 })),
|
|
632
|
-
const n =
|
|
624
|
+
}).filter(({ oldBody: n }) => n).map(({ oldBody: n, newBody: o }) => ({ oldBody: n, newBody: o })), jn = (e, t) => !ge(e.target, t.target), Zt = (e, t) => {
|
|
625
|
+
const n = zn(e, t), o = Hn(e, t), i = Fn(e, t);
|
|
633
626
|
return {
|
|
634
627
|
oldValue: e,
|
|
635
628
|
newValue: t,
|
|
636
629
|
bodiesCreated: n.length > 0 ? n : void 0,
|
|
637
630
|
bodiesDeleted: o.length > 0 ? o : void 0,
|
|
638
631
|
bodiesUpdated: i.length > 0 ? i : void 0,
|
|
639
|
-
targetUpdated:
|
|
632
|
+
targetUpdated: jn(e, t) ? { oldTarget: e.target, newTarget: t.target } : void 0
|
|
640
633
|
};
|
|
641
634
|
};
|
|
642
635
|
var H = /* @__PURE__ */ ((e) => (e.LOCAL = "LOCAL", e.REMOTE = "REMOTE", e))(H || {});
|
|
643
|
-
const
|
|
636
|
+
const qn = (e, t) => {
|
|
644
637
|
var n, o;
|
|
645
638
|
const { changes: i, origin: s } = t;
|
|
646
639
|
if (!(!e.options.origin || e.options.origin === s))
|
|
@@ -662,7 +655,7 @@ const Fn = (e, t) => {
|
|
|
662
655
|
return !!(Array.isArray(e.options.annotations) ? e.options.annotations : [e.options.annotations]).find((l) => r.has(l));
|
|
663
656
|
} else
|
|
664
657
|
return !0;
|
|
665
|
-
},
|
|
658
|
+
}, Kn = (e, t) => {
|
|
666
659
|
const n = new Set((e.created || []).map((f) => f.id)), o = new Set((e.updated || []).map(({ newValue: f }) => f.id)), i = new Set((t.created || []).map((f) => f.id)), s = new Set((t.deleted || []).map((f) => f.id)), r = new Set((t.updated || []).map(({ oldValue: f }) => f.id)), l = new Set((t.updated || []).filter(({ oldValue: f }) => n.has(f.id) || o.has(f.id)).map(({ oldValue: f }) => f.id)), a = [
|
|
667
660
|
...(e.created || []).filter((f) => !s.has(f.id)).map((f) => r.has(f.id) ? t.updated.find(({ oldValue: d }) => d.id === f.id).newValue : f),
|
|
668
661
|
...t.created || []
|
|
@@ -674,20 +667,20 @@ const Fn = (e, t) => {
|
|
|
674
667
|
const { oldValue: d, newValue: g } = f;
|
|
675
668
|
if (r.has(g.id)) {
|
|
676
669
|
const m = t.updated.find((y) => y.oldValue.id === g.id).newValue;
|
|
677
|
-
return
|
|
670
|
+
return Zt(d, m);
|
|
678
671
|
} else
|
|
679
672
|
return f;
|
|
680
673
|
}),
|
|
681
674
|
...(t.updated || []).filter(({ oldValue: f }) => !l.has(f.id))
|
|
682
675
|
];
|
|
683
676
|
return { created: a, deleted: c, updated: u };
|
|
684
|
-
},
|
|
685
|
-
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = [], o = (
|
|
686
|
-
const S = n.findIndex((T) => T.onChange ==
|
|
677
|
+
}, Wn = (e) => e.id !== void 0, Jn = () => {
|
|
678
|
+
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = [], o = (b, S = {}) => n.push({ onChange: b, options: S }), i = (b) => {
|
|
679
|
+
const S = n.findIndex((T) => T.onChange == b);
|
|
687
680
|
S > -1 && n.splice(S, 1);
|
|
688
|
-
}, s = (
|
|
681
|
+
}, s = (b, S) => {
|
|
689
682
|
const T = {
|
|
690
|
-
origin:
|
|
683
|
+
origin: b,
|
|
691
684
|
changes: {
|
|
692
685
|
created: S.created || [],
|
|
693
686
|
updated: S.updated || [],
|
|
@@ -695,144 +688,144 @@ const Fn = (e, t) => {
|
|
|
695
688
|
},
|
|
696
689
|
state: [...e.values()]
|
|
697
690
|
};
|
|
698
|
-
n.forEach((
|
|
699
|
-
|
|
691
|
+
n.forEach((v) => {
|
|
692
|
+
qn(v, T) && v.onChange(T);
|
|
700
693
|
});
|
|
701
|
-
}, r = (
|
|
702
|
-
if (e.get(
|
|
703
|
-
throw Error(`Cannot add annotation ${
|
|
704
|
-
e.set(
|
|
705
|
-
}, l = (
|
|
706
|
-
const T = typeof
|
|
694
|
+
}, r = (b, S = H.LOCAL) => {
|
|
695
|
+
if (e.get(b.id))
|
|
696
|
+
throw Error(`Cannot add annotation ${b.id} - exists already`);
|
|
697
|
+
e.set(b.id, b), b.bodies.forEach((T) => t.set(T.id, b.id)), s(S, { created: [b] });
|
|
698
|
+
}, l = (b, S) => {
|
|
699
|
+
const T = typeof b == "string" ? S : b, v = typeof b == "string" ? b : b.id, P = e.get(v);
|
|
707
700
|
if (P) {
|
|
708
|
-
const G =
|
|
709
|
-
return
|
|
701
|
+
const G = Zt(P, T);
|
|
702
|
+
return v === T.id ? e.set(v, T) : (e.delete(v), 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
703
|
} else
|
|
711
|
-
console.warn(`Cannot update annotation ${
|
|
712
|
-
}, a = (
|
|
713
|
-
const
|
|
714
|
-
P && s(
|
|
715
|
-
}, c = (
|
|
716
|
-
const T =
|
|
704
|
+
console.warn(`Cannot update annotation ${v} - does not exist`);
|
|
705
|
+
}, a = (b, S = H.LOCAL, T = H.LOCAL) => {
|
|
706
|
+
const v = Wn(S) ? T : S, P = l(b, S);
|
|
707
|
+
P && s(v, { updated: [P] });
|
|
708
|
+
}, c = (b, S = H.LOCAL) => {
|
|
709
|
+
const T = b.reduce((v, P) => {
|
|
717
710
|
const G = l(P);
|
|
718
|
-
return G ? [...
|
|
711
|
+
return G ? [...v, G] : v;
|
|
719
712
|
}, []);
|
|
720
713
|
T.length > 0 && s(S, { updated: T });
|
|
721
|
-
}, u = (
|
|
722
|
-
const T = e.get(
|
|
714
|
+
}, u = (b, S = H.LOCAL) => {
|
|
715
|
+
const T = e.get(b.annotation);
|
|
723
716
|
if (T) {
|
|
724
|
-
const
|
|
717
|
+
const v = {
|
|
725
718
|
...T,
|
|
726
|
-
bodies: [...T.bodies,
|
|
719
|
+
bodies: [...T.bodies, b]
|
|
727
720
|
};
|
|
728
|
-
e.set(T.id,
|
|
721
|
+
e.set(T.id, v), t.set(b.id, v.id), s(S, { updated: [{
|
|
729
722
|
oldValue: T,
|
|
730
|
-
newValue:
|
|
731
|
-
bodiesCreated: [
|
|
723
|
+
newValue: v,
|
|
724
|
+
bodiesCreated: [b]
|
|
732
725
|
}] });
|
|
733
726
|
} else
|
|
734
|
-
console.warn(`Attempt to add body to missing annotation: ${
|
|
735
|
-
}, f = () => [...e.values()], d = (
|
|
727
|
+
console.warn(`Attempt to add body to missing annotation: ${b.annotation}`);
|
|
728
|
+
}, f = () => [...e.values()], d = (b = H.LOCAL) => {
|
|
736
729
|
const S = [...e.values()];
|
|
737
|
-
e.clear(), t.clear(), s(
|
|
738
|
-
}, g = (
|
|
730
|
+
e.clear(), t.clear(), s(b, { deleted: S });
|
|
731
|
+
}, g = (b, S = !0, T = H.LOCAL) => {
|
|
739
732
|
if (S) {
|
|
740
|
-
const
|
|
741
|
-
e.clear(), t.clear(),
|
|
733
|
+
const v = [...e.values()];
|
|
734
|
+
e.clear(), t.clear(), b.forEach((P) => {
|
|
742
735
|
e.set(P.id, P), P.bodies.forEach((G) => t.set(G.id, P.id));
|
|
743
|
-
}), s(T, { created:
|
|
736
|
+
}), s(T, { created: b, deleted: v });
|
|
744
737
|
} else {
|
|
745
|
-
const
|
|
738
|
+
const v = b.reduce((P, G) => {
|
|
746
739
|
const x = e.get(G.id);
|
|
747
740
|
return x ? [...P, x] : P;
|
|
748
741
|
}, []);
|
|
749
|
-
if (
|
|
750
|
-
throw Error(`Bulk insert would overwrite the following annotations: ${
|
|
751
|
-
|
|
742
|
+
if (v.length > 0)
|
|
743
|
+
throw Error(`Bulk insert would overwrite the following annotations: ${v.map((P) => P.id).join(", ")}`);
|
|
744
|
+
b.forEach((P) => {
|
|
752
745
|
e.set(P.id, P), P.bodies.forEach((G) => t.set(G.id, P.id));
|
|
753
|
-
}), s(T, { created:
|
|
746
|
+
}), s(T, { created: b });
|
|
754
747
|
}
|
|
755
|
-
}, m = (
|
|
756
|
-
const S = typeof
|
|
748
|
+
}, m = (b) => {
|
|
749
|
+
const S = typeof b == "string" ? b : b.id, T = e.get(S);
|
|
757
750
|
if (T)
|
|
758
|
-
return e.delete(S), T.bodies.forEach((
|
|
751
|
+
return e.delete(S), T.bodies.forEach((v) => t.delete(v.id)), T;
|
|
759
752
|
console.warn(`Attempt to delete missing annotation: ${S}`);
|
|
760
|
-
}, y = (
|
|
761
|
-
const T = m(
|
|
753
|
+
}, y = (b, S = H.LOCAL) => {
|
|
754
|
+
const T = m(b);
|
|
762
755
|
T && s(S, { deleted: [T] });
|
|
763
|
-
},
|
|
764
|
-
const T =
|
|
756
|
+
}, w = (b, S = H.LOCAL) => {
|
|
757
|
+
const T = b.reduce((v, P) => {
|
|
765
758
|
const G = m(P);
|
|
766
|
-
return G ? [...
|
|
759
|
+
return G ? [...v, G] : v;
|
|
767
760
|
}, []);
|
|
768
761
|
T.length > 0 && s(S, { deleted: T });
|
|
769
|
-
}, p = (
|
|
770
|
-
const S = e.get(
|
|
762
|
+
}, p = (b) => {
|
|
763
|
+
const S = e.get(b.annotation);
|
|
771
764
|
if (S) {
|
|
772
|
-
const T = S.bodies.find((
|
|
765
|
+
const T = S.bodies.find((v) => v.id === b.id);
|
|
773
766
|
if (T) {
|
|
774
767
|
t.delete(T.id);
|
|
775
|
-
const
|
|
768
|
+
const v = {
|
|
776
769
|
...S,
|
|
777
|
-
bodies: S.bodies.filter((P) => P.id !==
|
|
770
|
+
bodies: S.bodies.filter((P) => P.id !== b.id)
|
|
778
771
|
};
|
|
779
|
-
return e.set(S.id,
|
|
772
|
+
return e.set(S.id, v), {
|
|
780
773
|
oldValue: S,
|
|
781
|
-
newValue:
|
|
774
|
+
newValue: v,
|
|
782
775
|
bodiesDeleted: [T]
|
|
783
776
|
};
|
|
784
777
|
} else
|
|
785
|
-
console.warn(`Attempt to delete missing body ${
|
|
778
|
+
console.warn(`Attempt to delete missing body ${b.id} from annotation ${b.annotation}`);
|
|
786
779
|
} else
|
|
787
|
-
console.warn(`Attempt to delete body from missing annotation ${
|
|
788
|
-
}, A = (
|
|
789
|
-
const T = p(
|
|
780
|
+
console.warn(`Attempt to delete body from missing annotation ${b.annotation}`);
|
|
781
|
+
}, A = (b, S = H.LOCAL) => {
|
|
782
|
+
const T = p(b);
|
|
790
783
|
T && s(S, { updated: [T] });
|
|
791
|
-
}, _ = (
|
|
792
|
-
const T =
|
|
784
|
+
}, _ = (b, S = H.LOCAL) => {
|
|
785
|
+
const T = b.map((v) => p(v)).filter(Boolean);
|
|
793
786
|
T.length > 0 && s(S, { updated: T });
|
|
794
|
-
}, E = (
|
|
795
|
-
const S = e.get(
|
|
787
|
+
}, E = (b) => {
|
|
788
|
+
const S = e.get(b);
|
|
796
789
|
return S ? { ...S } : void 0;
|
|
797
|
-
}, B = (
|
|
798
|
-
const S = t.get(
|
|
790
|
+
}, B = (b) => {
|
|
791
|
+
const S = t.get(b);
|
|
799
792
|
if (S) {
|
|
800
|
-
const T = E(S).bodies.find((
|
|
793
|
+
const T = E(S).bodies.find((v) => v.id === b);
|
|
801
794
|
if (T)
|
|
802
795
|
return T;
|
|
803
|
-
console.error(`Store integrity error: body ${
|
|
796
|
+
console.error(`Store integrity error: body ${b} in index, but not in annotation`);
|
|
804
797
|
} else
|
|
805
|
-
console.warn(`Attempt to retrieve missing body: ${
|
|
806
|
-
}, V = (
|
|
807
|
-
if (
|
|
798
|
+
console.warn(`Attempt to retrieve missing body: ${b}`);
|
|
799
|
+
}, V = (b, S) => {
|
|
800
|
+
if (b.annotation !== S.annotation)
|
|
808
801
|
throw "Annotation integrity violation: annotation ID must be the same when updating bodies";
|
|
809
|
-
const T = e.get(
|
|
802
|
+
const T = e.get(b.annotation);
|
|
810
803
|
if (T) {
|
|
811
|
-
const
|
|
804
|
+
const v = T.bodies.find((G) => G.id === b.id), P = {
|
|
812
805
|
...T,
|
|
813
|
-
bodies: T.bodies.map((G) => G.id ===
|
|
806
|
+
bodies: T.bodies.map((G) => G.id === v.id ? S : G)
|
|
814
807
|
};
|
|
815
|
-
return e.set(T.id, P),
|
|
808
|
+
return e.set(T.id, P), v.id !== S.id && (t.delete(v.id), t.set(S.id, P.id)), {
|
|
816
809
|
oldValue: T,
|
|
817
810
|
newValue: P,
|
|
818
|
-
bodiesUpdated: [{ oldBody:
|
|
811
|
+
bodiesUpdated: [{ oldBody: v, newBody: S }]
|
|
819
812
|
};
|
|
820
813
|
} else
|
|
821
|
-
console.warn(`Attempt to add body to missing annotation ${
|
|
822
|
-
}, U = (
|
|
823
|
-
const
|
|
824
|
-
|
|
825
|
-
}, R = (
|
|
826
|
-
const T =
|
|
814
|
+
console.warn(`Attempt to add body to missing annotation ${b.annotation}`);
|
|
815
|
+
}, U = (b, S, T = H.LOCAL) => {
|
|
816
|
+
const v = V(b, S);
|
|
817
|
+
v && s(T, { updated: [v] });
|
|
818
|
+
}, R = (b, S = H.LOCAL) => {
|
|
819
|
+
const T = b.map((v) => V({ id: v.id, annotation: v.annotation }, v)).filter(Boolean);
|
|
827
820
|
s(S, { updated: T });
|
|
828
|
-
}, Y = (
|
|
829
|
-
const S = e.get(
|
|
821
|
+
}, Y = (b) => {
|
|
822
|
+
const S = e.get(b.annotation);
|
|
830
823
|
if (S) {
|
|
831
824
|
const T = {
|
|
832
825
|
...S,
|
|
833
826
|
target: {
|
|
834
827
|
...S.target,
|
|
835
|
-
...
|
|
828
|
+
...b
|
|
836
829
|
}
|
|
837
830
|
};
|
|
838
831
|
return e.set(S.id, T), {
|
|
@@ -840,23 +833,23 @@ const Fn = (e, t) => {
|
|
|
840
833
|
newValue: T,
|
|
841
834
|
targetUpdated: {
|
|
842
835
|
oldTarget: S.target,
|
|
843
|
-
newTarget:
|
|
836
|
+
newTarget: b
|
|
844
837
|
}
|
|
845
838
|
};
|
|
846
839
|
} else
|
|
847
|
-
console.warn(`Attempt to update target on missing annotation: ${
|
|
840
|
+
console.warn(`Attempt to update target on missing annotation: ${b.annotation}`);
|
|
848
841
|
};
|
|
849
842
|
return {
|
|
850
843
|
addAnnotation: r,
|
|
851
844
|
addBody: u,
|
|
852
845
|
all: f,
|
|
853
846
|
bulkAddAnnotation: g,
|
|
854
|
-
bulkDeleteAnnotation:
|
|
847
|
+
bulkDeleteAnnotation: w,
|
|
855
848
|
bulkDeleteBodies: _,
|
|
856
849
|
bulkUpdateAnnotation: c,
|
|
857
850
|
bulkUpdateBodies: R,
|
|
858
|
-
bulkUpdateTargets: (
|
|
859
|
-
const T =
|
|
851
|
+
bulkUpdateTargets: (b, S = H.LOCAL) => {
|
|
852
|
+
const T = b.map((v) => Y(v)).filter(Boolean);
|
|
860
853
|
T.length > 0 && s(S, { updated: T });
|
|
861
854
|
},
|
|
862
855
|
clear: d,
|
|
@@ -868,19 +861,19 @@ const Fn = (e, t) => {
|
|
|
868
861
|
unobserve: i,
|
|
869
862
|
updateAnnotation: a,
|
|
870
863
|
updateBody: U,
|
|
871
|
-
updateTarget: (
|
|
872
|
-
const T = Y(
|
|
864
|
+
updateTarget: (b, S = H.LOCAL) => {
|
|
865
|
+
const T = Y(b);
|
|
873
866
|
T && s(S, { updated: [T] });
|
|
874
867
|
}
|
|
875
868
|
};
|
|
876
|
-
},
|
|
869
|
+
}, Qn = (e) => ({
|
|
877
870
|
...e,
|
|
878
871
|
subscribe: (t) => {
|
|
879
872
|
const n = (o) => t(o.state);
|
|
880
873
|
return e.observe(n), t(e.all()), () => e.unobserve(n);
|
|
881
874
|
}
|
|
882
875
|
});
|
|
883
|
-
let
|
|
876
|
+
let Zn = () => ({
|
|
884
877
|
emit(e, ...t) {
|
|
885
878
|
for (let n = 0, o = this.events[e] || [], i = o.length; n < i; n++)
|
|
886
879
|
o[n](...t);
|
|
@@ -894,17 +887,17 @@ let Jn = () => ({
|
|
|
894
887
|
};
|
|
895
888
|
}
|
|
896
889
|
});
|
|
897
|
-
const
|
|
898
|
-
const t =
|
|
890
|
+
const xn = 250, $n = (e) => {
|
|
891
|
+
const t = Zn(), n = [];
|
|
899
892
|
let o = -1, i = !1, s = 0;
|
|
900
893
|
const r = (g) => {
|
|
901
894
|
if (!i) {
|
|
902
895
|
const { changes: m } = g, y = performance.now();
|
|
903
|
-
if (y - s >
|
|
896
|
+
if (y - s > xn)
|
|
904
897
|
n.splice(o + 1), n.push(m), o = n.length - 1;
|
|
905
898
|
else {
|
|
906
|
-
const
|
|
907
|
-
n[
|
|
899
|
+
const w = n.length - 1;
|
|
900
|
+
n[w] = Kn(n[w], m);
|
|
908
901
|
}
|
|
909
902
|
s = y;
|
|
910
903
|
}
|
|
@@ -932,20 +925,23 @@ const Qn = 250, Zn = (e) => {
|
|
|
932
925
|
}
|
|
933
926
|
}
|
|
934
927
|
};
|
|
935
|
-
},
|
|
936
|
-
const { subscribe: e, set: t } =
|
|
928
|
+
}, eo = () => {
|
|
929
|
+
const { subscribe: e, set: t } = ut([]);
|
|
937
930
|
return {
|
|
938
931
|
subscribe: e,
|
|
939
932
|
set: t
|
|
940
933
|
};
|
|
941
|
-
},
|
|
934
|
+
}, to = (e, t, n, o) => {
|
|
942
935
|
const { store: i, selection: s, hover: r, viewport: l } = e, a = /* @__PURE__ */ new Map();
|
|
943
936
|
let c = [], u, f;
|
|
944
937
|
const d = (p, A) => {
|
|
945
938
|
a.has(p) ? a.get(p).push(A) : a.set(p, [A]);
|
|
946
939
|
}, g = (p, A) => {
|
|
947
940
|
const _ = a.get(p);
|
|
948
|
-
|
|
941
|
+
if (_) {
|
|
942
|
+
const E = _.indexOf(A);
|
|
943
|
+
E !== -1 && _.splice(E, 1);
|
|
944
|
+
}
|
|
949
945
|
}, m = (p, A, _) => {
|
|
950
946
|
a.has(p) && setTimeout(() => {
|
|
951
947
|
a.get(p).forEach((E) => {
|
|
@@ -1005,12 +1001,12 @@ const Qn = 250, Zn = (e) => {
|
|
|
1005
1001
|
_.length > 0 && (c = c.map((E) => _.find((V) => V.id === E.id) || E));
|
|
1006
1002
|
}
|
|
1007
1003
|
}, { origin: H.REMOTE });
|
|
1008
|
-
const
|
|
1004
|
+
const w = (p) => (A) => {
|
|
1009
1005
|
const { updated: _ } = A;
|
|
1010
1006
|
p ? (_ || []).forEach((E) => m("updateAnnotation", E.oldValue, E.newValue)) : (_ || []).forEach((E) => m("updateAnnotation", E.newValue, E.oldValue));
|
|
1011
1007
|
};
|
|
1012
|
-
return t.on("undo",
|
|
1013
|
-
},
|
|
1008
|
+
return t.on("undo", w(!0)), t.on("redo", w(!1)), { on: d, off: g, emit: m };
|
|
1009
|
+
}, no = (e) => (t) => t.reduce((n, o) => {
|
|
1014
1010
|
const { parsed: i, error: s } = e.parse(o);
|
|
1015
1011
|
return s ? {
|
|
1016
1012
|
parsed: n.parsed,
|
|
@@ -1021,45 +1017,45 @@ const Qn = 250, Zn = (e) => {
|
|
|
1021
1017
|
} : {
|
|
1022
1018
|
...n
|
|
1023
1019
|
};
|
|
1024
|
-
}, { parsed: [], failed: [] }),
|
|
1025
|
-
const { store: o, selection: i } = e, s = (
|
|
1020
|
+
}, { parsed: [], failed: [] }), oo = (e, t, n) => {
|
|
1021
|
+
const { store: o, selection: i } = e, s = (w) => {
|
|
1026
1022
|
if (n) {
|
|
1027
|
-
const { parsed: p, error: A } = n.parse(
|
|
1023
|
+
const { parsed: p, error: A } = n.parse(w);
|
|
1028
1024
|
p ? o.addAnnotation(p, H.REMOTE) : console.error(A);
|
|
1029
1025
|
} else
|
|
1030
|
-
o.addAnnotation(
|
|
1031
|
-
}, r = () => i.clear(), l = () => o.clear(), a = (
|
|
1032
|
-
const p = o.getAnnotation(
|
|
1026
|
+
o.addAnnotation(w, H.REMOTE);
|
|
1027
|
+
}, r = () => i.clear(), l = () => o.clear(), a = (w) => {
|
|
1028
|
+
const p = o.getAnnotation(w);
|
|
1033
1029
|
return n && p ? n.serialize(p) : p;
|
|
1034
1030
|
}, c = () => n ? o.all().map(n.serialize) : o.all(), u = () => {
|
|
1035
|
-
var
|
|
1036
|
-
const p = (((
|
|
1031
|
+
var w;
|
|
1032
|
+
const p = (((w = i.selected) == null ? void 0 : w.map((A) => A.id)) || []).map((A) => o.getAnnotation(A)).filter(Boolean);
|
|
1037
1033
|
return n ? p.map(n.serialize) : p;
|
|
1038
|
-
}, f = (
|
|
1039
|
-
if (typeof
|
|
1040
|
-
const p = o.getAnnotation(
|
|
1041
|
-
if (o.deleteAnnotation(
|
|
1034
|
+
}, f = (w, p = !0) => fetch(w).then((A) => A.json()).then((A) => (g(A, p), A)), d = (w) => {
|
|
1035
|
+
if (typeof w == "string") {
|
|
1036
|
+
const p = o.getAnnotation(w);
|
|
1037
|
+
if (o.deleteAnnotation(w), p)
|
|
1042
1038
|
return n ? n.serialize(p) : p;
|
|
1043
1039
|
} else {
|
|
1044
|
-
const p = n ? n.parse(
|
|
1040
|
+
const p = n ? n.parse(w).parsed : w;
|
|
1045
1041
|
if (p)
|
|
1046
|
-
return o.deleteAnnotation(p),
|
|
1042
|
+
return o.deleteAnnotation(p), w;
|
|
1047
1043
|
}
|
|
1048
|
-
}, g = (
|
|
1044
|
+
}, g = (w, p = !0) => {
|
|
1049
1045
|
if (n) {
|
|
1050
|
-
const { parsed: A, failed: _ } =
|
|
1046
|
+
const { parsed: A, failed: _ } = no(n)(w);
|
|
1051
1047
|
_.length > 0 && console.warn(`Discarded ${_.length} invalid annotations`, _), o.bulkAddAnnotation(A, p, H.REMOTE);
|
|
1052
1048
|
} else
|
|
1053
|
-
o.bulkAddAnnotation(
|
|
1054
|
-
}, m = (
|
|
1055
|
-
|
|
1056
|
-
}, y = (
|
|
1049
|
+
o.bulkAddAnnotation(w, p, H.REMOTE);
|
|
1050
|
+
}, m = (w, p) => {
|
|
1051
|
+
w ? i.setSelected(w, p) : i.clear();
|
|
1052
|
+
}, y = (w) => {
|
|
1057
1053
|
if (n) {
|
|
1058
|
-
const p = n.parse(
|
|
1054
|
+
const p = n.parse(w).parsed, A = n.serialize(o.getAnnotation(p.id));
|
|
1059
1055
|
return o.updateAnnotation(p), A;
|
|
1060
1056
|
} else {
|
|
1061
|
-
const p = o.getAnnotation(
|
|
1062
|
-
return o.updateAnnotation(
|
|
1057
|
+
const p = o.getAnnotation(w.id);
|
|
1058
|
+
return o.updateAnnotation(w), p;
|
|
1063
1059
|
}
|
|
1064
1060
|
};
|
|
1065
1061
|
return {
|
|
@@ -1079,25 +1075,24 @@ const Qn = 250, Zn = (e) => {
|
|
|
1079
1075
|
undo: t.undo,
|
|
1080
1076
|
updateAnnotation: y
|
|
1081
1077
|
};
|
|
1082
|
-
},
|
|
1083
|
-
let
|
|
1078
|
+
}, io = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
1079
|
+
let so = (e) => crypto.getRandomValues(new Uint8Array(e)), ro = (e, t, n) => {
|
|
1084
1080
|
let o = (2 << Math.log(e.length - 1) / Math.LN2) - 1, i = -~(1.6 * o * t / e.length);
|
|
1085
1081
|
return (s = t) => {
|
|
1086
1082
|
let r = "";
|
|
1087
1083
|
for (; ; ) {
|
|
1088
1084
|
let l = n(i), a = i;
|
|
1089
1085
|
for (; a--; )
|
|
1090
|
-
if (r += e[l[a] & o] || "", r.length === s)
|
|
1091
|
-
return r;
|
|
1086
|
+
if (r += e[l[a] & o] || "", r.length === s) return r;
|
|
1092
1087
|
}
|
|
1093
1088
|
};
|
|
1094
|
-
},
|
|
1089
|
+
}, lo = (e, t = 21) => ro(e, t, so), ao = (e = 21) => {
|
|
1095
1090
|
let t = "", n = crypto.getRandomValues(new Uint8Array(e));
|
|
1096
1091
|
for (; e--; )
|
|
1097
|
-
t +=
|
|
1092
|
+
t += io[n[e] & 63];
|
|
1098
1093
|
return t;
|
|
1099
1094
|
};
|
|
1100
|
-
const
|
|
1095
|
+
const co = () => ({ isGuest: !0, id: lo("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_", 20)() }), fo = (e) => {
|
|
1101
1096
|
const t = JSON.stringify(e);
|
|
1102
1097
|
let n = 0;
|
|
1103
1098
|
for (let o = 0, i = t.length; o < i; o++) {
|
|
@@ -1105,20 +1100,20 @@ const lo = () => ({ isGuest: !0, id: so("1234567890abcdefghijklmnopqrstuvwxyzABC
|
|
|
1105
1100
|
n = (n << 5) - n + s, n |= 0;
|
|
1106
1101
|
}
|
|
1107
1102
|
return `${n}`;
|
|
1108
|
-
},
|
|
1103
|
+
}, xt = (e) => e ? typeof e == "object" ? { ...e } : e : void 0, uo = (e, t) => (Array.isArray(e) ? e : [e]).map((n) => {
|
|
1109
1104
|
const { id: o, type: i, purpose: s, value: r, created: l, modified: a, creator: c, ...u } = n;
|
|
1110
1105
|
return {
|
|
1111
|
-
id: o || `temp-${
|
|
1106
|
+
id: o || `temp-${fo(n)}`,
|
|
1112
1107
|
annotation: t,
|
|
1113
1108
|
type: i,
|
|
1114
1109
|
purpose: s,
|
|
1115
1110
|
value: r,
|
|
1116
|
-
creator:
|
|
1111
|
+
creator: xt(c),
|
|
1117
1112
|
created: l ? new Date(l) : void 0,
|
|
1118
1113
|
updated: a ? new Date(a) : void 0,
|
|
1119
1114
|
...u
|
|
1120
1115
|
};
|
|
1121
|
-
}),
|
|
1116
|
+
}), ho = (e) => e.map((t) => {
|
|
1122
1117
|
var n;
|
|
1123
1118
|
const { annotation: o, created: i, updated: s, ...r } = t, l = {
|
|
1124
1119
|
...r,
|
|
@@ -1127,15 +1122,15 @@ const lo = () => ({ isGuest: !0, id: so("1234567890abcdefghijklmnopqrstuvwxyzABC
|
|
|
1127
1122
|
};
|
|
1128
1123
|
return (n = l.id) != null && n.startsWith("temp-") && delete l.id, l;
|
|
1129
1124
|
});
|
|
1130
|
-
|
|
1131
|
-
const
|
|
1132
|
-
const n = e.id ||
|
|
1125
|
+
ao();
|
|
1126
|
+
const Ci = (e, t = !1) => ({ parse: (i) => go(i, t), serialize: (i) => mo(i, e) }), go = (e, t = !1) => {
|
|
1127
|
+
const n = e.id || Jt(), {
|
|
1133
1128
|
creator: o,
|
|
1134
1129
|
created: i,
|
|
1135
1130
|
modified: s,
|
|
1136
1131
|
body: r,
|
|
1137
1132
|
...l
|
|
1138
|
-
} = e, a =
|
|
1133
|
+
} = e, a = uo(r, n), c = Array.isArray(e.target) ? e.target[0] : e.target, u = Array.isArray(c.selector) ? c.selector[0] : c.selector, f = (u == null ? void 0 : u.type) === "FragmentSelector" ? Mn(u, t) : (u == null ? void 0 : u.type) === "SvgSelector" ? Pn(u) : void 0;
|
|
1139
1134
|
return f ? {
|
|
1140
1135
|
parsed: {
|
|
1141
1136
|
...l,
|
|
@@ -1143,7 +1138,7 @@ const Yi = (e, t = !1) => ({ parse: (i) => uo(i, t), serialize: (i) => ho(i, e)
|
|
|
1143
1138
|
bodies: a,
|
|
1144
1139
|
target: {
|
|
1145
1140
|
created: i ? new Date(i) : void 0,
|
|
1146
|
-
creator:
|
|
1141
|
+
creator: xt(o),
|
|
1147
1142
|
updated: s ? new Date(s) : void 0,
|
|
1148
1143
|
...Array.isArray(l.target) ? l.target[0] : l.target,
|
|
1149
1144
|
annotation: n,
|
|
@@ -1153,7 +1148,7 @@ const Yi = (e, t = !1) => ({ parse: (i) => uo(i, t), serialize: (i) => ho(i, e)
|
|
|
1153
1148
|
} : {
|
|
1154
1149
|
error: Error(`Invalid selector: ${JSON.stringify(u)}`)
|
|
1155
1150
|
};
|
|
1156
|
-
},
|
|
1151
|
+
}, mo = (e, t) => {
|
|
1157
1152
|
const {
|
|
1158
1153
|
selector: n,
|
|
1159
1154
|
creator: o,
|
|
@@ -1162,12 +1157,12 @@ const Yi = (e, t = !1) => ({ parse: (i) => uo(i, t), serialize: (i) => ho(i, e)
|
|
|
1162
1157
|
updatedBy: r,
|
|
1163
1158
|
// Excluded from serialization
|
|
1164
1159
|
...l
|
|
1165
|
-
} = e.target, a = n.type == q.RECTANGLE ?
|
|
1160
|
+
} = e.target, a = n.type == q.RECTANGLE ? Ln(n.geometry) : Yn(n), c = {
|
|
1166
1161
|
...e,
|
|
1167
1162
|
"@context": "http://www.w3.org/ns/anno.jsonld",
|
|
1168
1163
|
id: e.id,
|
|
1169
1164
|
type: "Annotation",
|
|
1170
|
-
body:
|
|
1165
|
+
body: ho(e.bodies),
|
|
1171
1166
|
created: i == null ? void 0 : i.toISOString(),
|
|
1172
1167
|
creator: o,
|
|
1173
1168
|
modified: s == null ? void 0 : s.toISOString(),
|
|
@@ -1179,11 +1174,11 @@ const Yi = (e, t = !1) => ({ parse: (i) => uo(i, t), serialize: (i) => ho(i, e)
|
|
|
1179
1174
|
};
|
|
1180
1175
|
return delete c.bodies, "annotation" in c.target && delete c.target.annotation, c;
|
|
1181
1176
|
};
|
|
1182
|
-
function
|
|
1177
|
+
function At(e, t, n) {
|
|
1183
1178
|
const o = e.slice();
|
|
1184
1179
|
return o[10] = t[n], o[12] = n, o;
|
|
1185
1180
|
}
|
|
1186
|
-
function
|
|
1181
|
+
function St(e) {
|
|
1187
1182
|
let t, n;
|
|
1188
1183
|
return t = new ke({
|
|
1189
1184
|
props: {
|
|
@@ -1229,43 +1224,43 @@ function bt(e) {
|
|
|
1229
1224
|
n || (I(t.$$.fragment, o), n = !0);
|
|
1230
1225
|
},
|
|
1231
1226
|
o(o) {
|
|
1232
|
-
|
|
1227
|
+
C(t.$$.fragment, o), n = !1;
|
|
1233
1228
|
},
|
|
1234
1229
|
d(o) {
|
|
1235
1230
|
ee(t, o);
|
|
1236
1231
|
}
|
|
1237
1232
|
};
|
|
1238
1233
|
}
|
|
1239
|
-
function
|
|
1234
|
+
function po(e) {
|
|
1240
1235
|
let t, n, o, i, s, r, l, a, c, u, f, d = Se(
|
|
1241
1236
|
/*geom*/
|
|
1242
1237
|
e[4].points
|
|
1243
1238
|
), g = [];
|
|
1244
1239
|
for (let y = 0; y < d.length; y += 1)
|
|
1245
|
-
g[y] =
|
|
1246
|
-
const m = (y) =>
|
|
1240
|
+
g[y] = St(At(e, d, y));
|
|
1241
|
+
const m = (y) => C(g[y], 1, 1, () => {
|
|
1247
1242
|
g[y] = null;
|
|
1248
1243
|
});
|
|
1249
1244
|
return {
|
|
1250
1245
|
c() {
|
|
1251
|
-
t =
|
|
1246
|
+
t = X("polygon"), i = ie(), s = X("polygon"), l = ie();
|
|
1252
1247
|
for (let y = 0; y < g.length; y += 1)
|
|
1253
1248
|
g[y].c();
|
|
1254
1249
|
a = fe(), h(t, "class", "a9s-outer"), h(t, "style", n = /*computedStyle*/
|
|
1255
1250
|
e[1] ? "display:none;" : void 0), h(t, "points", o = /*geom*/
|
|
1256
|
-
e[4].points.map(
|
|
1251
|
+
e[4].points.map(Tt).join(" ")), h(s, "class", "a9s-inner a9s-shape-handle"), h(
|
|
1257
1252
|
s,
|
|
1258
1253
|
"style",
|
|
1259
1254
|
/*computedStyle*/
|
|
1260
1255
|
e[1]
|
|
1261
1256
|
), h(s, "points", r = /*geom*/
|
|
1262
|
-
e[4].points.map(
|
|
1257
|
+
e[4].points.map(vt).join(" "));
|
|
1263
1258
|
},
|
|
1264
|
-
m(y,
|
|
1265
|
-
O(y, t,
|
|
1259
|
+
m(y, w) {
|
|
1260
|
+
O(y, t, w), O(y, i, w), O(y, s, w), O(y, l, w);
|
|
1266
1261
|
for (let p = 0; p < g.length; p += 1)
|
|
1267
|
-
g[p] && g[p].m(y,
|
|
1268
|
-
O(y, a,
|
|
1262
|
+
g[p] && g[p].m(y, w);
|
|
1263
|
+
O(y, a, w), c = !0, u || (f = [
|
|
1269
1264
|
j(t, "pointerdown", function() {
|
|
1270
1265
|
K(
|
|
1271
1266
|
/*grab*/
|
|
@@ -1280,20 +1275,20 @@ function go(e) {
|
|
|
1280
1275
|
})
|
|
1281
1276
|
], u = !0);
|
|
1282
1277
|
},
|
|
1283
|
-
p(y,
|
|
1284
|
-
if (e = y, (!c ||
|
|
1278
|
+
p(y, w) {
|
|
1279
|
+
if (e = y, (!c || w & /*computedStyle*/
|
|
1285
1280
|
2 && n !== (n = /*computedStyle*/
|
|
1286
|
-
e[1] ? "display:none;" : void 0)) && h(t, "style", n), (!c ||
|
|
1281
|
+
e[1] ? "display:none;" : void 0)) && h(t, "style", n), (!c || w & /*geom*/
|
|
1287
1282
|
16 && o !== (o = /*geom*/
|
|
1288
|
-
e[4].points.map(
|
|
1283
|
+
e[4].points.map(Tt).join(" "))) && h(t, "points", o), (!c || w & /*computedStyle*/
|
|
1289
1284
|
2) && h(
|
|
1290
1285
|
s,
|
|
1291
1286
|
"style",
|
|
1292
1287
|
/*computedStyle*/
|
|
1293
1288
|
e[1]
|
|
1294
|
-
), (!c ||
|
|
1289
|
+
), (!c || w & /*geom*/
|
|
1295
1290
|
16 && r !== (r = /*geom*/
|
|
1296
|
-
e[4].points.map(
|
|
1291
|
+
e[4].points.map(vt).join(" "))) && h(s, "points", r), w & /*geom, viewportScale, grab*/
|
|
1297
1292
|
536) {
|
|
1298
1293
|
d = Se(
|
|
1299
1294
|
/*geom*/
|
|
@@ -1301,8 +1296,8 @@ function go(e) {
|
|
|
1301
1296
|
);
|
|
1302
1297
|
let p;
|
|
1303
1298
|
for (p = 0; p < d.length; p += 1) {
|
|
1304
|
-
const A =
|
|
1305
|
-
g[p] ? (g[p].p(A,
|
|
1299
|
+
const A = At(e, d, p);
|
|
1300
|
+
g[p] ? (g[p].p(A, w), I(g[p], 1)) : (g[p] = St(A), g[p].c(), I(g[p], 1), g[p].m(a.parentNode, a));
|
|
1306
1301
|
}
|
|
1307
1302
|
for (le(), p = d.length; p < g.length; p += 1)
|
|
1308
1303
|
m(p);
|
|
@@ -1311,25 +1306,25 @@ function go(e) {
|
|
|
1311
1306
|
},
|
|
1312
1307
|
i(y) {
|
|
1313
1308
|
if (!c) {
|
|
1314
|
-
for (let
|
|
1315
|
-
I(g[
|
|
1309
|
+
for (let w = 0; w < d.length; w += 1)
|
|
1310
|
+
I(g[w]);
|
|
1316
1311
|
c = !0;
|
|
1317
1312
|
}
|
|
1318
1313
|
},
|
|
1319
1314
|
o(y) {
|
|
1320
1315
|
g = g.filter(Boolean);
|
|
1321
|
-
for (let
|
|
1322
|
-
|
|
1316
|
+
for (let w = 0; w < g.length; w += 1)
|
|
1317
|
+
C(g[w]);
|
|
1323
1318
|
c = !1;
|
|
1324
1319
|
},
|
|
1325
1320
|
d(y) {
|
|
1326
|
-
y && (k(t), k(i), k(s), k(l), k(a)),
|
|
1321
|
+
y && (k(t), k(i), k(s), k(l), k(a)), at(g, y), u = !1, ce(f);
|
|
1327
1322
|
}
|
|
1328
1323
|
};
|
|
1329
1324
|
}
|
|
1330
|
-
function
|
|
1325
|
+
function yo(e) {
|
|
1331
1326
|
let t, n;
|
|
1332
|
-
return t = new
|
|
1327
|
+
return t = new en({
|
|
1333
1328
|
props: {
|
|
1334
1329
|
shape: (
|
|
1335
1330
|
/*shape*/
|
|
@@ -1345,7 +1340,7 @@ function mo(e) {
|
|
|
1345
1340
|
),
|
|
1346
1341
|
$$slots: {
|
|
1347
1342
|
default: [
|
|
1348
|
-
|
|
1343
|
+
po,
|
|
1349
1344
|
({ grab: o }) => ({ 9: o }),
|
|
1350
1345
|
({ grab: o }) => o ? 512 : 0
|
|
1351
1346
|
]
|
|
@@ -1384,20 +1379,20 @@ function mo(e) {
|
|
|
1384
1379
|
n || (I(t.$$.fragment, o), n = !0);
|
|
1385
1380
|
},
|
|
1386
1381
|
o(o) {
|
|
1387
|
-
|
|
1382
|
+
C(t.$$.fragment, o), n = !1;
|
|
1388
1383
|
},
|
|
1389
1384
|
d(o) {
|
|
1390
1385
|
ee(t, o);
|
|
1391
1386
|
}
|
|
1392
1387
|
};
|
|
1393
1388
|
}
|
|
1394
|
-
const
|
|
1395
|
-
function
|
|
1389
|
+
const Tt = (e) => e.join(","), vt = (e) => e.join(",");
|
|
1390
|
+
function _o(e, t, n) {
|
|
1396
1391
|
let o, { shape: i } = t, { computedStyle: s } = t, { transform: r } = t, { viewportScale: l = 1 } = t;
|
|
1397
1392
|
const a = (d, g, m) => {
|
|
1398
1393
|
let y;
|
|
1399
|
-
const
|
|
1400
|
-
g === "SHAPE" ? y =
|
|
1394
|
+
const w = d.geometry;
|
|
1395
|
+
g === "SHAPE" ? y = w.points.map(([A, _]) => [A + m[0], _ + m[1]]) : y = w.points.map(([A, _], E) => g === `HANDLE-${E}` ? [A + m[0], _ + m[1]] : [A, _]);
|
|
1401
1396
|
const p = Fe(y);
|
|
1402
1397
|
return { ...d, geometry: { points: y, bounds: p } };
|
|
1403
1398
|
};
|
|
@@ -1427,9 +1422,9 @@ function po(e, t, n) {
|
|
|
1427
1422
|
f
|
|
1428
1423
|
];
|
|
1429
1424
|
}
|
|
1430
|
-
class
|
|
1425
|
+
class wo extends oe {
|
|
1431
1426
|
constructor(t) {
|
|
1432
|
-
super(), ne(this, t,
|
|
1427
|
+
super(), ne(this, t, _o, yo, J, {
|
|
1433
1428
|
shape: 0,
|
|
1434
1429
|
computedStyle: 1,
|
|
1435
1430
|
transform: 2,
|
|
@@ -1437,11 +1432,11 @@ class yo extends oe {
|
|
|
1437
1432
|
});
|
|
1438
1433
|
}
|
|
1439
1434
|
}
|
|
1440
|
-
const
|
|
1435
|
+
const $e = (e, t) => {
|
|
1441
1436
|
const n = Math.abs(t[0] - e[0]), o = Math.abs(t[1] - e[1]);
|
|
1442
1437
|
return Math.sqrt(Math.pow(n, 2) + Math.pow(o, 2));
|
|
1443
1438
|
}, ye = [];
|
|
1444
|
-
function
|
|
1439
|
+
function bo(e, t = F) {
|
|
1445
1440
|
let n;
|
|
1446
1441
|
const o = /* @__PURE__ */ new Set();
|
|
1447
1442
|
function i(l) {
|
|
@@ -1467,7 +1462,7 @@ function _o(e, t = F) {
|
|
|
1467
1462
|
}
|
|
1468
1463
|
return { set: i, update: s, subscribe: r };
|
|
1469
1464
|
}
|
|
1470
|
-
const
|
|
1465
|
+
const Eo = (e, t) => {
|
|
1471
1466
|
const { naturalWidth: n, naturalHeight: o } = e;
|
|
1472
1467
|
if (!n && !o) {
|
|
1473
1468
|
const { width: i, height: s } = e;
|
|
@@ -1477,9 +1472,9 @@ const wo = (e, t) => {
|
|
|
1477
1472
|
});
|
|
1478
1473
|
} else
|
|
1479
1474
|
t.setAttribute("viewBox", `0 0 ${n} ${o}`);
|
|
1480
|
-
},
|
|
1481
|
-
|
|
1482
|
-
const { subscribe: n, set: o } =
|
|
1475
|
+
}, Ao = (e, t) => {
|
|
1476
|
+
Eo(e, t);
|
|
1477
|
+
const { subscribe: n, set: o } = bo(1);
|
|
1483
1478
|
let i;
|
|
1484
1479
|
return window.ResizeObserver && (i = new ResizeObserver(() => {
|
|
1485
1480
|
const r = t.getBoundingClientRect(), { width: l, height: a } = t.viewBox.baseVal, c = Math.max(
|
|
@@ -1490,12 +1485,12 @@ const wo = (e, t) => {
|
|
|
1490
1485
|
}), i.observe(t.parentElement)), { destroy: () => {
|
|
1491
1486
|
i && i.disconnect();
|
|
1492
1487
|
}, subscribe: n };
|
|
1493
|
-
},
|
|
1494
|
-
function
|
|
1488
|
+
}, So = "ontouchstart" in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;
|
|
1489
|
+
function To(e) {
|
|
1495
1490
|
let t, n, o, i, s, r;
|
|
1496
1491
|
return {
|
|
1497
1492
|
c() {
|
|
1498
|
-
t =
|
|
1493
|
+
t = X("rect"), h(t, "class", n = ze(`a9s-handle ${/*$$props*/
|
|
1499
1494
|
e[8].class || ""}`.trim()) + " svelte-1sgkh33"), h(t, "x", o = /*x*/
|
|
1500
1495
|
e[0] - /*handleSize*/
|
|
1501
1496
|
e[5] / 2), h(t, "y", i = /*y*/
|
|
@@ -1548,11 +1543,11 @@ function Ao(e) {
|
|
|
1548
1543
|
}
|
|
1549
1544
|
};
|
|
1550
1545
|
}
|
|
1551
|
-
function
|
|
1546
|
+
function vo(e) {
|
|
1552
1547
|
let t, n, o, i, s, r, l, a, c;
|
|
1553
1548
|
return {
|
|
1554
1549
|
c() {
|
|
1555
|
-
t =
|
|
1550
|
+
t = X("g"), n = X("circle"), i = X("rect"), h(
|
|
1556
1551
|
n,
|
|
1557
1552
|
"cx",
|
|
1558
1553
|
/*x*/
|
|
@@ -1675,10 +1670,10 @@ function So(e) {
|
|
|
1675
1670
|
}
|
|
1676
1671
|
};
|
|
1677
1672
|
}
|
|
1678
|
-
function
|
|
1673
|
+
function Mo(e) {
|
|
1679
1674
|
let t;
|
|
1680
1675
|
function n(s, r) {
|
|
1681
|
-
return
|
|
1676
|
+
return So ? vo : To;
|
|
1682
1677
|
}
|
|
1683
1678
|
let i = n()(e);
|
|
1684
1679
|
return {
|
|
@@ -1698,7 +1693,7 @@ function To(e) {
|
|
|
1698
1693
|
}
|
|
1699
1694
|
};
|
|
1700
1695
|
}
|
|
1701
|
-
function
|
|
1696
|
+
function Lo(e, t, n) {
|
|
1702
1697
|
let o, { x: i } = t, { y: s } = t, { scale: r } = t, { radius: l = 30 } = t, a = !1;
|
|
1703
1698
|
const c = (m) => {
|
|
1704
1699
|
m.pointerType === "touch" && n(4, a = !0);
|
|
@@ -1713,11 +1708,11 @@ function Mo(e, t, n) {
|
|
|
1713
1708
|
de.call(this, e, m);
|
|
1714
1709
|
}
|
|
1715
1710
|
return e.$$set = (m) => {
|
|
1716
|
-
n(8, t =
|
|
1711
|
+
n(8, t = it(it({}, t), pt(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);
|
|
1717
1712
|
}, e.$$.update = () => {
|
|
1718
1713
|
e.$$.dirty & /*scale*/
|
|
1719
1714
|
4 && n(5, o = 10 / r);
|
|
1720
|
-
}, t =
|
|
1715
|
+
}, t = pt(t), [
|
|
1721
1716
|
i,
|
|
1722
1717
|
s,
|
|
1723
1718
|
r,
|
|
@@ -1734,11 +1729,11 @@ function Mo(e, t, n) {
|
|
|
1734
1729
|
}
|
|
1735
1730
|
class ke extends oe {
|
|
1736
1731
|
constructor(t) {
|
|
1737
|
-
super(), ne(this, t,
|
|
1732
|
+
super(), ne(this, t, Lo, Mo, J, { x: 0, y: 1, scale: 2, radius: 3 });
|
|
1738
1733
|
}
|
|
1739
1734
|
}
|
|
1740
|
-
function
|
|
1741
|
-
let t, n, o, i, s, r, l, a, c, u, f, d, g, m, y,
|
|
1735
|
+
function ko(e) {
|
|
1736
|
+
let t, n, o, i, s, r, l, a, c, u, f, d, g, m, y, w, p, A, _, E, B, V, U, R, Y, b, S, T, v, P, G, x, ve, se, Me, L, Q, z, ue, Z, N, qe, ht;
|
|
1742
1737
|
return se = new ke({
|
|
1743
1738
|
props: {
|
|
1744
1739
|
class: "a9s-corner-handle-topleft",
|
|
@@ -1829,7 +1824,7 @@ function vo(e) {
|
|
|
1829
1824
|
) && e[9]("BOTTOM_LEFT").apply(this, arguments);
|
|
1830
1825
|
}), {
|
|
1831
1826
|
c() {
|
|
1832
|
-
t =
|
|
1827
|
+
t = X("rect"), l = ie(), a = X("rect"), g = ie(), m = X("rect"), A = ie(), _ = X("rect"), U = ie(), R = X("rect"), T = ie(), v = X("rect"), ve = ie(), te(se.$$.fragment), Me = ie(), te(L.$$.fragment), Q = ie(), te(z.$$.fragment), ue = ie(), te(Z.$$.fragment), h(t, "class", "a9s-outer"), h(t, "style", n = /*computedStyle*/
|
|
1833
1828
|
e[1] ? "display:none;" : void 0), h(t, "x", o = /*geom*/
|
|
1834
1829
|
e[4].x), h(t, "y", i = /*geom*/
|
|
1835
1830
|
e[4].y), h(t, "width", s = /*geom*/
|
|
@@ -1844,23 +1839,23 @@ function vo(e) {
|
|
|
1844
1839
|
e[4].y), h(a, "width", f = /*geom*/
|
|
1845
1840
|
e[4].w), h(a, "height", d = /*geom*/
|
|
1846
1841
|
e[4].h), h(m, "class", "a9s-edge-handle a9s-edge-handle-top"), h(m, "x", y = /*geom*/
|
|
1847
|
-
e[4].x), h(m, "y",
|
|
1842
|
+
e[4].x), h(m, "y", w = /*geom*/
|
|
1848
1843
|
e[4].y), h(m, "height", 1), h(m, "width", p = /*geom*/
|
|
1849
1844
|
e[4].w), h(_, "class", "a9s-edge-handle a9s-edge-handle-right"), h(_, "x", E = /*geom*/
|
|
1850
1845
|
e[4].x + /*geom*/
|
|
1851
1846
|
e[4].w), h(_, "y", B = /*geom*/
|
|
1852
1847
|
e[4].y), h(_, "height", V = /*geom*/
|
|
1853
1848
|
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",
|
|
1849
|
+
e[4].x), h(R, "y", b = /*geom*/
|
|
1855
1850
|
e[4].y + /*geom*/
|
|
1856
1851
|
e[4].h), h(R, "height", 1), h(R, "width", S = /*geom*/
|
|
1857
|
-
e[4].w), h(
|
|
1858
|
-
e[4].x), h(
|
|
1859
|
-
e[4].y), h(
|
|
1860
|
-
e[4].h), h(
|
|
1852
|
+
e[4].w), h(v, "class", "a9s-edge-handle a9s-edge-handle-left"), h(v, "x", P = /*geom*/
|
|
1853
|
+
e[4].x), h(v, "y", G = /*geom*/
|
|
1854
|
+
e[4].y), h(v, "height", x = /*geom*/
|
|
1855
|
+
e[4].h), h(v, "width", 1);
|
|
1861
1856
|
},
|
|
1862
|
-
m(D,
|
|
1863
|
-
O(D, t,
|
|
1857
|
+
m(D, M) {
|
|
1858
|
+
O(D, t, M), O(D, l, M), O(D, a, M), O(D, g, M), O(D, m, M), O(D, A, M), O(D, _, M), O(D, U, M), O(D, R, M), O(D, T, M), O(D, v, M), O(D, ve, M), $(se, D, M), O(D, Me, M), $(L, D, M), O(D, Q, M), $(z, D, M), O(D, ue, M), $(Z, D, M), N = !0, qe || (ht = [
|
|
1864
1859
|
j(t, "pointerdown", function() {
|
|
1865
1860
|
K(
|
|
1866
1861
|
/*grab*/
|
|
@@ -1891,7 +1886,7 @@ function vo(e) {
|
|
|
1891
1886
|
e[9]("BOTTOM")
|
|
1892
1887
|
) && e[9]("BOTTOM").apply(this, arguments);
|
|
1893
1888
|
}),
|
|
1894
|
-
j(
|
|
1889
|
+
j(v, "pointerdown", function() {
|
|
1895
1890
|
K(
|
|
1896
1891
|
/*grab*/
|
|
1897
1892
|
e[9]("LEFT")
|
|
@@ -1899,92 +1894,92 @@ function vo(e) {
|
|
|
1899
1894
|
})
|
|
1900
1895
|
], qe = !0);
|
|
1901
1896
|
},
|
|
1902
|
-
p(D,
|
|
1903
|
-
e = D, (!N ||
|
|
1897
|
+
p(D, M) {
|
|
1898
|
+
e = D, (!N || M & /*computedStyle*/
|
|
1904
1899
|
2 && n !== (n = /*computedStyle*/
|
|
1905
|
-
e[1] ? "display:none;" : void 0)) && h(t, "style", n), (!N ||
|
|
1900
|
+
e[1] ? "display:none;" : void 0)) && h(t, "style", n), (!N || M & /*geom*/
|
|
1906
1901
|
16 && o !== (o = /*geom*/
|
|
1907
|
-
e[4].x)) && h(t, "x", o), (!N ||
|
|
1902
|
+
e[4].x)) && h(t, "x", o), (!N || M & /*geom*/
|
|
1908
1903
|
16 && i !== (i = /*geom*/
|
|
1909
|
-
e[4].y)) && h(t, "y", i), (!N ||
|
|
1904
|
+
e[4].y)) && h(t, "y", i), (!N || M & /*geom*/
|
|
1910
1905
|
16 && s !== (s = /*geom*/
|
|
1911
|
-
e[4].w)) && h(t, "width", s), (!N ||
|
|
1906
|
+
e[4].w)) && h(t, "width", s), (!N || M & /*geom*/
|
|
1912
1907
|
16 && r !== (r = /*geom*/
|
|
1913
|
-
e[4].h)) && h(t, "height", r), (!N ||
|
|
1908
|
+
e[4].h)) && h(t, "height", r), (!N || M & /*computedStyle*/
|
|
1914
1909
|
2) && h(
|
|
1915
1910
|
a,
|
|
1916
1911
|
"style",
|
|
1917
1912
|
/*computedStyle*/
|
|
1918
1913
|
e[1]
|
|
1919
|
-
), (!N ||
|
|
1914
|
+
), (!N || M & /*geom*/
|
|
1920
1915
|
16 && c !== (c = /*geom*/
|
|
1921
|
-
e[4].x)) && h(a, "x", c), (!N ||
|
|
1916
|
+
e[4].x)) && h(a, "x", c), (!N || M & /*geom*/
|
|
1922
1917
|
16 && u !== (u = /*geom*/
|
|
1923
|
-
e[4].y)) && h(a, "y", u), (!N ||
|
|
1918
|
+
e[4].y)) && h(a, "y", u), (!N || M & /*geom*/
|
|
1924
1919
|
16 && f !== (f = /*geom*/
|
|
1925
|
-
e[4].w)) && h(a, "width", f), (!N ||
|
|
1920
|
+
e[4].w)) && h(a, "width", f), (!N || M & /*geom*/
|
|
1926
1921
|
16 && d !== (d = /*geom*/
|
|
1927
|
-
e[4].h)) && h(a, "height", d), (!N ||
|
|
1922
|
+
e[4].h)) && h(a, "height", d), (!N || M & /*geom*/
|
|
1928
1923
|
16 && y !== (y = /*geom*/
|
|
1929
|
-
e[4].x)) && h(m, "x", y), (!N ||
|
|
1930
|
-
16 &&
|
|
1931
|
-
e[4].y)) && h(m, "y",
|
|
1924
|
+
e[4].x)) && h(m, "x", y), (!N || M & /*geom*/
|
|
1925
|
+
16 && w !== (w = /*geom*/
|
|
1926
|
+
e[4].y)) && h(m, "y", w), (!N || M & /*geom*/
|
|
1932
1927
|
16 && p !== (p = /*geom*/
|
|
1933
|
-
e[4].w)) && h(m, "width", p), (!N ||
|
|
1928
|
+
e[4].w)) && h(m, "width", p), (!N || M & /*geom*/
|
|
1934
1929
|
16 && E !== (E = /*geom*/
|
|
1935
1930
|
e[4].x + /*geom*/
|
|
1936
|
-
e[4].w)) && h(_, "x", E), (!N ||
|
|
1931
|
+
e[4].w)) && h(_, "x", E), (!N || M & /*geom*/
|
|
1937
1932
|
16 && B !== (B = /*geom*/
|
|
1938
|
-
e[4].y)) && h(_, "y", B), (!N ||
|
|
1933
|
+
e[4].y)) && h(_, "y", B), (!N || M & /*geom*/
|
|
1939
1934
|
16 && V !== (V = /*geom*/
|
|
1940
|
-
e[4].h)) && h(_, "height", V), (!N ||
|
|
1935
|
+
e[4].h)) && h(_, "height", V), (!N || M & /*geom*/
|
|
1941
1936
|
16 && Y !== (Y = /*geom*/
|
|
1942
|
-
e[4].x)) && h(R, "x", Y), (!N ||
|
|
1943
|
-
16 &&
|
|
1937
|
+
e[4].x)) && h(R, "x", Y), (!N || M & /*geom*/
|
|
1938
|
+
16 && b !== (b = /*geom*/
|
|
1944
1939
|
e[4].y + /*geom*/
|
|
1945
|
-
e[4].h)) && h(R, "y",
|
|
1940
|
+
e[4].h)) && h(R, "y", b), (!N || M & /*geom*/
|
|
1946
1941
|
16 && S !== (S = /*geom*/
|
|
1947
|
-
e[4].w)) && h(R, "width", S), (!N ||
|
|
1942
|
+
e[4].w)) && h(R, "width", S), (!N || M & /*geom*/
|
|
1948
1943
|
16 && P !== (P = /*geom*/
|
|
1949
|
-
e[4].x)) && h(
|
|
1944
|
+
e[4].x)) && h(v, "x", P), (!N || M & /*geom*/
|
|
1950
1945
|
16 && G !== (G = /*geom*/
|
|
1951
|
-
e[4].y)) && h(
|
|
1946
|
+
e[4].y)) && h(v, "y", G), (!N || M & /*geom*/
|
|
1952
1947
|
16 && x !== (x = /*geom*/
|
|
1953
|
-
e[4].h)) && h(
|
|
1948
|
+
e[4].h)) && h(v, "height", x);
|
|
1954
1949
|
const De = {};
|
|
1955
|
-
|
|
1950
|
+
M & /*geom*/
|
|
1956
1951
|
16 && (De.x = /*geom*/
|
|
1957
|
-
e[4].x),
|
|
1952
|
+
e[4].x), M & /*geom*/
|
|
1958
1953
|
16 && (De.y = /*geom*/
|
|
1959
|
-
e[4].y),
|
|
1954
|
+
e[4].y), M & /*viewportScale*/
|
|
1960
1955
|
8 && (De.scale = /*viewportScale*/
|
|
1961
1956
|
e[3]), se.$set(De);
|
|
1962
|
-
const Xe = {};
|
|
1963
|
-
v & /*geom*/
|
|
1964
|
-
16 && (Xe.x = /*geom*/
|
|
1965
|
-
e[4].x + /*geom*/
|
|
1966
|
-
e[4].w), v & /*geom*/
|
|
1967
|
-
16 && (Xe.y = /*geom*/
|
|
1968
|
-
e[4].y), v & /*viewportScale*/
|
|
1969
|
-
8 && (Xe.scale = /*viewportScale*/
|
|
1970
|
-
e[3]), L.$set(Xe);
|
|
1971
1957
|
const Ce = {};
|
|
1972
|
-
|
|
1958
|
+
M & /*geom*/
|
|
1973
1959
|
16 && (Ce.x = /*geom*/
|
|
1974
1960
|
e[4].x + /*geom*/
|
|
1975
|
-
e[4].w),
|
|
1961
|
+
e[4].w), M & /*geom*/
|
|
1976
1962
|
16 && (Ce.y = /*geom*/
|
|
1977
|
-
e[4].y
|
|
1978
|
-
e[4].h), v & /*viewportScale*/
|
|
1963
|
+
e[4].y), M & /*viewportScale*/
|
|
1979
1964
|
8 && (Ce.scale = /*viewportScale*/
|
|
1980
|
-
e[3]),
|
|
1965
|
+
e[3]), L.$set(Ce);
|
|
1966
|
+
const Xe = {};
|
|
1967
|
+
M & /*geom*/
|
|
1968
|
+
16 && (Xe.x = /*geom*/
|
|
1969
|
+
e[4].x + /*geom*/
|
|
1970
|
+
e[4].w), M & /*geom*/
|
|
1971
|
+
16 && (Xe.y = /*geom*/
|
|
1972
|
+
e[4].y + /*geom*/
|
|
1973
|
+
e[4].h), M & /*viewportScale*/
|
|
1974
|
+
8 && (Xe.scale = /*viewportScale*/
|
|
1975
|
+
e[3]), z.$set(Xe);
|
|
1981
1976
|
const Re = {};
|
|
1982
|
-
|
|
1977
|
+
M & /*geom*/
|
|
1983
1978
|
16 && (Re.x = /*geom*/
|
|
1984
|
-
e[4].x),
|
|
1979
|
+
e[4].x), M & /*geom*/
|
|
1985
1980
|
16 && (Re.y = /*geom*/
|
|
1986
1981
|
e[4].y + /*geom*/
|
|
1987
|
-
e[4].h),
|
|
1982
|
+
e[4].h), M & /*viewportScale*/
|
|
1988
1983
|
8 && (Re.scale = /*viewportScale*/
|
|
1989
1984
|
e[3]), Z.$set(Re);
|
|
1990
1985
|
},
|
|
@@ -1992,16 +1987,16 @@ function vo(e) {
|
|
|
1992
1987
|
N || (I(se.$$.fragment, D), I(L.$$.fragment, D), I(z.$$.fragment, D), I(Z.$$.fragment, D), N = !0);
|
|
1993
1988
|
},
|
|
1994
1989
|
o(D) {
|
|
1995
|
-
|
|
1990
|
+
C(se.$$.fragment, D), C(L.$$.fragment, D), C(z.$$.fragment, D), C(Z.$$.fragment, D), N = !1;
|
|
1996
1991
|
},
|
|
1997
1992
|
d(D) {
|
|
1998
|
-
D && (k(t), k(l), k(a), k(g), k(m), k(A), k(_), k(U), k(R), k(T), k(
|
|
1993
|
+
D && (k(t), k(l), k(a), k(g), k(m), k(A), k(_), k(U), k(R), k(T), k(v), k(ve), k(Me), k(Q), k(ue)), ee(se, D), ee(L, D), ee(z, D), ee(Z, D), qe = !1, ce(ht);
|
|
1999
1994
|
}
|
|
2000
1995
|
};
|
|
2001
1996
|
}
|
|
2002
|
-
function
|
|
1997
|
+
function Oo(e) {
|
|
2003
1998
|
let t, n;
|
|
2004
|
-
return t = new
|
|
1999
|
+
return t = new en({
|
|
2005
2000
|
props: {
|
|
2006
2001
|
shape: (
|
|
2007
2002
|
/*shape*/
|
|
@@ -2017,7 +2012,7 @@ function Lo(e) {
|
|
|
2017
2012
|
),
|
|
2018
2013
|
$$slots: {
|
|
2019
2014
|
default: [
|
|
2020
|
-
|
|
2015
|
+
ko,
|
|
2021
2016
|
({ grab: o }) => ({ 9: o }),
|
|
2022
2017
|
({ grab: o }) => o ? 512 : 0
|
|
2023
2018
|
]
|
|
@@ -2056,21 +2051,21 @@ function Lo(e) {
|
|
|
2056
2051
|
n || (I(t.$$.fragment, o), n = !0);
|
|
2057
2052
|
},
|
|
2058
2053
|
o(o) {
|
|
2059
|
-
|
|
2054
|
+
C(t.$$.fragment, o), n = !1;
|
|
2060
2055
|
},
|
|
2061
2056
|
d(o) {
|
|
2062
2057
|
ee(t, o);
|
|
2063
2058
|
}
|
|
2064
2059
|
};
|
|
2065
2060
|
}
|
|
2066
|
-
function
|
|
2061
|
+
function Bo(e, t, n) {
|
|
2067
2062
|
let o, { shape: i } = t, { computedStyle: s } = t, { transform: r } = t, { viewportScale: l = 1 } = t;
|
|
2068
2063
|
const a = (d, g, m) => {
|
|
2069
2064
|
const y = d.geometry.bounds;
|
|
2070
|
-
let [
|
|
2065
|
+
let [w, p] = [y.minX, y.minY], [A, _] = [y.maxX, y.maxY];
|
|
2071
2066
|
const [E, B] = m;
|
|
2072
2067
|
if (g === "SHAPE")
|
|
2073
|
-
|
|
2068
|
+
w += E, A += E, p += B, _ += B;
|
|
2074
2069
|
else {
|
|
2075
2070
|
switch (g) {
|
|
2076
2071
|
case "TOP":
|
|
@@ -2090,7 +2085,7 @@ function ko(e, t, n) {
|
|
|
2090
2085
|
case "LEFT":
|
|
2091
2086
|
case "TOP_LEFT":
|
|
2092
2087
|
case "BOTTOM_LEFT": {
|
|
2093
|
-
|
|
2088
|
+
w += E;
|
|
2094
2089
|
break;
|
|
2095
2090
|
}
|
|
2096
2091
|
case "RIGHT":
|
|
@@ -2101,7 +2096,7 @@ function ko(e, t, n) {
|
|
|
2101
2096
|
}
|
|
2102
2097
|
}
|
|
2103
2098
|
}
|
|
2104
|
-
const V = Math.min(
|
|
2099
|
+
const V = Math.min(w, A), U = Math.min(p, _), R = Math.abs(A - w), Y = Math.abs(_ - p);
|
|
2105
2100
|
return {
|
|
2106
2101
|
...d,
|
|
2107
2102
|
geometry: {
|
|
@@ -2144,9 +2139,9 @@ function ko(e, t, n) {
|
|
|
2144
2139
|
f
|
|
2145
2140
|
];
|
|
2146
2141
|
}
|
|
2147
|
-
class
|
|
2142
|
+
class Io extends oe {
|
|
2148
2143
|
constructor(t) {
|
|
2149
|
-
super(), ne(this, t,
|
|
2144
|
+
super(), ne(this, t, Bo, Oo, J, {
|
|
2150
2145
|
shape: 0,
|
|
2151
2146
|
computedStyle: 1,
|
|
2152
2147
|
transform: 2,
|
|
@@ -2154,28 +2149,28 @@ class Oo extends oe {
|
|
|
2154
2149
|
});
|
|
2155
2150
|
}
|
|
2156
2151
|
}
|
|
2157
|
-
const
|
|
2158
|
-
[q.RECTANGLE,
|
|
2159
|
-
[q.POLYGON,
|
|
2160
|
-
]),
|
|
2152
|
+
const $t = /* @__PURE__ */ new Map([
|
|
2153
|
+
[q.RECTANGLE, Io],
|
|
2154
|
+
[q.POLYGON, wo]
|
|
2155
|
+
]), Po = (e) => $t.get(e.type), Yo = (e, t) => $t.set(e, t), Do = (e) => ({}), Mt = (e) => ({ grab: (
|
|
2161
2156
|
/*onGrab*/
|
|
2162
2157
|
e[0]
|
|
2163
2158
|
) });
|
|
2164
|
-
function
|
|
2159
|
+
function Co(e) {
|
|
2165
2160
|
let t, n, o, i;
|
|
2166
2161
|
const s = (
|
|
2167
2162
|
/*#slots*/
|
|
2168
2163
|
e[7].default
|
|
2169
|
-
), r =
|
|
2164
|
+
), r = cn(
|
|
2170
2165
|
s,
|
|
2171
2166
|
e,
|
|
2172
2167
|
/*$$scope*/
|
|
2173
2168
|
e[6],
|
|
2174
|
-
|
|
2169
|
+
Mt
|
|
2175
2170
|
);
|
|
2176
2171
|
return {
|
|
2177
2172
|
c() {
|
|
2178
|
-
t =
|
|
2173
|
+
t = X("g"), r && r.c(), h(t, "class", "a9s-annotation selected");
|
|
2179
2174
|
},
|
|
2180
2175
|
m(l, a) {
|
|
2181
2176
|
O(l, t, a), r && r.m(t, null), n = !0, o || (i = [
|
|
@@ -2195,45 +2190,45 @@ function Yo(e) {
|
|
|
2195
2190
|
},
|
|
2196
2191
|
p(l, [a]) {
|
|
2197
2192
|
r && r.p && (!n || a & /*$$scope*/
|
|
2198
|
-
64) &&
|
|
2193
|
+
64) && un(
|
|
2199
2194
|
r,
|
|
2200
2195
|
s,
|
|
2201
2196
|
l,
|
|
2202
2197
|
/*$$scope*/
|
|
2203
2198
|
l[6],
|
|
2204
|
-
n ?
|
|
2199
|
+
n ? fn(
|
|
2205
2200
|
s,
|
|
2206
2201
|
/*$$scope*/
|
|
2207
2202
|
l[6],
|
|
2208
2203
|
a,
|
|
2209
|
-
|
|
2210
|
-
) :
|
|
2204
|
+
Do
|
|
2205
|
+
) : dn(
|
|
2211
2206
|
/*$$scope*/
|
|
2212
2207
|
l[6]
|
|
2213
2208
|
),
|
|
2214
|
-
|
|
2209
|
+
Mt
|
|
2215
2210
|
);
|
|
2216
2211
|
},
|
|
2217
2212
|
i(l) {
|
|
2218
2213
|
n || (I(r, l), n = !0);
|
|
2219
2214
|
},
|
|
2220
2215
|
o(l) {
|
|
2221
|
-
|
|
2216
|
+
C(r, l), n = !1;
|
|
2222
2217
|
},
|
|
2223
2218
|
d(l) {
|
|
2224
2219
|
l && k(t), r && r.d(l), o = !1, ce(i);
|
|
2225
2220
|
}
|
|
2226
2221
|
};
|
|
2227
2222
|
}
|
|
2228
|
-
function
|
|
2223
|
+
function Xo(e, t, n) {
|
|
2229
2224
|
let { $$slots: o = {}, $$scope: i } = t;
|
|
2230
2225
|
const s = Te();
|
|
2231
2226
|
let { shape: r } = t, { editor: l } = t, { transform: a } = t, c, u, f;
|
|
2232
|
-
const d = (y) => (
|
|
2233
|
-
c = y, u = a.elementToImage(
|
|
2227
|
+
const d = (y) => (w) => {
|
|
2228
|
+
c = y, u = a.elementToImage(w.offsetX, w.offsetY), f = r, w.target.setPointerCapture(w.pointerId), s("grab", w);
|
|
2234
2229
|
}, g = (y) => {
|
|
2235
2230
|
if (c) {
|
|
2236
|
-
const [
|
|
2231
|
+
const [w, p] = a.elementToImage(y.offsetX, y.offsetY), A = [w - u[0], p - u[1]];
|
|
2237
2232
|
n(3, r = l(f, c, A)), s("change", r);
|
|
2238
2233
|
}
|
|
2239
2234
|
}, m = (y) => {
|
|
@@ -2243,9 +2238,9 @@ function Do(e, t, n) {
|
|
|
2243
2238
|
"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);
|
|
2244
2239
|
}, [d, g, m, r, l, a, i, o];
|
|
2245
2240
|
}
|
|
2246
|
-
class
|
|
2241
|
+
class en extends oe {
|
|
2247
2242
|
constructor(t) {
|
|
2248
|
-
super(), ne(this, t,
|
|
2243
|
+
super(), ne(this, t, Xo, Co, J, { shape: 3, editor: 4, transform: 5 });
|
|
2249
2244
|
}
|
|
2250
2245
|
}
|
|
2251
2246
|
const je = (e, t) => {
|
|
@@ -2256,7 +2251,7 @@ const je = (e, t) => {
|
|
|
2256
2251
|
return o && (s += `fill:${o};stroke:${o};`), s += `fill-opacity:${i || "0.25"};`, s;
|
|
2257
2252
|
}
|
|
2258
2253
|
};
|
|
2259
|
-
function
|
|
2254
|
+
function Ro(e, t, n) {
|
|
2260
2255
|
let o;
|
|
2261
2256
|
const i = Te();
|
|
2262
2257
|
let { annotation: s } = t, { editor: r } = t, { style: l } = t, { target: a } = t, { transform: c } = t, { viewportScale: u } = t, f;
|
|
@@ -2282,9 +2277,9 @@ function Xo(e, t, n) {
|
|
|
2282
2277
|
96 && f && f.$set({ viewportScale: u });
|
|
2283
2278
|
}, [s, r, l, a, c, u, f];
|
|
2284
2279
|
}
|
|
2285
|
-
class
|
|
2280
|
+
class No extends oe {
|
|
2286
2281
|
constructor(t) {
|
|
2287
|
-
super(), ne(this, t,
|
|
2282
|
+
super(), ne(this, t, Ro, null, J, {
|
|
2288
2283
|
annotation: 0,
|
|
2289
2284
|
editor: 1,
|
|
2290
2285
|
style: 2,
|
|
@@ -2294,7 +2289,7 @@ class Co extends oe {
|
|
|
2294
2289
|
});
|
|
2295
2290
|
}
|
|
2296
2291
|
}
|
|
2297
|
-
function
|
|
2292
|
+
function Uo(e, t, n) {
|
|
2298
2293
|
const o = Te();
|
|
2299
2294
|
let { drawingMode: i } = t, { target: s } = t, { tool: r } = t, { transform: l } = t, { viewportScale: a } = t, c;
|
|
2300
2295
|
return Ye(() => {
|
|
@@ -2320,9 +2315,9 @@ function Ro(e, t, n) {
|
|
|
2320
2315
|
48 && c && c.$set({ viewportScale: a });
|
|
2321
2316
|
}, [i, s, r, l, a, c];
|
|
2322
2317
|
}
|
|
2323
|
-
class
|
|
2318
|
+
class Vo extends oe {
|
|
2324
2319
|
constructor(t) {
|
|
2325
|
-
super(), ne(this, t,
|
|
2320
|
+
super(), ne(this, t, Uo, null, J, {
|
|
2326
2321
|
drawingMode: 0,
|
|
2327
2322
|
target: 1,
|
|
2328
2323
|
tool: 2,
|
|
@@ -2331,11 +2326,11 @@ class No extends oe {
|
|
|
2331
2326
|
});
|
|
2332
2327
|
}
|
|
2333
2328
|
}
|
|
2334
|
-
function
|
|
2329
|
+
function Lt(e) {
|
|
2335
2330
|
let t, n;
|
|
2336
2331
|
return {
|
|
2337
2332
|
c() {
|
|
2338
|
-
t =
|
|
2333
|
+
t = X("rect"), n = X("rect"), h(t, "class", "a9s-outer"), h(
|
|
2339
2334
|
t,
|
|
2340
2335
|
"x",
|
|
2341
2336
|
/*x*/
|
|
@@ -2436,21 +2431,21 @@ function Tt(e) {
|
|
|
2436
2431
|
}
|
|
2437
2432
|
};
|
|
2438
2433
|
}
|
|
2439
|
-
function
|
|
2434
|
+
function Go(e) {
|
|
2440
2435
|
let t, n = (
|
|
2441
2436
|
/*origin*/
|
|
2442
|
-
e[0] &&
|
|
2437
|
+
e[0] && Lt(e)
|
|
2443
2438
|
);
|
|
2444
2439
|
return {
|
|
2445
2440
|
c() {
|
|
2446
|
-
t =
|
|
2441
|
+
t = X("g"), n && n.c(), h(t, "class", "a9s-annotation a9s-rubberband");
|
|
2447
2442
|
},
|
|
2448
2443
|
m(o, i) {
|
|
2449
2444
|
O(o, t, i), n && n.m(t, null);
|
|
2450
2445
|
},
|
|
2451
2446
|
p(o, [i]) {
|
|
2452
2447
|
/*origin*/
|
|
2453
|
-
o[0] ? n ? n.p(o, i) : (n =
|
|
2448
|
+
o[0] ? n ? n.p(o, i) : (n = Lt(o), n.c(), n.m(t, null)) : n && (n.d(1), n = null);
|
|
2454
2449
|
},
|
|
2455
2450
|
i: F,
|
|
2456
2451
|
o: F,
|
|
@@ -2459,7 +2454,7 @@ function Uo(e) {
|
|
|
2459
2454
|
}
|
|
2460
2455
|
};
|
|
2461
2456
|
}
|
|
2462
|
-
function
|
|
2457
|
+
function zo(e, t, n) {
|
|
2463
2458
|
const o = Te();
|
|
2464
2459
|
let { addEventListener: i } = t, { drawingMode: s } = t, { transform: r } = t, l, a, c, u, f, d, g;
|
|
2465
2460
|
const m = (A) => {
|
|
@@ -2468,14 +2463,12 @@ function Vo(e, t, n) {
|
|
|
2468
2463
|
}, y = (A) => {
|
|
2469
2464
|
const _ = A;
|
|
2470
2465
|
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
|
-
},
|
|
2466
|
+
}, w = (A) => {
|
|
2472
2467
|
const _ = A, E = performance.now() - l;
|
|
2473
2468
|
if (s === "click") {
|
|
2474
|
-
if (E > 300)
|
|
2475
|
-
return;
|
|
2469
|
+
if (E > 300) return;
|
|
2476
2470
|
_.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));
|
|
2477
|
-
} else
|
|
2478
|
-
a && (E > 300 || d * g > 100 ? (_.stopPropagation(), p()) : (n(0, a = void 0), c = void 0));
|
|
2471
|
+
} else a && (E > 300 || d * g > 100 ? (_.stopPropagation(), p()) : (n(0, a = void 0), c = void 0));
|
|
2479
2472
|
}, p = () => {
|
|
2480
2473
|
if (d * g > 15) {
|
|
2481
2474
|
const A = {
|
|
@@ -2498,21 +2491,21 @@ function Vo(e, t, n) {
|
|
|
2498
2491
|
n(0, a = void 0), c = void 0;
|
|
2499
2492
|
};
|
|
2500
2493
|
return Ye(() => {
|
|
2501
|
-
i("pointerdown", m), i("pointermove", y), i("pointerup",
|
|
2494
|
+
i("pointerdown", m), i("pointermove", y), i("pointerup", w, !0);
|
|
2502
2495
|
}), e.$$set = (A) => {
|
|
2503
2496
|
"addEventListener" in A && n(5, i = A.addEventListener), "drawingMode" in A && n(6, s = A.drawingMode), "transform" in A && n(7, r = A.transform);
|
|
2504
2497
|
}, [a, u, f, d, g, i, s, r];
|
|
2505
2498
|
}
|
|
2506
|
-
class
|
|
2499
|
+
class Ho extends oe {
|
|
2507
2500
|
constructor(t) {
|
|
2508
|
-
super(), ne(this, t,
|
|
2501
|
+
super(), ne(this, t, zo, Go, J, {
|
|
2509
2502
|
addEventListener: 5,
|
|
2510
2503
|
drawingMode: 6,
|
|
2511
2504
|
transform: 7
|
|
2512
2505
|
});
|
|
2513
2506
|
}
|
|
2514
2507
|
}
|
|
2515
|
-
function
|
|
2508
|
+
function et(e) {
|
|
2516
2509
|
const t = e.slice(), n = (
|
|
2517
2510
|
/*isClosable*/
|
|
2518
2511
|
(t[2] ? (
|
|
@@ -2527,14 +2520,14 @@ function xe(e) {
|
|
|
2527
2520
|
);
|
|
2528
2521
|
return t[16] = n, t;
|
|
2529
2522
|
}
|
|
2530
|
-
function
|
|
2523
|
+
function kt(e) {
|
|
2531
2524
|
let t, n, o, i, s, r = (
|
|
2532
2525
|
/*isClosable*/
|
|
2533
|
-
e[2] &&
|
|
2526
|
+
e[2] && Ot(e)
|
|
2534
2527
|
);
|
|
2535
2528
|
return {
|
|
2536
2529
|
c() {
|
|
2537
|
-
t =
|
|
2530
|
+
t = X("polygon"), o = X("polygon"), r && r.c(), s = fe(), h(t, "class", "a9s-outer"), h(t, "points", n = /*coords*/
|
|
2538
2531
|
e[16]), h(o, "class", "a9s-inner"), h(o, "points", i = /*coords*/
|
|
2539
2532
|
e[16]);
|
|
2540
2533
|
},
|
|
@@ -2547,18 +2540,18 @@ function Mt(e) {
|
|
|
2547
2540
|
l[16]) && h(t, "points", n), a & /*isClosable, points, cursor*/
|
|
2548
2541
|
7 && i !== (i = /*coords*/
|
|
2549
2542
|
l[16]) && h(o, "points", i), /*isClosable*/
|
|
2550
|
-
l[2] ? r ? r.p(l, a) : (r =
|
|
2543
|
+
l[2] ? r ? r.p(l, a) : (r = Ot(l), r.c(), r.m(s.parentNode, s)) : r && (r.d(1), r = null);
|
|
2551
2544
|
},
|
|
2552
2545
|
d(l) {
|
|
2553
2546
|
l && (k(t), k(o), k(s)), r && r.d(l);
|
|
2554
2547
|
}
|
|
2555
2548
|
};
|
|
2556
2549
|
}
|
|
2557
|
-
function
|
|
2550
|
+
function Ot(e) {
|
|
2558
2551
|
let t, n, o;
|
|
2559
2552
|
return {
|
|
2560
2553
|
c() {
|
|
2561
|
-
t =
|
|
2554
|
+
t = X("rect"), h(t, "class", "a9s-corner-handle"), h(t, "x", n = /*points*/
|
|
2562
2555
|
e[0][0][0] - /*handleSize*/
|
|
2563
2556
|
e[3] / 2), h(t, "y", o = /*points*/
|
|
2564
2557
|
e[0][0][1] - /*handleSize*/
|
|
@@ -2603,21 +2596,21 @@ function vt(e) {
|
|
|
2603
2596
|
}
|
|
2604
2597
|
};
|
|
2605
2598
|
}
|
|
2606
|
-
function
|
|
2599
|
+
function Fo(e) {
|
|
2607
2600
|
let t, n = (
|
|
2608
2601
|
/*cursor*/
|
|
2609
|
-
e[1] &&
|
|
2602
|
+
e[1] && kt(et(e))
|
|
2610
2603
|
);
|
|
2611
2604
|
return {
|
|
2612
2605
|
c() {
|
|
2613
|
-
t =
|
|
2606
|
+
t = X("g"), n && n.c(), h(t, "class", "a9s-annotation a9s-rubberband");
|
|
2614
2607
|
},
|
|
2615
2608
|
m(o, i) {
|
|
2616
2609
|
O(o, t, i), n && n.m(t, null);
|
|
2617
2610
|
},
|
|
2618
2611
|
p(o, [i]) {
|
|
2619
2612
|
/*cursor*/
|
|
2620
|
-
o[1] ? n ? n.p(
|
|
2613
|
+
o[1] ? n ? n.p(et(o), i) : (n = kt(et(o)), n.c(), n.m(t, null)) : n && (n.d(1), n = null);
|
|
2621
2614
|
},
|
|
2622
2615
|
i: F,
|
|
2623
2616
|
o: F,
|
|
@@ -2626,8 +2619,8 @@ function zo(e) {
|
|
|
2626
2619
|
}
|
|
2627
2620
|
};
|
|
2628
2621
|
}
|
|
2629
|
-
const
|
|
2630
|
-
function
|
|
2622
|
+
const jo = 20, qo = 1500;
|
|
2623
|
+
function Ko(e, t, n) {
|
|
2631
2624
|
let o;
|
|
2632
2625
|
const i = Te();
|
|
2633
2626
|
let { addEventListener: s } = t, { drawingMode: r } = t, { transform: l } = t, { viewportScale: a = 1 } = t, c, u = [], f, d, g = !1;
|
|
@@ -2641,22 +2634,21 @@ function jo(e, t, n) {
|
|
|
2641
2634
|
const E = _;
|
|
2642
2635
|
if (d && clearTimeout(d), u.length > 0) {
|
|
2643
2636
|
if (n(1, f = l.elementToImage(E.offsetX, E.offsetY)), u.length > 2) {
|
|
2644
|
-
const B =
|
|
2645
|
-
n(2, g = B <
|
|
2637
|
+
const B = $e(f, u[0]) * a;
|
|
2638
|
+
n(2, g = B < jo);
|
|
2646
2639
|
}
|
|
2647
2640
|
E.pointerType === "touch" && (d = setTimeout(
|
|
2648
2641
|
() => {
|
|
2649
2642
|
p();
|
|
2650
2643
|
},
|
|
2651
|
-
|
|
2644
|
+
qo
|
|
2652
2645
|
));
|
|
2653
2646
|
}
|
|
2654
|
-
},
|
|
2647
|
+
}, w = (_) => {
|
|
2655
2648
|
const E = _;
|
|
2656
2649
|
if (d && clearTimeout(d), r === "click") {
|
|
2657
|
-
const B = E.timeStamp - c.timeStamp, V =
|
|
2658
|
-
if (B > 300 || V > 15)
|
|
2659
|
-
return;
|
|
2650
|
+
const B = E.timeStamp - c.timeStamp, V = $e([c.offsetX, c.offsetY], [E.offsetX, E.offsetY]);
|
|
2651
|
+
if (B > 300 || V > 15) return;
|
|
2660
2652
|
if (g)
|
|
2661
2653
|
A();
|
|
2662
2654
|
else if (u.length === 0) {
|
|
@@ -2665,20 +2657,19 @@ function jo(e, t, n) {
|
|
|
2665
2657
|
} else
|
|
2666
2658
|
u.push(f);
|
|
2667
2659
|
} else {
|
|
2668
|
-
if (u.length === 1 &&
|
|
2660
|
+
if (u.length === 1 && $e(u[0], f) <= 4) {
|
|
2669
2661
|
n(0, u = []), n(1, f = void 0);
|
|
2670
2662
|
return;
|
|
2671
2663
|
}
|
|
2672
2664
|
E.stopImmediatePropagation(), g ? A() : u.push(f);
|
|
2673
2665
|
}
|
|
2674
2666
|
}, p = () => {
|
|
2675
|
-
if (!f)
|
|
2676
|
-
return;
|
|
2667
|
+
if (!f) return;
|
|
2677
2668
|
const _ = [...u, f], E = {
|
|
2678
2669
|
type: q.POLYGON,
|
|
2679
2670
|
geometry: { bounds: Fe(_), points: _ }
|
|
2680
2671
|
};
|
|
2681
|
-
|
|
2672
|
+
lt(E) > 4 && (n(0, u = []), n(1, f = void 0), i("create", E));
|
|
2682
2673
|
}, A = () => {
|
|
2683
2674
|
const _ = {
|
|
2684
2675
|
type: q.POLYGON,
|
|
@@ -2690,7 +2681,7 @@ function jo(e, t, n) {
|
|
|
2690
2681
|
n(0, u = []), n(1, f = void 0), i("create", _);
|
|
2691
2682
|
};
|
|
2692
2683
|
return Ye(() => {
|
|
2693
|
-
s("pointerdown", m, !0), s("pointermove", y), s("pointerup",
|
|
2684
|
+
s("pointerdown", m, !0), s("pointermove", y), s("pointerup", w, !0), s("dblclick", p, !0);
|
|
2694
2685
|
}), e.$$set = (_) => {
|
|
2695
2686
|
"addEventListener" in _ && n(4, s = _.addEventListener), "drawingMode" in _ && n(5, r = _.drawingMode), "transform" in _ && n(6, l = _.transform), "viewportScale" in _ && n(7, a = _.viewportScale);
|
|
2696
2687
|
}, e.$$.update = () => {
|
|
@@ -2707,9 +2698,9 @@ function jo(e, t, n) {
|
|
|
2707
2698
|
a
|
|
2708
2699
|
];
|
|
2709
2700
|
}
|
|
2710
|
-
class
|
|
2701
|
+
class Wo extends oe {
|
|
2711
2702
|
constructor(t) {
|
|
2712
|
-
super(), ne(this, t,
|
|
2703
|
+
super(), ne(this, t, Ko, Fo, J, {
|
|
2713
2704
|
addEventListener: 4,
|
|
2714
2705
|
drawingMode: 5,
|
|
2715
2706
|
transform: 6,
|
|
@@ -2717,15 +2708,15 @@ class qo extends oe {
|
|
|
2717
2708
|
});
|
|
2718
2709
|
}
|
|
2719
2710
|
}
|
|
2720
|
-
const
|
|
2721
|
-
["rectangle", { tool:
|
|
2722
|
-
["polygon", { tool:
|
|
2723
|
-
]),
|
|
2724
|
-
function
|
|
2711
|
+
const dt = /* @__PURE__ */ new Map([
|
|
2712
|
+
["rectangle", { tool: Ho }],
|
|
2713
|
+
["polygon", { tool: Wo }]
|
|
2714
|
+
]), tn = () => [...dt.keys()], nn = (e) => dt.get(e), Jo = (e, t, n) => dt.set(e, { tool: t, opts: n });
|
|
2715
|
+
function Qo(e) {
|
|
2725
2716
|
let t, n, o, i, s;
|
|
2726
2717
|
return {
|
|
2727
2718
|
c() {
|
|
2728
|
-
t =
|
|
2719
|
+
t = X("g"), n = X("ellipse"), i = X("ellipse"), h(n, "class", "a9s-outer"), h(n, "style", o = /*computedStyle*/
|
|
2729
2720
|
e[1] ? "display:none;" : void 0), h(
|
|
2730
2721
|
n,
|
|
2731
2722
|
"cx",
|
|
@@ -2797,7 +2788,7 @@ function Wo(e) {
|
|
|
2797
2788
|
}
|
|
2798
2789
|
};
|
|
2799
2790
|
}
|
|
2800
|
-
function
|
|
2791
|
+
function Zo(e, t, n) {
|
|
2801
2792
|
let o, { annotation: i } = t, { geom: s } = t, { style: r } = t;
|
|
2802
2793
|
const { cx: l, cy: a, rx: c, ry: u } = s;
|
|
2803
2794
|
return e.$$set = (f) => {
|
|
@@ -2807,21 +2798,21 @@ function Jo(e, t, n) {
|
|
|
2807
2798
|
129 && n(1, o = je(i, r));
|
|
2808
2799
|
}, [i, o, l, a, c, u, s, r];
|
|
2809
2800
|
}
|
|
2810
|
-
class
|
|
2801
|
+
class xo extends oe {
|
|
2811
2802
|
constructor(t) {
|
|
2812
|
-
super(), ne(this, t,
|
|
2803
|
+
super(), ne(this, t, Zo, Qo, J, { annotation: 0, geom: 6, style: 7 });
|
|
2813
2804
|
}
|
|
2814
2805
|
}
|
|
2815
|
-
function
|
|
2806
|
+
function $o(e) {
|
|
2816
2807
|
let t, n, o, i, s;
|
|
2817
2808
|
return {
|
|
2818
2809
|
c() {
|
|
2819
|
-
t =
|
|
2810
|
+
t = X("g"), n = X("polygon"), i = X("polygon"), h(n, "class", "a9s-outer"), h(n, "style", o = /*computedStyle*/
|
|
2820
2811
|
e[1] ? "display:none;" : void 0), h(
|
|
2821
2812
|
n,
|
|
2822
2813
|
"points",
|
|
2823
2814
|
/*points*/
|
|
2824
|
-
e[2].map(
|
|
2815
|
+
e[2].map(ei).join(" ")
|
|
2825
2816
|
), h(i, "class", "a9s-inner"), h(
|
|
2826
2817
|
i,
|
|
2827
2818
|
"style",
|
|
@@ -2831,7 +2822,7 @@ function Zo(e) {
|
|
|
2831
2822
|
i,
|
|
2832
2823
|
"points",
|
|
2833
2824
|
/*points*/
|
|
2834
|
-
e[2].map(
|
|
2825
|
+
e[2].map(ti).join(" ")
|
|
2835
2826
|
), h(t, "data-id", s = /*annotation*/
|
|
2836
2827
|
e[0].id);
|
|
2837
2828
|
},
|
|
@@ -2858,8 +2849,8 @@ function Zo(e) {
|
|
|
2858
2849
|
}
|
|
2859
2850
|
};
|
|
2860
2851
|
}
|
|
2861
|
-
const
|
|
2862
|
-
function
|
|
2852
|
+
const ei = (e) => e.join(","), ti = (e) => e.join(",");
|
|
2853
|
+
function ni(e, t, n) {
|
|
2863
2854
|
let o, { annotation: i } = t, { geom: s } = t, { style: r } = t;
|
|
2864
2855
|
const { points: l } = s;
|
|
2865
2856
|
return e.$$set = (a) => {
|
|
@@ -2869,16 +2860,16 @@ function ei(e, t, n) {
|
|
|
2869
2860
|
17 && n(1, o = je(i, r));
|
|
2870
2861
|
}, [i, o, l, s, r];
|
|
2871
2862
|
}
|
|
2872
|
-
class
|
|
2863
|
+
class oi extends oe {
|
|
2873
2864
|
constructor(t) {
|
|
2874
|
-
super(), ne(this, t,
|
|
2865
|
+
super(), ne(this, t, ni, $o, J, { annotation: 0, geom: 3, style: 4 });
|
|
2875
2866
|
}
|
|
2876
2867
|
}
|
|
2877
|
-
function
|
|
2868
|
+
function ii(e) {
|
|
2878
2869
|
let t, n, o, i, s;
|
|
2879
2870
|
return {
|
|
2880
2871
|
c() {
|
|
2881
|
-
t =
|
|
2872
|
+
t = X("g"), n = X("rect"), i = X("rect"), h(n, "class", "a9s-outer"), h(n, "style", o = /*computedStyle*/
|
|
2882
2873
|
e[5] ? "display:none;" : void 0), h(
|
|
2883
2874
|
n,
|
|
2884
2875
|
"x",
|
|
@@ -2998,7 +2989,7 @@ function ni(e) {
|
|
|
2998
2989
|
}
|
|
2999
2990
|
};
|
|
3000
2991
|
}
|
|
3001
|
-
function
|
|
2992
|
+
function si(e, t, n) {
|
|
3002
2993
|
let o, i, s, r, l, { annotation: a } = t, { geom: c } = t, { style: u } = t;
|
|
3003
2994
|
return e.$$set = (f) => {
|
|
3004
2995
|
"annotation" in f && n(0, a = f.annotation), "geom" in f && n(6, c = f.geom), "style" in f && n(7, u = f.style);
|
|
@@ -3008,53 +2999,53 @@ function oi(e, t, n) {
|
|
|
3008
2999
|
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)));
|
|
3009
3000
|
}, [a, l, r, s, i, o, c, u];
|
|
3010
3001
|
}
|
|
3011
|
-
class
|
|
3002
|
+
class ri extends oe {
|
|
3012
3003
|
constructor(t) {
|
|
3013
|
-
super(), ne(this, t,
|
|
3004
|
+
super(), ne(this, t, si, ii, J, { annotation: 0, geom: 6, style: 7 });
|
|
3014
3005
|
}
|
|
3015
3006
|
}
|
|
3016
|
-
const
|
|
3007
|
+
const Xi = {
|
|
3017
3008
|
elementToImage: (e, t) => [e, t]
|
|
3018
|
-
},
|
|
3009
|
+
}, li = (e) => ({
|
|
3019
3010
|
elementToImage: (t, n) => {
|
|
3020
3011
|
const o = e.getBoundingClientRect(), i = e.createSVGPoint();
|
|
3021
3012
|
i.x = t + o.x, i.y = n + o.y;
|
|
3022
3013
|
const { x: s, y: r } = i.matrixTransform(e.getScreenCTM().inverse());
|
|
3023
3014
|
return [s, r];
|
|
3024
3015
|
}
|
|
3025
|
-
}),
|
|
3016
|
+
}), ai = 250, ci = (e, t) => {
|
|
3026
3017
|
const n = Te();
|
|
3027
3018
|
let o;
|
|
3028
3019
|
return { onPointerDown: () => o = performance.now(), onPointerUp: (r) => {
|
|
3029
|
-
if (performance.now() - o <
|
|
3030
|
-
const { x: a, y: c } =
|
|
3020
|
+
if (performance.now() - o < ai) {
|
|
3021
|
+
const { x: a, y: c } = fi(r, e), u = t.getAt(a, c);
|
|
3031
3022
|
u ? n("click", { originalEvent: r, annotation: u }) : n("click", { originalEvent: r });
|
|
3032
3023
|
}
|
|
3033
3024
|
} };
|
|
3034
|
-
},
|
|
3025
|
+
}, fi = (e, t) => {
|
|
3035
3026
|
const n = t.createSVGPoint(), o = t.getBoundingClientRect(), i = e.clientX - o.x, s = e.clientY - o.y, { left: r, top: l } = t.getBoundingClientRect();
|
|
3036
3027
|
return n.x = i + r, n.y = s + l, n.matrixTransform(t.getScreenCTM().inverse());
|
|
3037
|
-
}, { Boolean:
|
|
3038
|
-
function
|
|
3028
|
+
}, { Boolean: on } = hn;
|
|
3029
|
+
function Bt(e, t, n) {
|
|
3039
3030
|
const o = e.slice();
|
|
3040
3031
|
return o[31] = t[n], o;
|
|
3041
3032
|
}
|
|
3042
|
-
function
|
|
3033
|
+
function It(e, t, n) {
|
|
3043
3034
|
const o = e.slice();
|
|
3044
3035
|
return o[34] = t[n], o;
|
|
3045
3036
|
}
|
|
3046
|
-
function
|
|
3037
|
+
function tt(e) {
|
|
3047
3038
|
const t = e.slice(), n = (
|
|
3048
3039
|
/*annotation*/
|
|
3049
3040
|
t[34].target.selector
|
|
3050
3041
|
);
|
|
3051
3042
|
return t[37] = n, t;
|
|
3052
3043
|
}
|
|
3053
|
-
function
|
|
3044
|
+
function Pt(e) {
|
|
3054
3045
|
let t = (
|
|
3055
3046
|
/*annotation*/
|
|
3056
3047
|
e[34].id
|
|
3057
|
-
), n, o, i =
|
|
3048
|
+
), n, o, i = Yt(e);
|
|
3058
3049
|
return {
|
|
3059
3050
|
c() {
|
|
3060
3051
|
i.c(), n = fe();
|
|
@@ -3065,22 +3056,22 @@ function Ot(e) {
|
|
|
3065
3056
|
p(s, r) {
|
|
3066
3057
|
r[0] & /*$store*/
|
|
3067
3058
|
16384 && J(t, t = /*annotation*/
|
|
3068
|
-
s[34].id) ? (le(),
|
|
3059
|
+
s[34].id) ? (le(), C(i, 1, 1, F), ae(), i = Yt(s), i.c(), I(i, 1), i.m(n.parentNode, n)) : i.p(s, r);
|
|
3069
3060
|
},
|
|
3070
3061
|
i(s) {
|
|
3071
3062
|
o || (I(i), o = !0);
|
|
3072
3063
|
},
|
|
3073
3064
|
o(s) {
|
|
3074
|
-
|
|
3065
|
+
C(i), o = !1;
|
|
3075
3066
|
},
|
|
3076
3067
|
d(s) {
|
|
3077
3068
|
s && k(n), i.d(s);
|
|
3078
3069
|
}
|
|
3079
3070
|
};
|
|
3080
3071
|
}
|
|
3081
|
-
function
|
|
3072
|
+
function ui(e) {
|
|
3082
3073
|
let t, n;
|
|
3083
|
-
return t = new
|
|
3074
|
+
return t = new oi({
|
|
3084
3075
|
props: {
|
|
3085
3076
|
annotation: (
|
|
3086
3077
|
/*annotation*/
|
|
@@ -3116,16 +3107,16 @@ function ci(e) {
|
|
|
3116
3107
|
n || (I(t.$$.fragment, o), n = !0);
|
|
3117
3108
|
},
|
|
3118
3109
|
o(o) {
|
|
3119
|
-
|
|
3110
|
+
C(t.$$.fragment, o), n = !1;
|
|
3120
3111
|
},
|
|
3121
3112
|
d(o) {
|
|
3122
3113
|
ee(t, o);
|
|
3123
3114
|
}
|
|
3124
3115
|
};
|
|
3125
3116
|
}
|
|
3126
|
-
function
|
|
3117
|
+
function di(e) {
|
|
3127
3118
|
let t, n;
|
|
3128
|
-
return t = new
|
|
3119
|
+
return t = new ri({
|
|
3129
3120
|
props: {
|
|
3130
3121
|
annotation: (
|
|
3131
3122
|
/*annotation*/
|
|
@@ -3161,16 +3152,16 @@ function fi(e) {
|
|
|
3161
3152
|
n || (I(t.$$.fragment, o), n = !0);
|
|
3162
3153
|
},
|
|
3163
3154
|
o(o) {
|
|
3164
|
-
|
|
3155
|
+
C(t.$$.fragment, o), n = !1;
|
|
3165
3156
|
},
|
|
3166
3157
|
d(o) {
|
|
3167
3158
|
ee(t, o);
|
|
3168
3159
|
}
|
|
3169
3160
|
};
|
|
3170
3161
|
}
|
|
3171
|
-
function
|
|
3162
|
+
function hi(e) {
|
|
3172
3163
|
let t, n;
|
|
3173
|
-
return t = new
|
|
3164
|
+
return t = new xo({
|
|
3174
3165
|
props: {
|
|
3175
3166
|
annotation: (
|
|
3176
3167
|
/*annotation*/
|
|
@@ -3206,16 +3197,16 @@ function ui(e) {
|
|
|
3206
3197
|
n || (I(t.$$.fragment, o), n = !0);
|
|
3207
3198
|
},
|
|
3208
3199
|
o(o) {
|
|
3209
|
-
|
|
3200
|
+
C(t.$$.fragment, o), n = !1;
|
|
3210
3201
|
},
|
|
3211
3202
|
d(o) {
|
|
3212
3203
|
ee(t, o);
|
|
3213
3204
|
}
|
|
3214
3205
|
};
|
|
3215
3206
|
}
|
|
3216
|
-
function
|
|
3207
|
+
function Yt(e) {
|
|
3217
3208
|
let t, n, o, i;
|
|
3218
|
-
const s = [
|
|
3209
|
+
const s = [hi, di, ui], r = [];
|
|
3219
3210
|
function l(a, c) {
|
|
3220
3211
|
return (
|
|
3221
3212
|
/*selector*/
|
|
@@ -3237,7 +3228,7 @@ function Bt(e) {
|
|
|
3237
3228
|
},
|
|
3238
3229
|
p(a, c) {
|
|
3239
3230
|
let u = t;
|
|
3240
|
-
t = l(a), t === u ? ~t && r[t].p(a, c) : (n && (le(),
|
|
3231
|
+
t = l(a), t === u ? ~t && r[t].p(a, c) : (n && (le(), C(r[u], 1, 1, () => {
|
|
3241
3232
|
r[u] = null;
|
|
3242
3233
|
}), 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);
|
|
3243
3234
|
},
|
|
@@ -3245,19 +3236,19 @@ function Bt(e) {
|
|
|
3245
3236
|
i || (I(n), i = !0);
|
|
3246
3237
|
},
|
|
3247
3238
|
o(a) {
|
|
3248
|
-
|
|
3239
|
+
C(n), i = !1;
|
|
3249
3240
|
},
|
|
3250
3241
|
d(a) {
|
|
3251
3242
|
a && k(o), ~t && r[t].d(a);
|
|
3252
3243
|
}
|
|
3253
3244
|
};
|
|
3254
3245
|
}
|
|
3255
|
-
function
|
|
3246
|
+
function Dt(e) {
|
|
3256
3247
|
let t = !/*isEditable*/
|
|
3257
3248
|
e[8](
|
|
3258
3249
|
/*annotation*/
|
|
3259
3250
|
e[34]
|
|
3260
|
-
), n, o, i = t &&
|
|
3251
|
+
), n, o, i = t && Pt(tt(e));
|
|
3261
3252
|
return {
|
|
3262
3253
|
c() {
|
|
3263
3254
|
i && i.c(), n = fe();
|
|
@@ -3271,8 +3262,8 @@ function It(e) {
|
|
|
3271
3262
|
s[8](
|
|
3272
3263
|
/*annotation*/
|
|
3273
3264
|
s[34]
|
|
3274
|
-
)), t ? i ? (i.p(
|
|
3275
|
-
16640 && I(i, 1)) : (i =
|
|
3265
|
+
)), t ? i ? (i.p(tt(s), r), r[0] & /*isEditable, $store*/
|
|
3266
|
+
16640 && I(i, 1)) : (i = Pt(tt(s)), i.c(), I(i, 1), i.m(n.parentNode, n)) : i && (le(), C(i, 1, 1, () => {
|
|
3276
3267
|
i = null;
|
|
3277
3268
|
}), ae());
|
|
3278
3269
|
},
|
|
@@ -3280,16 +3271,16 @@ function It(e) {
|
|
|
3280
3271
|
o || (I(i), o = !0);
|
|
3281
3272
|
},
|
|
3282
3273
|
o(s) {
|
|
3283
|
-
|
|
3274
|
+
C(i), o = !1;
|
|
3284
3275
|
},
|
|
3285
3276
|
d(s) {
|
|
3286
3277
|
s && k(n), i && i.d(s);
|
|
3287
3278
|
}
|
|
3288
3279
|
};
|
|
3289
3280
|
}
|
|
3290
|
-
function
|
|
3281
|
+
function Ct(e) {
|
|
3291
3282
|
let t, n, o, i;
|
|
3292
|
-
const s = [
|
|
3283
|
+
const s = [mi, gi], r = [];
|
|
3293
3284
|
function l(a, c) {
|
|
3294
3285
|
return (
|
|
3295
3286
|
/*editableAnnotations*/
|
|
@@ -3309,7 +3300,7 @@ function Pt(e) {
|
|
|
3309
3300
|
},
|
|
3310
3301
|
p(a, c) {
|
|
3311
3302
|
let u = t;
|
|
3312
|
-
t = l(a), t === u ? ~t && r[t].p(a, c) : (n && (le(),
|
|
3303
|
+
t = l(a), t === u ? ~t && r[t].p(a, c) : (n && (le(), C(r[u], 1, 1, () => {
|
|
3313
3304
|
r[u] = null;
|
|
3314
3305
|
}), 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);
|
|
3315
3306
|
},
|
|
@@ -3317,18 +3308,18 @@ function Pt(e) {
|
|
|
3317
3308
|
i || (I(n), i = !0);
|
|
3318
3309
|
},
|
|
3319
3310
|
o(a) {
|
|
3320
|
-
|
|
3311
|
+
C(n), i = !1;
|
|
3321
3312
|
},
|
|
3322
3313
|
d(a) {
|
|
3323
3314
|
a && k(o), ~t && r[t].d(a);
|
|
3324
3315
|
}
|
|
3325
3316
|
};
|
|
3326
3317
|
}
|
|
3327
|
-
function
|
|
3318
|
+
function gi(e) {
|
|
3328
3319
|
let t = (
|
|
3329
3320
|
/*toolName*/
|
|
3330
3321
|
e[2]
|
|
3331
|
-
), n, o, i =
|
|
3322
|
+
), n, o, i = Xt(e);
|
|
3332
3323
|
return {
|
|
3333
3324
|
c() {
|
|
3334
3325
|
i.c(), n = fe();
|
|
@@ -3339,27 +3330,27 @@ function di(e) {
|
|
|
3339
3330
|
p(s, r) {
|
|
3340
3331
|
r[0] & /*toolName*/
|
|
3341
3332
|
4 && J(t, t = /*toolName*/
|
|
3342
|
-
s[2]) ? (le(),
|
|
3333
|
+
s[2]) ? (le(), C(i, 1, 1, F), ae(), i = Xt(s), i.c(), I(i, 1), i.m(n.parentNode, n)) : i.p(s, r);
|
|
3343
3334
|
},
|
|
3344
3335
|
i(s) {
|
|
3345
3336
|
o || (I(i), o = !0);
|
|
3346
3337
|
},
|
|
3347
3338
|
o(s) {
|
|
3348
|
-
|
|
3339
|
+
C(i), o = !1;
|
|
3349
3340
|
},
|
|
3350
3341
|
d(s) {
|
|
3351
3342
|
s && k(n), i.d(s);
|
|
3352
3343
|
}
|
|
3353
3344
|
};
|
|
3354
3345
|
}
|
|
3355
|
-
function
|
|
3346
|
+
function mi(e) {
|
|
3356
3347
|
let t, n, o = Se(
|
|
3357
3348
|
/*editableAnnotations*/
|
|
3358
3349
|
e[7]
|
|
3359
3350
|
), i = [];
|
|
3360
3351
|
for (let r = 0; r < o.length; r += 1)
|
|
3361
|
-
i[r] =
|
|
3362
|
-
const s = (r) =>
|
|
3352
|
+
i[r] = Nt(Bt(e, o, r));
|
|
3353
|
+
const s = (r) => C(i[r], 1, 1, () => {
|
|
3363
3354
|
i[r] = null;
|
|
3364
3355
|
});
|
|
3365
3356
|
return {
|
|
@@ -3382,8 +3373,8 @@ function hi(e) {
|
|
|
3382
3373
|
);
|
|
3383
3374
|
let a;
|
|
3384
3375
|
for (a = 0; a < o.length; a += 1) {
|
|
3385
|
-
const c =
|
|
3386
|
-
i[a] ? (i[a].p(c, l), I(i[a], 1)) : (i[a] =
|
|
3376
|
+
const c = Bt(r, o, a);
|
|
3377
|
+
i[a] ? (i[a].p(c, l), I(i[a], 1)) : (i[a] = Nt(c), i[a].c(), I(i[a], 1), i[a].m(t.parentNode, t));
|
|
3387
3378
|
}
|
|
3388
3379
|
for (le(), a = o.length; a < i.length; a += 1)
|
|
3389
3380
|
s(a);
|
|
@@ -3398,19 +3389,19 @@ function hi(e) {
|
|
|
3398
3389
|
}
|
|
3399
3390
|
},
|
|
3400
3391
|
o(r) {
|
|
3401
|
-
i = i.filter(
|
|
3392
|
+
i = i.filter(on);
|
|
3402
3393
|
for (let l = 0; l < i.length; l += 1)
|
|
3403
|
-
|
|
3394
|
+
C(i[l]);
|
|
3404
3395
|
n = !1;
|
|
3405
3396
|
},
|
|
3406
3397
|
d(r) {
|
|
3407
|
-
r && k(t),
|
|
3398
|
+
r && k(t), at(i, r);
|
|
3408
3399
|
}
|
|
3409
3400
|
};
|
|
3410
3401
|
}
|
|
3411
|
-
function
|
|
3402
|
+
function Xt(e) {
|
|
3412
3403
|
let t, n;
|
|
3413
|
-
return t = new
|
|
3404
|
+
return t = new Vo({
|
|
3414
3405
|
props: {
|
|
3415
3406
|
target: (
|
|
3416
3407
|
/*drawingEl*/
|
|
@@ -3462,16 +3453,16 @@ function Yt(e) {
|
|
|
3462
3453
|
n || (I(t.$$.fragment, o), n = !0);
|
|
3463
3454
|
},
|
|
3464
3455
|
o(o) {
|
|
3465
|
-
|
|
3456
|
+
C(t.$$.fragment, o), n = !1;
|
|
3466
3457
|
},
|
|
3467
3458
|
d(o) {
|
|
3468
3459
|
ee(t, o);
|
|
3469
3460
|
}
|
|
3470
3461
|
};
|
|
3471
3462
|
}
|
|
3472
|
-
function
|
|
3463
|
+
function Rt(e) {
|
|
3473
3464
|
let t, n;
|
|
3474
|
-
return t = new
|
|
3465
|
+
return t = new No({
|
|
3475
3466
|
props: {
|
|
3476
3467
|
target: (
|
|
3477
3468
|
/*drawingEl*/
|
|
@@ -3543,18 +3534,18 @@ function Dt(e) {
|
|
|
3543
3534
|
n || (I(t.$$.fragment, o), n = !0);
|
|
3544
3535
|
},
|
|
3545
3536
|
o(o) {
|
|
3546
|
-
|
|
3537
|
+
C(t.$$.fragment, o), n = !1;
|
|
3547
3538
|
},
|
|
3548
3539
|
d(o) {
|
|
3549
3540
|
ee(t, o);
|
|
3550
3541
|
}
|
|
3551
3542
|
};
|
|
3552
3543
|
}
|
|
3553
|
-
function
|
|
3544
|
+
function Nt(e) {
|
|
3554
3545
|
let t = (
|
|
3555
3546
|
/*editable*/
|
|
3556
3547
|
e[31].id
|
|
3557
|
-
), n, o, i =
|
|
3548
|
+
), n, o, i = Rt(e);
|
|
3558
3549
|
return {
|
|
3559
3550
|
c() {
|
|
3560
3551
|
i.c(), n = fe();
|
|
@@ -3565,39 +3556,39 @@ function Xt(e) {
|
|
|
3565
3556
|
p(s, r) {
|
|
3566
3557
|
r[0] & /*editableAnnotations*/
|
|
3567
3558
|
128 && J(t, t = /*editable*/
|
|
3568
|
-
s[31].id) ? (le(),
|
|
3559
|
+
s[31].id) ? (le(), C(i, 1, 1, F), ae(), i = Rt(s), i.c(), I(i, 1), i.m(n.parentNode, n)) : i.p(s, r);
|
|
3569
3560
|
},
|
|
3570
3561
|
i(s) {
|
|
3571
3562
|
o || (I(i), o = !0);
|
|
3572
3563
|
},
|
|
3573
3564
|
o(s) {
|
|
3574
|
-
|
|
3565
|
+
C(i), o = !1;
|
|
3575
3566
|
},
|
|
3576
3567
|
d(s) {
|
|
3577
3568
|
s && k(n), i.d(s);
|
|
3578
3569
|
}
|
|
3579
3570
|
};
|
|
3580
3571
|
}
|
|
3581
|
-
function
|
|
3572
|
+
function pi(e) {
|
|
3582
3573
|
let t, n, o, i, s, r, l = Se(
|
|
3583
3574
|
/*$store*/
|
|
3584
3575
|
e[14]
|
|
3585
3576
|
), a = [];
|
|
3586
3577
|
for (let f = 0; f < l.length; f += 1)
|
|
3587
|
-
a[f] = It(
|
|
3588
|
-
const c = (f) =>
|
|
3578
|
+
a[f] = Dt(It(e, l, f));
|
|
3579
|
+
const c = (f) => C(a[f], 1, 1, () => {
|
|
3589
3580
|
a[f] = null;
|
|
3590
3581
|
});
|
|
3591
3582
|
let u = (
|
|
3592
3583
|
/*drawingEl*/
|
|
3593
|
-
e[5] &&
|
|
3584
|
+
e[5] && Ct(e)
|
|
3594
3585
|
);
|
|
3595
3586
|
return {
|
|
3596
3587
|
c() {
|
|
3597
|
-
t =
|
|
3588
|
+
t = X("svg"), n = X("g");
|
|
3598
3589
|
for (let f = 0; f < a.length; f += 1)
|
|
3599
3590
|
a[f].c();
|
|
3600
|
-
o =
|
|
3591
|
+
o = X("g"), u && u.c(), h(o, "class", "drawing"), h(t, "class", "a9s-annotationlayer"), Ee(
|
|
3601
3592
|
t,
|
|
3602
3593
|
"drawing",
|
|
3603
3594
|
/*tool*/
|
|
@@ -3633,8 +3624,8 @@ function gi(e) {
|
|
|
3633
3624
|
);
|
|
3634
3625
|
let g;
|
|
3635
3626
|
for (g = 0; g < l.length; g += 1) {
|
|
3636
|
-
const m =
|
|
3637
|
-
a[g] ? (a[g].p(m, d), I(a[g], 1)) : (a[g] =
|
|
3627
|
+
const m = It(e, l, g);
|
|
3628
|
+
a[g] ? (a[g].p(m, d), I(a[g], 1)) : (a[g] = Dt(m), a[g].c(), I(a[g], 1), a[g].m(n, null));
|
|
3638
3629
|
}
|
|
3639
3630
|
for (le(), g = l.length; g < a.length; g += 1)
|
|
3640
3631
|
c(g);
|
|
@@ -3642,7 +3633,7 @@ function gi(e) {
|
|
|
3642
3633
|
}
|
|
3643
3634
|
/*drawingEl*/
|
|
3644
3635
|
e[5] ? u ? (u.p(e, d), d[0] & /*drawingEl*/
|
|
3645
|
-
32 && I(u, 1)) : (u =
|
|
3636
|
+
32 && I(u, 1)) : (u = Ct(e), u.c(), I(u, 1), u.m(o, null)) : u && (le(), C(u, 1, 1, () => {
|
|
3646
3637
|
u = null;
|
|
3647
3638
|
}), ae()), (!i || d[0] & /*tool*/
|
|
3648
3639
|
8192) && Ee(
|
|
@@ -3662,33 +3653,33 @@ function gi(e) {
|
|
|
3662
3653
|
}
|
|
3663
3654
|
},
|
|
3664
3655
|
o(f) {
|
|
3665
|
-
a = a.filter(
|
|
3656
|
+
a = a.filter(on);
|
|
3666
3657
|
for (let d = 0; d < a.length; d += 1)
|
|
3667
|
-
|
|
3668
|
-
|
|
3658
|
+
C(a[d]);
|
|
3659
|
+
C(u), i = !1;
|
|
3669
3660
|
},
|
|
3670
3661
|
d(f) {
|
|
3671
|
-
f && k(t),
|
|
3662
|
+
f && k(t), at(a, f), u && u.d(), e[27](null), e[28](null), s = !1, ce(r);
|
|
3672
3663
|
}
|
|
3673
3664
|
};
|
|
3674
3665
|
}
|
|
3675
|
-
function
|
|
3676
|
-
let o, i, s, r, l, a, c, u, f, d, g = F, m = () => (g(), g =
|
|
3666
|
+
function yi(e, t, n) {
|
|
3667
|
+
let o, i, s, r, l, a, c, u, f, d, g = F, m = () => (g(), g = Ht(Y, (L) => n(15, d = L)), Y);
|
|
3677
3668
|
e.$$.on_destroy.push(() => g());
|
|
3678
|
-
let { drawingEnabled: y } = t, { image:
|
|
3679
|
-
Ye(() => m(n(6, Y =
|
|
3680
|
-
const { selection:
|
|
3681
|
-
|
|
3682
|
-
let T,
|
|
3669
|
+
let { drawingEnabled: y } = t, { image: w } = t, { preferredDrawingMode: p } = t, { state: A } = t, { style: _ = void 0 } = t, { toolName: E = tn()[0] } = t, { user: B } = t, { visible: V = !0 } = t, U, R, Y;
|
|
3670
|
+
Ye(() => m(n(6, Y = Ao(w, R))));
|
|
3671
|
+
const { selection: b, store: S } = A;
|
|
3672
|
+
mt(e, b, (L) => n(26, u = L)), mt(e, S, (L) => n(14, f = L));
|
|
3673
|
+
let T, v;
|
|
3683
3674
|
const P = (L) => {
|
|
3684
3675
|
T && S.unobserve(T);
|
|
3685
3676
|
const Q = L.filter(({ editable: z }) => z).map(({ id: z }) => z);
|
|
3686
|
-
Q.length > 0 ? (n(7,
|
|
3677
|
+
Q.length > 0 ? (n(7, v = Q.map((z) => S.getAnnotation(z)).filter(Boolean)), T = (z) => {
|
|
3687
3678
|
const { updated: ue } = z.changes;
|
|
3688
|
-
n(7,
|
|
3689
|
-
}, S.observe(T, { annotations: Q })) : n(7,
|
|
3679
|
+
n(7, v = ue == null ? void 0 : ue.map((Z) => Z.newValue));
|
|
3680
|
+
}, S.observe(T, { annotations: Q })) : n(7, v = void 0);
|
|
3690
3681
|
}, G = (L) => {
|
|
3691
|
-
const Q =
|
|
3682
|
+
const Q = Jt(), z = {
|
|
3692
3683
|
id: Q,
|
|
3693
3684
|
bodies: [],
|
|
3694
3685
|
target: {
|
|
@@ -3698,7 +3689,7 @@ function mi(e, t, n) {
|
|
|
3698
3689
|
created: /* @__PURE__ */ new Date()
|
|
3699
3690
|
}
|
|
3700
3691
|
};
|
|
3701
|
-
S.addAnnotation(z),
|
|
3692
|
+
S.addAnnotation(z), b.setSelected(z.id);
|
|
3702
3693
|
}, x = (L) => (Q) => {
|
|
3703
3694
|
var N;
|
|
3704
3695
|
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;
|
|
@@ -3709,25 +3700,25 @@ function mi(e, t, n) {
|
|
|
3709
3700
|
updated: Z ? /* @__PURE__ */ new Date() : void 0,
|
|
3710
3701
|
updatedBy: Z ? B : void 0
|
|
3711
3702
|
});
|
|
3712
|
-
},
|
|
3703
|
+
}, ve = (L) => Po(L);
|
|
3713
3704
|
function se(L) {
|
|
3714
3705
|
He[L ? "unshift" : "push"](() => {
|
|
3715
3706
|
U = L, n(5, U);
|
|
3716
3707
|
});
|
|
3717
3708
|
}
|
|
3718
|
-
function
|
|
3709
|
+
function Me(L) {
|
|
3719
3710
|
He[L ? "unshift" : "push"](() => {
|
|
3720
3711
|
R = L, n(4, R);
|
|
3721
3712
|
});
|
|
3722
3713
|
}
|
|
3723
3714
|
return e.$$set = (L) => {
|
|
3724
|
-
"drawingEnabled" in L && n(0, y = L.drawingEnabled), "image" in L && n(21,
|
|
3715
|
+
"drawingEnabled" in L && n(0, y = L.drawingEnabled), "image" in L && n(21, w = 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);
|
|
3725
3716
|
}, e.$$.update = () => {
|
|
3726
3717
|
e.$$.dirty[0] & /*toolName*/
|
|
3727
|
-
4 && n(13, { tool: o, opts: i } =
|
|
3718
|
+
4 && n(13, { tool: o, opts: i } = nn(E) || { tool: void 0, opts: void 0 }, o, (n(25, i), n(2, E))), e.$$.dirty[0] & /*opts, preferredDrawingMode*/
|
|
3728
3719
|
37748736 && n(12, s = (i == null ? void 0 : i.drawingMode) || p), e.$$.dirty[0] & /*svgEl*/
|
|
3729
|
-
16 && n(11, r =
|
|
3730
|
-
16 && n(10, { onPointerDown: l, onPointerUp: a } =
|
|
3720
|
+
16 && n(11, r = li(R)), e.$$.dirty[0] & /*svgEl*/
|
|
3721
|
+
16 && n(10, { onPointerDown: l, onPointerUp: a } = ci(R, S), l, (n(9, a), n(4, R))), e.$$.dirty[0] & /*$selection*/
|
|
3731
3722
|
67108864 && n(8, c = (L) => u.selected.find((Q) => Q.id === L.id && Q.editable)), e.$$.dirty[0] & /*$selection*/
|
|
3732
3723
|
67108864 && P(u.selected);
|
|
3733
3724
|
}, [
|
|
@@ -3738,7 +3729,7 @@ function mi(e, t, n) {
|
|
|
3738
3729
|
R,
|
|
3739
3730
|
U,
|
|
3740
3731
|
Y,
|
|
3741
|
-
|
|
3732
|
+
v,
|
|
3742
3733
|
c,
|
|
3743
3734
|
a,
|
|
3744
3735
|
l,
|
|
@@ -3747,28 +3738,28 @@ function mi(e, t, n) {
|
|
|
3747
3738
|
o,
|
|
3748
3739
|
f,
|
|
3749
3740
|
d,
|
|
3750
|
-
|
|
3741
|
+
b,
|
|
3751
3742
|
S,
|
|
3752
3743
|
G,
|
|
3753
3744
|
x,
|
|
3754
|
-
|
|
3755
|
-
|
|
3745
|
+
ve,
|
|
3746
|
+
w,
|
|
3756
3747
|
p,
|
|
3757
3748
|
A,
|
|
3758
3749
|
B,
|
|
3759
3750
|
i,
|
|
3760
3751
|
u,
|
|
3761
3752
|
se,
|
|
3762
|
-
|
|
3753
|
+
Me
|
|
3763
3754
|
];
|
|
3764
3755
|
}
|
|
3765
|
-
class
|
|
3756
|
+
class _i extends oe {
|
|
3766
3757
|
constructor(t) {
|
|
3767
3758
|
super(), ne(
|
|
3768
3759
|
this,
|
|
3769
3760
|
t,
|
|
3770
|
-
|
|
3771
|
-
|
|
3761
|
+
yi,
|
|
3762
|
+
pi,
|
|
3772
3763
|
J,
|
|
3773
3764
|
{
|
|
3774
3765
|
drawingEnabled: 0,
|
|
@@ -3785,21 +3776,19 @@ class pi extends oe {
|
|
|
3785
3776
|
);
|
|
3786
3777
|
}
|
|
3787
3778
|
}
|
|
3788
|
-
function
|
|
3789
|
-
|
|
3779
|
+
function wi(e, t, n, o, i) {
|
|
3780
|
+
sn(e, t, n || 0, o || e.length - 1, i || bi);
|
|
3790
3781
|
}
|
|
3791
|
-
function
|
|
3782
|
+
function sn(e, t, n, o, i) {
|
|
3792
3783
|
for (; o > n; ) {
|
|
3793
3784
|
if (o - n > 600) {
|
|
3794
3785
|
var s = o - n + 1, r = t - n + 1, l = Math.log(s), a = 0.5 * Math.exp(2 * l / 3), c = 0.5 * Math.sqrt(l * a * (s - a) / s) * (r - s / 2 < 0 ? -1 : 1), u = Math.max(n, Math.floor(t - r * a / s + c)), f = Math.min(o, Math.floor(t + (s - r) * a / s + c));
|
|
3795
|
-
|
|
3786
|
+
sn(e, t, u, f, i);
|
|
3796
3787
|
}
|
|
3797
3788
|
var d = e[t], g = n, m = o;
|
|
3798
3789
|
for (Le(e, n, t), i(e[o], d) > 0 && Le(e, n, o); g < m; ) {
|
|
3799
|
-
for (Le(e, g, m), g++, m--; i(e[g], d) < 0; )
|
|
3800
|
-
|
|
3801
|
-
for (; i(e[m], d) > 0; )
|
|
3802
|
-
m--;
|
|
3790
|
+
for (Le(e, g, m), g++, m--; i(e[g], d) < 0; ) g++;
|
|
3791
|
+
for (; i(e[m], d) > 0; ) m--;
|
|
3803
3792
|
}
|
|
3804
3793
|
i(e[n], d) === 0 ? Le(e, n, m) : (m++, Le(e, m, o)), m <= t && (n = m + 1), t <= m && (o = m - 1);
|
|
3805
3794
|
}
|
|
@@ -3808,10 +3797,10 @@ function Le(e, t, n) {
|
|
|
3808
3797
|
var o = e[t];
|
|
3809
3798
|
e[t] = e[n], e[n] = o;
|
|
3810
3799
|
}
|
|
3811
|
-
function
|
|
3800
|
+
function bi(e, t) {
|
|
3812
3801
|
return e < t ? -1 : e > t ? 1 : 0;
|
|
3813
3802
|
}
|
|
3814
|
-
class
|
|
3803
|
+
class Ei {
|
|
3815
3804
|
constructor(t = 9) {
|
|
3816
3805
|
this._maxEntries = Math.max(4, t), this._minEntries = Math.max(2, Math.ceil(this._maxEntries * 0.4)), this.clear();
|
|
3817
3806
|
}
|
|
@@ -3821,13 +3810,12 @@ class wi {
|
|
|
3821
3810
|
search(t) {
|
|
3822
3811
|
let n = this.data;
|
|
3823
3812
|
const o = [];
|
|
3824
|
-
if (!Ve(t, n))
|
|
3825
|
-
return o;
|
|
3813
|
+
if (!Ve(t, n)) return o;
|
|
3826
3814
|
const i = this.toBBox, s = [];
|
|
3827
3815
|
for (; n; ) {
|
|
3828
3816
|
for (let r = 0; r < n.children.length; r++) {
|
|
3829
3817
|
const l = n.children[r], a = n.leaf ? i(l) : l;
|
|
3830
|
-
Ve(t, a) && (n.leaf ? o.push(l) :
|
|
3818
|
+
Ve(t, a) && (n.leaf ? o.push(l) : ot(t, a) ? this._all(l, o) : s.push(l));
|
|
3831
3819
|
}
|
|
3832
3820
|
n = s.pop();
|
|
3833
3821
|
}
|
|
@@ -3835,15 +3823,13 @@ class wi {
|
|
|
3835
3823
|
}
|
|
3836
3824
|
collides(t) {
|
|
3837
3825
|
let n = this.data;
|
|
3838
|
-
if (!Ve(t, n))
|
|
3839
|
-
return !1;
|
|
3826
|
+
if (!Ve(t, n)) return !1;
|
|
3840
3827
|
const o = [];
|
|
3841
3828
|
for (; n; ) {
|
|
3842
3829
|
for (let i = 0; i < n.children.length; i++) {
|
|
3843
3830
|
const s = n.children[i], r = n.leaf ? this.toBBox(s) : s;
|
|
3844
3831
|
if (Ve(t, r)) {
|
|
3845
|
-
if (n.leaf ||
|
|
3846
|
-
return !0;
|
|
3832
|
+
if (n.leaf || ot(t, r)) return !0;
|
|
3847
3833
|
o.push(s);
|
|
3848
3834
|
}
|
|
3849
3835
|
}
|
|
@@ -3852,8 +3838,7 @@ class wi {
|
|
|
3852
3838
|
return !1;
|
|
3853
3839
|
}
|
|
3854
3840
|
load(t) {
|
|
3855
|
-
if (!(t && t.length))
|
|
3856
|
-
return this;
|
|
3841
|
+
if (!(t && t.length)) return this;
|
|
3857
3842
|
if (t.length < this._minEntries) {
|
|
3858
3843
|
for (let o = 0; o < t.length; o++)
|
|
3859
3844
|
this.insert(t[o]);
|
|
@@ -3880,18 +3865,17 @@ class wi {
|
|
|
3880
3865
|
return this.data = be([]), this;
|
|
3881
3866
|
}
|
|
3882
3867
|
remove(t, n) {
|
|
3883
|
-
if (!t)
|
|
3884
|
-
return this;
|
|
3868
|
+
if (!t) return this;
|
|
3885
3869
|
let o = this.data;
|
|
3886
3870
|
const i = this.toBBox(t), s = [], r = [];
|
|
3887
3871
|
let l, a, c;
|
|
3888
3872
|
for (; o || s.length; ) {
|
|
3889
3873
|
if (o || (o = s.pop(), a = s[s.length - 1], l = r.pop(), c = !0), o.leaf) {
|
|
3890
|
-
const u =
|
|
3874
|
+
const u = Ai(t, o.children, n);
|
|
3891
3875
|
if (u !== -1)
|
|
3892
3876
|
return o.children.splice(u, 1), s.push(o), this._condense(s), this;
|
|
3893
3877
|
}
|
|
3894
|
-
!c && !o.leaf &&
|
|
3878
|
+
!c && !o.leaf && ot(o, i) ? (s.push(o), r.push(l), l = 0, a = o, o = o.children[0]) : a ? (l++, o = a.children[l], c = !1) : o = null;
|
|
3895
3879
|
}
|
|
3896
3880
|
return this;
|
|
3897
3881
|
}
|
|
@@ -3923,10 +3907,10 @@ class wi {
|
|
|
3923
3907
|
return l = be(t.slice(n, o + 1)), _e(l, this.toBBox), l;
|
|
3924
3908
|
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;
|
|
3925
3909
|
const a = Math.ceil(s / r), c = a * Math.ceil(Math.sqrt(r));
|
|
3926
|
-
|
|
3910
|
+
Ut(t, n, o, c, this.compareMinX);
|
|
3927
3911
|
for (let u = n; u <= o; u += c) {
|
|
3928
3912
|
const f = Math.min(u + c - 1, o);
|
|
3929
|
-
|
|
3913
|
+
Ut(t, u, f, a, this.compareMinY);
|
|
3930
3914
|
for (let d = u; d <= f; d += a) {
|
|
3931
3915
|
const g = Math.min(d + a - 1, f);
|
|
3932
3916
|
l.children.push(this._build(t, d, g, i - 1));
|
|
@@ -3938,7 +3922,7 @@ class wi {
|
|
|
3938
3922
|
for (; i.push(n), !(n.leaf || i.length - 1 === o); ) {
|
|
3939
3923
|
let s = 1 / 0, r = 1 / 0, l;
|
|
3940
3924
|
for (let a = 0; a < n.children.length; a++) {
|
|
3941
|
-
const c = n.children[a], u =
|
|
3925
|
+
const c = n.children[a], u = nt(c), f = vi(t, c) - u;
|
|
3942
3926
|
f < r ? (r = f, s = u < s ? u : s, l = c) : f === r && u < s && (s = u, l = c);
|
|
3943
3927
|
}
|
|
3944
3928
|
n = l || n.children[0];
|
|
@@ -3964,14 +3948,14 @@ class wi {
|
|
|
3964
3948
|
_chooseSplitIndex(t, n, o) {
|
|
3965
3949
|
let i, s = 1 / 0, r = 1 / 0;
|
|
3966
3950
|
for (let l = n; l <= o - n; l++) {
|
|
3967
|
-
const a = Oe(t, 0, l, this.toBBox), c = Oe(t, l, o, this.toBBox), u =
|
|
3951
|
+
const a = Oe(t, 0, l, this.toBBox), c = Oe(t, l, o, this.toBBox), u = Mi(a, c), f = nt(a) + nt(c);
|
|
3968
3952
|
u < s ? (s = u, i = l, r = f < r ? f : r) : u === s && f < r && (r = f, i = l);
|
|
3969
3953
|
}
|
|
3970
3954
|
return i || o - n;
|
|
3971
3955
|
}
|
|
3972
3956
|
// sorts node children by the best axis for split
|
|
3973
3957
|
_chooseSplitAxis(t, n, o) {
|
|
3974
|
-
const i = t.leaf ? this.compareMinX :
|
|
3958
|
+
const i = t.leaf ? this.compareMinX : Si, s = t.leaf ? this.compareMinY : Ti, r = this._allDistMargin(t, n, o, i), l = this._allDistMargin(t, n, o, s);
|
|
3975
3959
|
r < l && t.children.sort(i);
|
|
3976
3960
|
}
|
|
3977
3961
|
// total margin of all possible split distributions where each node is at least m full
|
|
@@ -3998,12 +3982,10 @@ class wi {
|
|
|
3998
3982
|
t[n].children.length === 0 ? n > 0 ? (o = t[n - 1].children, o.splice(o.indexOf(t[n]), 1)) : this.clear() : _e(t[n], this.toBBox);
|
|
3999
3983
|
}
|
|
4000
3984
|
}
|
|
4001
|
-
function
|
|
4002
|
-
if (!n)
|
|
4003
|
-
return t.indexOf(e);
|
|
3985
|
+
function Ai(e, t, n) {
|
|
3986
|
+
if (!n) return t.indexOf(e);
|
|
4004
3987
|
for (let o = 0; o < t.length; o++)
|
|
4005
|
-
if (n(e, t[o]))
|
|
4006
|
-
return o;
|
|
3988
|
+
if (n(e, t[o])) return o;
|
|
4007
3989
|
return -1;
|
|
4008
3990
|
}
|
|
4009
3991
|
function _e(e, t) {
|
|
@@ -4020,26 +4002,26 @@ function Oe(e, t, n, o, i) {
|
|
|
4020
4002
|
function Be(e, t) {
|
|
4021
4003
|
return e.minX = Math.min(e.minX, t.minX), e.minY = Math.min(e.minY, t.minY), e.maxX = Math.max(e.maxX, t.maxX), e.maxY = Math.max(e.maxY, t.maxY), e;
|
|
4022
4004
|
}
|
|
4023
|
-
function
|
|
4005
|
+
function Si(e, t) {
|
|
4024
4006
|
return e.minX - t.minX;
|
|
4025
4007
|
}
|
|
4026
|
-
function
|
|
4008
|
+
function Ti(e, t) {
|
|
4027
4009
|
return e.minY - t.minY;
|
|
4028
4010
|
}
|
|
4029
|
-
function
|
|
4011
|
+
function nt(e) {
|
|
4030
4012
|
return (e.maxX - e.minX) * (e.maxY - e.minY);
|
|
4031
4013
|
}
|
|
4032
4014
|
function Ue(e) {
|
|
4033
4015
|
return e.maxX - e.minX + (e.maxY - e.minY);
|
|
4034
4016
|
}
|
|
4035
|
-
function
|
|
4017
|
+
function vi(e, t) {
|
|
4036
4018
|
return (Math.max(t.maxX, e.maxX) - Math.min(t.minX, e.minX)) * (Math.max(t.maxY, e.maxY) - Math.min(t.minY, e.minY));
|
|
4037
4019
|
}
|
|
4038
|
-
function
|
|
4020
|
+
function Mi(e, t) {
|
|
4039
4021
|
const n = Math.max(e.minX, t.minX), o = Math.max(e.minY, t.minY), i = Math.min(e.maxX, t.maxX), s = Math.min(e.maxY, t.maxY);
|
|
4040
4022
|
return Math.max(0, i - n) * Math.max(0, s - o);
|
|
4041
4023
|
}
|
|
4042
|
-
function
|
|
4024
|
+
function ot(e, t) {
|
|
4043
4025
|
return e.minX <= t.minX && e.minY <= t.minY && t.maxX <= e.maxX && t.maxY <= e.maxY;
|
|
4044
4026
|
}
|
|
4045
4027
|
function Ve(e, t) {
|
|
@@ -4056,21 +4038,20 @@ function be(e) {
|
|
|
4056
4038
|
maxY: -1 / 0
|
|
4057
4039
|
};
|
|
4058
4040
|
}
|
|
4059
|
-
function
|
|
4041
|
+
function Ut(e, t, n, o, i) {
|
|
4060
4042
|
const s = [t, n];
|
|
4061
4043
|
for (; s.length; ) {
|
|
4062
|
-
if (n = s.pop(), t = s.pop(), n - t <= o)
|
|
4063
|
-
continue;
|
|
4044
|
+
if (n = s.pop(), t = s.pop(), n - t <= o) continue;
|
|
4064
4045
|
const r = t + Math.ceil((n - t) / o / 2) * o;
|
|
4065
|
-
|
|
4046
|
+
wi(e, r, t, n, i), s.push(t, r, r, n);
|
|
4066
4047
|
}
|
|
4067
4048
|
}
|
|
4068
|
-
const
|
|
4069
|
-
const e = new
|
|
4049
|
+
const Li = () => {
|
|
4050
|
+
const e = new Ei(), t = /* @__PURE__ */ new Map(), n = () => [...t.values()], o = () => {
|
|
4070
4051
|
e.clear(), t.clear();
|
|
4071
4052
|
}, i = (f) => {
|
|
4072
|
-
const { minX: d, minY: g, maxX: m, maxY: y } = f.selector.geometry.bounds,
|
|
4073
|
-
e.insert(
|
|
4053
|
+
const { minX: d, minY: g, maxX: m, maxY: y } = f.selector.geometry.bounds, w = { minX: d, minY: g, maxX: m, maxY: y, target: f };
|
|
4054
|
+
e.insert(w), t.set(f.annotation, w);
|
|
4074
4055
|
}, s = (f) => {
|
|
4075
4056
|
const d = t.get(f.annotation);
|
|
4076
4057
|
d && e.remove(d), t.delete(f.annotation);
|
|
@@ -4084,9 +4065,9 @@ const Mi = () => {
|
|
|
4084
4065
|
minY: d,
|
|
4085
4066
|
maxX: f,
|
|
4086
4067
|
maxY: d
|
|
4087
|
-
}).map((y) => y.target).filter((y) => y.selector.type === q.RECTANGLE ||
|
|
4068
|
+
}).map((y) => y.target).filter((y) => y.selector.type === q.RECTANGLE || An(y.selector, f, d));
|
|
4088
4069
|
if (m.length > 0)
|
|
4089
|
-
return m.sort((y,
|
|
4070
|
+
return m.sort((y, w) => lt(y.selector) - lt(w.selector)), m[0];
|
|
4090
4071
|
},
|
|
4091
4072
|
getIntersecting: (f, d, g, m) => e.search({
|
|
4092
4073
|
minX: f,
|
|
@@ -4099,8 +4080,8 @@ const Mi = () => {
|
|
|
4099
4080
|
set: (f, d = !0) => {
|
|
4100
4081
|
d && o();
|
|
4101
4082
|
const g = f.map((m) => {
|
|
4102
|
-
const { minX: y, minY:
|
|
4103
|
-
return { minX: y, minY:
|
|
4083
|
+
const { minX: y, minY: w, maxX: p, maxY: A } = m.selector.geometry.bounds;
|
|
4084
|
+
return { minX: y, minY: w, maxX: p, maxY: A, target: m };
|
|
4104
4085
|
});
|
|
4105
4086
|
g.forEach((m) => t.set(m.target.annotation, m)), e.load(g);
|
|
4106
4087
|
},
|
|
@@ -4109,8 +4090,8 @@ const Mi = () => {
|
|
|
4109
4090
|
s(f), i(d);
|
|
4110
4091
|
}
|
|
4111
4092
|
};
|
|
4112
|
-
},
|
|
4113
|
-
const t =
|
|
4093
|
+
}, ki = (e) => {
|
|
4094
|
+
const t = Jn(), n = Li(), o = Vn(t, e.pointerSelectAction), i = Un(t), s = eo();
|
|
4114
4095
|
return t.observe(({ changes: a }) => {
|
|
4115
4096
|
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));
|
|
4116
4097
|
}), {
|
|
@@ -4126,13 +4107,13 @@ const Mi = () => {
|
|
|
4126
4107
|
hover: i,
|
|
4127
4108
|
viewport: s
|
|
4128
4109
|
};
|
|
4129
|
-
},
|
|
4130
|
-
const t =
|
|
4110
|
+
}, Oi = (e) => {
|
|
4111
|
+
const t = ki(e);
|
|
4131
4112
|
return {
|
|
4132
4113
|
...t,
|
|
4133
|
-
store:
|
|
4114
|
+
store: Qn(t.store)
|
|
4134
4115
|
};
|
|
4135
|
-
},
|
|
4116
|
+
}, Bi = (e) => {
|
|
4136
4117
|
let t, n;
|
|
4137
4118
|
if (e.nodeName === "CANVAS")
|
|
4138
4119
|
t = e, n = t.getContext("2d", { willReadFrequently: !0 });
|
|
@@ -4147,16 +4128,16 @@ const Mi = () => {
|
|
|
4147
4128
|
o += c;
|
|
4148
4129
|
}
|
|
4149
4130
|
return o / 81;
|
|
4150
|
-
},
|
|
4151
|
-
const t =
|
|
4131
|
+
}, Ii = (e) => {
|
|
4132
|
+
const t = Bi(e), n = t > 0.6 ? "dark" : "light";
|
|
4152
4133
|
return console.log(`[Annotorious] Image brightness: ${t.toFixed(1)}. Setting ${n} theme.`), n;
|
|
4153
|
-
},
|
|
4134
|
+
}, Vt = (e, t, n) => t.setAttribute("data-theme", n === "auto" ? Ii(e) : n), Pi = (e, t) => ({
|
|
4154
4135
|
...e,
|
|
4155
4136
|
drawingEnabled: e.drawingEnabled === void 0 ? t.drawingEnabled : e.drawingEnabled,
|
|
4156
4137
|
drawingMode: e.drawingMode || t.drawingMode,
|
|
4157
4138
|
pointerSelectAction: e.pointerSelectAction || t.pointerSelectAction,
|
|
4158
4139
|
theme: e.theme || t.theme
|
|
4159
|
-
}),
|
|
4140
|
+
}), Gt = navigator.userAgent.indexOf("Mac OS X") !== -1, Yi = (e, t) => {
|
|
4160
4141
|
const n = t || document, o = (r) => {
|
|
4161
4142
|
const l = r;
|
|
4162
4143
|
l.key === "z" && l.ctrlKey ? e.undo() : l.key === "y" && l.ctrlKey && e.redo();
|
|
@@ -4164,30 +4145,30 @@ const Mi = () => {
|
|
|
4164
4145
|
const l = r;
|
|
4165
4146
|
l.key === "z" && l.metaKey && (l.shiftKey ? e.redo() : e.undo());
|
|
4166
4147
|
}, s = () => {
|
|
4167
|
-
|
|
4148
|
+
Gt ? n.removeEventListener("keydown", i) : n.removeEventListener("keydown", o);
|
|
4168
4149
|
};
|
|
4169
|
-
return
|
|
4150
|
+
return Gt ? n.addEventListener("keydown", i) : n.addEventListener("keydown", o), {
|
|
4170
4151
|
destroy: s
|
|
4171
4152
|
};
|
|
4172
|
-
},
|
|
4153
|
+
}, Ri = (e, t = {}) => {
|
|
4173
4154
|
if (!e)
|
|
4174
4155
|
throw "Missing argument: image";
|
|
4175
|
-
const n = typeof e == "string" ? document.getElementById(e) : e, o =
|
|
4156
|
+
const n = typeof e == "string" ? document.getElementById(e) : e, o = Pi(t, {
|
|
4176
4157
|
drawingEnabled: !0,
|
|
4177
4158
|
drawingMode: "drag",
|
|
4178
|
-
pointerSelectAction:
|
|
4159
|
+
pointerSelectAction: Qt.EDIT,
|
|
4179
4160
|
theme: "light"
|
|
4180
|
-
}), i =
|
|
4161
|
+
}), i = Oi(o), { selection: s, store: r } = i, l = $n(r), a = to(
|
|
4181
4162
|
i,
|
|
4182
4163
|
l,
|
|
4183
4164
|
o.adapter,
|
|
4184
4165
|
o.autoSave
|
|
4185
4166
|
), c = document.createElement("DIV");
|
|
4186
4167
|
c.style.position = "relative", c.style.display = "inline-block", n.style.display = "block", n.parentNode.insertBefore(c, n), c.appendChild(n);
|
|
4187
|
-
const u =
|
|
4188
|
-
let f =
|
|
4189
|
-
|
|
4190
|
-
const d = new
|
|
4168
|
+
const u = Yi(l);
|
|
4169
|
+
let f = co();
|
|
4170
|
+
Vt(n, c, o.theme);
|
|
4171
|
+
const d = new _i({
|
|
4191
4172
|
target: c,
|
|
4192
4173
|
props: {
|
|
4193
4174
|
drawingEnabled: !!o.drawingEnabled,
|
|
@@ -4199,18 +4180,18 @@ const Mi = () => {
|
|
|
4199
4180
|
}
|
|
4200
4181
|
});
|
|
4201
4182
|
d.$on("click", (Y) => {
|
|
4202
|
-
const { originalEvent:
|
|
4203
|
-
S ? s.clickSelect(S.id,
|
|
4183
|
+
const { originalEvent: b, annotation: S } = Y.detail;
|
|
4184
|
+
S ? s.clickSelect(S.id, b) : s.isEmpty() || s.clear();
|
|
4204
4185
|
});
|
|
4205
|
-
const g =
|
|
4186
|
+
const g = oo(i, l, o.adapter), m = () => {
|
|
4206
4187
|
d.$destroy(), c.parentNode.insertBefore(n, c), c.parentNode.removeChild(c), u.destroy(), l.destroy();
|
|
4207
|
-
}, y = () => f,
|
|
4208
|
-
if (
|
|
4188
|
+
}, y = () => f, w = (Y, b, S) => Jo(Y, b, S), p = (Y, b) => Yo(Y, b), A = (Y) => {
|
|
4189
|
+
if (!nn(Y))
|
|
4209
4190
|
throw `No drawing tool named ${Y}`;
|
|
4210
4191
|
d.$set({ toolName: Y });
|
|
4211
4192
|
}, _ = (Y) => d.$set({ drawingEnabled: Y }), E = (Y) => {
|
|
4212
4193
|
console.warn("Filter not implemented yet");
|
|
4213
|
-
}, B = (Y) => d.$set({ style: Y }), V = (Y) =>
|
|
4194
|
+
}, B = (Y) => d.$set({ style: Y }), V = (Y) => Vt(n, c, Y), U = (Y) => {
|
|
4214
4195
|
f = Y, d.$set({ user: Y });
|
|
4215
4196
|
}, R = (Y) => (
|
|
4216
4197
|
// @ts-ignore
|
|
@@ -4220,10 +4201,10 @@ const Mi = () => {
|
|
|
4220
4201
|
...g,
|
|
4221
4202
|
destroy: m,
|
|
4222
4203
|
getUser: y,
|
|
4223
|
-
listDrawingTools:
|
|
4204
|
+
listDrawingTools: tn,
|
|
4224
4205
|
on: a.on,
|
|
4225
4206
|
off: a.off,
|
|
4226
|
-
registerDrawingTool:
|
|
4207
|
+
registerDrawingTool: w,
|
|
4227
4208
|
registerShapeEditor: p,
|
|
4228
4209
|
setDrawingEnabled: _,
|
|
4229
4210
|
setDrawingTool: A,
|
|
@@ -4236,45 +4217,45 @@ const Mi = () => {
|
|
|
4236
4217
|
};
|
|
4237
4218
|
};
|
|
4238
4219
|
export {
|
|
4239
|
-
|
|
4240
|
-
|
|
4220
|
+
en as Editor,
|
|
4221
|
+
No as EditorMount,
|
|
4241
4222
|
ke as Handle,
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4223
|
+
Xi as IdentityTransform,
|
|
4224
|
+
wo as PolygonEditor,
|
|
4225
|
+
Io as RectangleEditor,
|
|
4226
|
+
vn as RectangleUtil,
|
|
4227
|
+
Ho as RubberbandRectangle,
|
|
4228
|
+
_i as SVGAnnotationLayer,
|
|
4248
4229
|
q as ShapeType,
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4230
|
+
Vo as ToolMount,
|
|
4231
|
+
Ci as W3CImageFormat,
|
|
4232
|
+
ci as addEventListeners,
|
|
4252
4233
|
Fe as boundsFromPoints,
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
|
|
4234
|
+
lt as computeArea,
|
|
4235
|
+
Ri as createImageAnnotator,
|
|
4236
|
+
ki as createImageAnnotatorState,
|
|
4237
|
+
li as createSVGTransform,
|
|
4238
|
+
Oi as createSvelteImageAnnotatorState,
|
|
4239
|
+
Ii as detectTheme,
|
|
4240
|
+
$e as distance,
|
|
4241
|
+
Ao as enableResponsive,
|
|
4242
|
+
Pi as fillDefaults,
|
|
4243
|
+
Po as getEditor,
|
|
4244
|
+
nn as getTool,
|
|
4245
|
+
Yi as initKeyboardCommands,
|
|
4246
|
+
An as intersects,
|
|
4247
|
+
So as isTouch,
|
|
4248
|
+
tn as listDrawingTools,
|
|
4249
|
+
Mn as parseFragmentSelector,
|
|
4250
|
+
Pn as parseSVGSelector,
|
|
4251
|
+
go as parseW3CImageAnnotation,
|
|
4252
|
+
Yo as registerEditor,
|
|
4253
|
+
ft as registerShapeUtil,
|
|
4254
|
+
Jo as registerTool,
|
|
4255
|
+
Bi as sampleBrightness,
|
|
4256
|
+
Ln as serializeFragmentSelector,
|
|
4257
|
+
Yn as serializeSVGSelector,
|
|
4258
|
+
mo as serializeW3CImageAnnotation,
|
|
4259
|
+
Vt as setTheme
|
|
4279
4260
|
};
|
|
4280
4261
|
//# sourceMappingURL=annotorious.es.js.map
|