@annotorious/annotorious 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Annotorious.d.ts +3 -3
- package/dist/AnnotoriousOpts.d.ts +1 -1
- package/dist/annotation/SVGAnnotationLayerPointerEvent.d.ts +4 -4
- package/dist/annotorious.es.js +1163 -1150
- package/dist/annotorious.es.js.map +1 -1
- package/dist/annotorious.js +1 -1
- package/dist/annotorious.js.map +1 -1
- package/dist/model/core/ImageAnnotation.d.ts +2 -0
- package/dist/state/ImageAnnotationStore.d.ts +5 -5
- package/dist/state/ImageAnnotatorState.d.ts +5 -5
- package/dist/state/spatialTree.d.ts +5 -4
- package/package.json +3 -3
- package/src/Annotorious.ts +13 -13
- package/src/AnnotoriousOpts.ts +1 -1
- package/src/annotation/SVGAnnotationLayer.svelte +14 -12
- package/src/annotation/SVGAnnotationLayerPointerEvent.ts +6 -6
- package/src/model/core/ImageAnnotation.ts +12 -1
- package/src/state/ImageAnnotationStore.ts +5 -5
- package/src/state/ImageAnnotatorState.ts +17 -17
- package/src/state/spatialTree.ts +12 -7
package/dist/annotorious.es.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
function
|
|
1
|
+
var hn = Object.defineProperty;
|
|
2
|
+
var gn = (e, t, n) => t in e ? hn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var $e = (e, t, n) => gn(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
function H() {
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function ut(e, t) {
|
|
7
7
|
for (const n in t) e[n] = t[n];
|
|
8
8
|
return (
|
|
9
9
|
/** @type {T & S} */
|
|
10
10
|
e
|
|
11
11
|
);
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function Jt(e) {
|
|
14
14
|
return e();
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function bt() {
|
|
17
17
|
return /* @__PURE__ */ Object.create(null);
|
|
18
18
|
}
|
|
19
19
|
function de(e) {
|
|
20
|
-
e.forEach(
|
|
20
|
+
e.forEach(Jt);
|
|
21
21
|
}
|
|
22
22
|
function q(e) {
|
|
23
23
|
return typeof e == "function";
|
|
@@ -25,31 +25,31 @@ function q(e) {
|
|
|
25
25
|
function Z(e, t) {
|
|
26
26
|
return e != e ? t == t : e !== t || e && typeof e == "object" || typeof e == "function";
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function mn(e) {
|
|
29
29
|
return Object.keys(e).length === 0;
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function Qt(e, ...t) {
|
|
32
32
|
if (e == null) {
|
|
33
33
|
for (const o of t)
|
|
34
34
|
o(void 0);
|
|
35
|
-
return
|
|
35
|
+
return H;
|
|
36
36
|
}
|
|
37
37
|
const n = e.subscribe(...t);
|
|
38
38
|
return n.unsubscribe ? () => n.unsubscribe() : n;
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
e.$$.on_destroy.push(
|
|
40
|
+
function et(e, t, n) {
|
|
41
|
+
e.$$.on_destroy.push(Qt(t, n));
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function pn(e, t, n, o) {
|
|
44
44
|
if (e) {
|
|
45
|
-
const i =
|
|
45
|
+
const i = Zt(e, t, n, o);
|
|
46
46
|
return e[0](i);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
function
|
|
50
|
-
return e[1] && o ?
|
|
49
|
+
function Zt(e, t, n, o) {
|
|
50
|
+
return e[1] && o ? ut(n.ctx.slice(), e[1](o(t))) : n.ctx;
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function yn(e, t, n, o) {
|
|
53
53
|
if (e[2] && o) {
|
|
54
54
|
const i = e[2](o(n));
|
|
55
55
|
if (t.dirty === void 0)
|
|
@@ -64,13 +64,13 @@ function pn(e, t, n, o) {
|
|
|
64
64
|
}
|
|
65
65
|
return t.dirty;
|
|
66
66
|
}
|
|
67
|
-
function
|
|
67
|
+
function _n(e, t, n, o, i, s) {
|
|
68
68
|
if (i) {
|
|
69
|
-
const r =
|
|
69
|
+
const r = Zt(t, n, o, s);
|
|
70
70
|
e.p(r, i);
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function wn(e) {
|
|
74
74
|
if (e.ctx.length > 32) {
|
|
75
75
|
const t = [], n = e.ctx.length / 32;
|
|
76
76
|
for (let o = 0; o < n; o++)
|
|
@@ -79,53 +79,49 @@ function _n(e) {
|
|
|
79
79
|
}
|
|
80
80
|
return -1;
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function Et(e) {
|
|
83
83
|
const t = {};
|
|
84
84
|
for (const n in e) n[0] !== "$" && (t[n] = e[n]);
|
|
85
85
|
return t;
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function Ke(e) {
|
|
88
88
|
return e ?? "";
|
|
89
89
|
}
|
|
90
|
-
const wn = typeof window < "u" ? window : typeof globalThis < "u" ? globalThis : (
|
|
91
|
-
// @ts-ignore Node typings have this
|
|
92
|
-
global
|
|
93
|
-
);
|
|
94
90
|
function ue(e, t) {
|
|
95
91
|
e.appendChild(t);
|
|
96
92
|
}
|
|
97
93
|
function I(e, t, n) {
|
|
98
94
|
e.insertBefore(t, n || null);
|
|
99
95
|
}
|
|
100
|
-
function
|
|
96
|
+
function k(e) {
|
|
101
97
|
e.parentNode && e.parentNode.removeChild(e);
|
|
102
98
|
}
|
|
103
|
-
function
|
|
99
|
+
function mt(e, t) {
|
|
104
100
|
for (let n = 0; n < e.length; n += 1)
|
|
105
101
|
e[n] && e[n].d(t);
|
|
106
102
|
}
|
|
107
103
|
function C(e) {
|
|
108
104
|
return document.createElementNS("http://www.w3.org/2000/svg", e);
|
|
109
105
|
}
|
|
110
|
-
function
|
|
106
|
+
function xt(e) {
|
|
111
107
|
return document.createTextNode(e);
|
|
112
108
|
}
|
|
113
109
|
function ie() {
|
|
114
|
-
return
|
|
110
|
+
return xt(" ");
|
|
115
111
|
}
|
|
116
112
|
function le() {
|
|
117
|
-
return
|
|
113
|
+
return xt("");
|
|
118
114
|
}
|
|
119
115
|
function F(e, t, n, o) {
|
|
120
116
|
return e.addEventListener(t, n, o), () => e.removeEventListener(t, n, o);
|
|
121
117
|
}
|
|
122
|
-
function
|
|
118
|
+
function d(e, t, n) {
|
|
123
119
|
n == null ? e.removeAttribute(t) : e.getAttribute(t) !== n && e.setAttribute(t, n);
|
|
124
120
|
}
|
|
125
121
|
function bn(e) {
|
|
126
122
|
return Array.from(e.childNodes);
|
|
127
123
|
}
|
|
128
|
-
function
|
|
124
|
+
function me(e, t, n) {
|
|
129
125
|
e.classList.toggle(t, !!n);
|
|
130
126
|
}
|
|
131
127
|
function En(e, t, { bubbles: n = !1, cancelable: o = !1 } = {}) {
|
|
@@ -135,15 +131,15 @@ let Xe;
|
|
|
135
131
|
function De(e) {
|
|
136
132
|
Xe = e;
|
|
137
133
|
}
|
|
138
|
-
function
|
|
134
|
+
function $t() {
|
|
139
135
|
if (!Xe) throw new Error("Function called outside component initialization");
|
|
140
136
|
return Xe;
|
|
141
137
|
}
|
|
142
138
|
function Re(e) {
|
|
143
|
-
|
|
139
|
+
$t().$$.on_mount.push(e);
|
|
144
140
|
}
|
|
145
|
-
function
|
|
146
|
-
const e =
|
|
141
|
+
function Me() {
|
|
142
|
+
const e = $t();
|
|
147
143
|
return (t, n, { cancelable: o = !1 } = {}) => {
|
|
148
144
|
const i = e.$$.callbacks[t];
|
|
149
145
|
if (i) {
|
|
@@ -164,96 +160,96 @@ function he(e, t) {
|
|
|
164
160
|
const n = e.$$.callbacks[t.type];
|
|
165
161
|
n && n.slice().forEach((o) => o.call(this, t));
|
|
166
162
|
}
|
|
167
|
-
const
|
|
168
|
-
let
|
|
169
|
-
const
|
|
170
|
-
let
|
|
163
|
+
const Ae = [], Je = [];
|
|
164
|
+
let ve = [];
|
|
165
|
+
const At = [], An = /* @__PURE__ */ Promise.resolve();
|
|
166
|
+
let dt = !1;
|
|
171
167
|
function Sn() {
|
|
172
|
-
|
|
168
|
+
dt || (dt = !0, An.then(en));
|
|
173
169
|
}
|
|
174
|
-
function
|
|
175
|
-
|
|
170
|
+
function ht(e) {
|
|
171
|
+
ve.push(e);
|
|
176
172
|
}
|
|
177
|
-
const
|
|
178
|
-
let
|
|
179
|
-
function
|
|
180
|
-
if (
|
|
173
|
+
const tt = /* @__PURE__ */ new Set();
|
|
174
|
+
let _e = 0;
|
|
175
|
+
function en() {
|
|
176
|
+
if (_e !== 0)
|
|
181
177
|
return;
|
|
182
178
|
const e = Xe;
|
|
183
179
|
do {
|
|
184
180
|
try {
|
|
185
|
-
for (;
|
|
186
|
-
const t =
|
|
187
|
-
|
|
181
|
+
for (; _e < Ae.length; ) {
|
|
182
|
+
const t = Ae[_e];
|
|
183
|
+
_e++, De(t), vn(t.$$);
|
|
188
184
|
}
|
|
189
185
|
} catch (t) {
|
|
190
|
-
throw
|
|
186
|
+
throw Ae.length = 0, _e = 0, t;
|
|
191
187
|
}
|
|
192
|
-
for (De(null),
|
|
193
|
-
for (let t = 0; t <
|
|
194
|
-
const n =
|
|
195
|
-
|
|
188
|
+
for (De(null), Ae.length = 0, _e = 0; Je.length; ) Je.pop()();
|
|
189
|
+
for (let t = 0; t < ve.length; t += 1) {
|
|
190
|
+
const n = ve[t];
|
|
191
|
+
tt.has(n) || (tt.add(n), n());
|
|
196
192
|
}
|
|
197
|
-
|
|
198
|
-
} while (
|
|
199
|
-
for (;
|
|
200
|
-
|
|
201
|
-
|
|
193
|
+
ve.length = 0;
|
|
194
|
+
} while (Ae.length);
|
|
195
|
+
for (; At.length; )
|
|
196
|
+
At.pop()();
|
|
197
|
+
dt = !1, tt.clear(), De(e);
|
|
202
198
|
}
|
|
203
199
|
function vn(e) {
|
|
204
200
|
if (e.fragment !== null) {
|
|
205
201
|
e.update(), de(e.before_update);
|
|
206
202
|
const t = e.dirty;
|
|
207
|
-
e.dirty = [-1], e.fragment && e.fragment.p(e.ctx, t), e.after_update.forEach(
|
|
203
|
+
e.dirty = [-1], e.fragment && e.fragment.p(e.ctx, t), e.after_update.forEach(ht);
|
|
208
204
|
}
|
|
209
205
|
}
|
|
210
206
|
function Tn(e) {
|
|
211
207
|
const t = [], n = [];
|
|
212
|
-
|
|
208
|
+
ve.forEach((o) => e.indexOf(o) === -1 ? t.push(o) : n.push(o)), n.forEach((o) => o()), ve = t;
|
|
213
209
|
}
|
|
214
210
|
const We = /* @__PURE__ */ new Set();
|
|
215
|
-
let
|
|
211
|
+
let ye;
|
|
216
212
|
function se() {
|
|
217
|
-
|
|
213
|
+
ye = {
|
|
218
214
|
r: 0,
|
|
219
215
|
c: [],
|
|
220
|
-
p:
|
|
216
|
+
p: ye
|
|
221
217
|
// parent group
|
|
222
218
|
};
|
|
223
219
|
}
|
|
224
220
|
function re() {
|
|
225
|
-
|
|
221
|
+
ye.r || de(ye.c), ye = ye.p;
|
|
226
222
|
}
|
|
227
|
-
function
|
|
223
|
+
function B(e, t) {
|
|
228
224
|
e && e.i && (We.delete(e), e.i(t));
|
|
229
225
|
}
|
|
230
226
|
function R(e, t, n, o) {
|
|
231
227
|
if (e && e.o) {
|
|
232
228
|
if (We.has(e)) return;
|
|
233
|
-
We.add(e),
|
|
229
|
+
We.add(e), ye.c.push(() => {
|
|
234
230
|
We.delete(e), o && (n && e.d(1), o());
|
|
235
231
|
}), e.o(t);
|
|
236
232
|
} else o && o();
|
|
237
233
|
}
|
|
238
|
-
function
|
|
234
|
+
function Te(e) {
|
|
239
235
|
return (e == null ? void 0 : e.length) !== void 0 ? e : Array.from(e);
|
|
240
236
|
}
|
|
241
237
|
function te(e) {
|
|
242
238
|
e && e.c();
|
|
243
239
|
}
|
|
244
|
-
function
|
|
240
|
+
function x(e, t, n) {
|
|
245
241
|
const { fragment: o, after_update: i } = e.$$;
|
|
246
|
-
o && o.m(t, n),
|
|
247
|
-
const s = e.$$.on_mount.map(
|
|
242
|
+
o && o.m(t, n), ht(() => {
|
|
243
|
+
const s = e.$$.on_mount.map(Jt).filter(q);
|
|
248
244
|
e.$$.on_destroy ? e.$$.on_destroy.push(...s) : de(s), e.$$.on_mount = [];
|
|
249
|
-
}), i.forEach(
|
|
245
|
+
}), i.forEach(ht);
|
|
250
246
|
}
|
|
251
|
-
function
|
|
247
|
+
function $(e, t) {
|
|
252
248
|
const n = e.$$;
|
|
253
249
|
n.fragment !== null && (Tn(n.after_update), de(n.on_destroy), n.fragment && n.fragment.d(t), n.on_destroy = n.fragment = null, n.ctx = []);
|
|
254
250
|
}
|
|
255
251
|
function Mn(e, t) {
|
|
256
|
-
e.$$.dirty[0] === -1 && (
|
|
252
|
+
e.$$.dirty[0] === -1 && (Ae.push(e), Sn(), e.$$.dirty.fill(0)), e.$$.dirty[t / 31 | 0] |= 1 << t % 31;
|
|
257
253
|
}
|
|
258
254
|
function ne(e, t, n, o, i, s, r = null, l = [-1]) {
|
|
259
255
|
const a = Xe;
|
|
@@ -263,9 +259,9 @@ function ne(e, t, n, o, i, s, r = null, l = [-1]) {
|
|
|
263
259
|
ctx: [],
|
|
264
260
|
// state
|
|
265
261
|
props: s,
|
|
266
|
-
update:
|
|
262
|
+
update: H,
|
|
267
263
|
not_equal: i,
|
|
268
|
-
bound:
|
|
264
|
+
bound: bt(),
|
|
269
265
|
// lifecycle
|
|
270
266
|
on_mount: [],
|
|
271
267
|
on_destroy: [],
|
|
@@ -274,23 +270,23 @@ function ne(e, t, n, o, i, s, r = null, l = [-1]) {
|
|
|
274
270
|
after_update: [],
|
|
275
271
|
context: new Map(t.context || (a ? a.$$.context : [])),
|
|
276
272
|
// everything else
|
|
277
|
-
callbacks:
|
|
273
|
+
callbacks: bt(),
|
|
278
274
|
dirty: l,
|
|
279
275
|
skip_bound: !1,
|
|
280
276
|
root: t.target || a.$$.root
|
|
281
277
|
};
|
|
282
278
|
r && r(c.root);
|
|
283
|
-
let
|
|
284
|
-
if (c.ctx = n ? n(e, t.props || {}, (
|
|
285
|
-
const m =
|
|
286
|
-
return c.ctx && i(c.ctx[
|
|
287
|
-
}) : [], c.update(),
|
|
279
|
+
let u = !1;
|
|
280
|
+
if (c.ctx = n ? n(e, t.props || {}, (f, g, ...h) => {
|
|
281
|
+
const m = h.length ? h[0] : g;
|
|
282
|
+
return c.ctx && i(c.ctx[f], c.ctx[f] = m) && (!c.skip_bound && c.bound[f] && c.bound[f](m), u && Mn(e, f)), g;
|
|
283
|
+
}) : [], c.update(), u = !0, de(c.before_update), c.fragment = o ? o(c.ctx) : !1, t.target) {
|
|
288
284
|
if (t.hydrate) {
|
|
289
|
-
const
|
|
290
|
-
c.fragment && c.fragment.l(
|
|
285
|
+
const f = bn(t.target);
|
|
286
|
+
c.fragment && c.fragment.l(f), f.forEach(k);
|
|
291
287
|
} else
|
|
292
288
|
c.fragment && c.fragment.c();
|
|
293
|
-
t.intro &&
|
|
289
|
+
t.intro && B(e.$$.fragment), x(e, t.target, t.anchor), en();
|
|
294
290
|
}
|
|
295
291
|
De(a);
|
|
296
292
|
}
|
|
@@ -303,7 +299,7 @@ class oe {
|
|
|
303
299
|
*
|
|
304
300
|
* @type {any}
|
|
305
301
|
*/
|
|
306
|
-
|
|
302
|
+
$e(this, "$$");
|
|
307
303
|
/**
|
|
308
304
|
* ### PRIVATE API
|
|
309
305
|
*
|
|
@@ -311,11 +307,11 @@ class oe {
|
|
|
311
307
|
*
|
|
312
308
|
* @type {any}
|
|
313
309
|
*/
|
|
314
|
-
|
|
310
|
+
$e(this, "$$set");
|
|
315
311
|
}
|
|
316
312
|
/** @returns {void} */
|
|
317
313
|
$destroy() {
|
|
318
|
-
|
|
314
|
+
$(this, 1), this.$destroy = H;
|
|
319
315
|
}
|
|
320
316
|
/**
|
|
321
317
|
* @template {Extract<keyof Events, string>} K
|
|
@@ -325,7 +321,7 @@ class oe {
|
|
|
325
321
|
*/
|
|
326
322
|
$on(t, n) {
|
|
327
323
|
if (!q(n))
|
|
328
|
-
return
|
|
324
|
+
return H;
|
|
329
325
|
const o = this.$$.callbacks[t] || (this.$$.callbacks[t] = []);
|
|
330
326
|
return o.push(n), () => {
|
|
331
327
|
const i = o.indexOf(n);
|
|
@@ -337,26 +333,26 @@ class oe {
|
|
|
337
333
|
* @returns {void}
|
|
338
334
|
*/
|
|
339
335
|
$set(t) {
|
|
340
|
-
this.$$set && !
|
|
336
|
+
this.$$set && !mn(t) && (this.$$.skip_bound = !0, this.$$set(t), this.$$.skip_bound = !1);
|
|
341
337
|
}
|
|
342
338
|
}
|
|
343
339
|
const Ln = "4";
|
|
344
340
|
typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(Ln);
|
|
345
341
|
var W = /* @__PURE__ */ ((e) => (e.ELLIPSE = "ELLIPSE", e.POLYGON = "POLYGON", e.RECTANGLE = "RECTANGLE", e))(W || {});
|
|
346
|
-
const
|
|
342
|
+
const pt = {}, yt = (e, t) => pt[e] = t, gt = (e) => pt[e.type].area(e), kn = (e, t, n) => pt[e.type].intersects(e, t, n), Qe = (e) => {
|
|
347
343
|
let t = 1 / 0, n = 1 / 0, o = -1 / 0, i = -1 / 0;
|
|
348
344
|
return e.forEach(([s, r]) => {
|
|
349
345
|
t = Math.min(t, s), n = Math.min(n, r), o = Math.max(o, s), i = Math.max(i, r);
|
|
350
346
|
}), { minX: t, minY: n, maxX: o, maxY: i };
|
|
351
|
-
},
|
|
347
|
+
}, In = {
|
|
352
348
|
area: (e) => Math.PI * e.geometry.rx * e.geometry.ry,
|
|
353
349
|
intersects: (e, t, n) => {
|
|
354
|
-
const { cx: o, cy: i, rx: s, ry: r } = e.geometry, l = 0, a = Math.cos(l), c = Math.sin(l),
|
|
355
|
-
return
|
|
350
|
+
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, g = a * u + c * f, h = c * u - a * f;
|
|
351
|
+
return g * g / (s * s) + h * h / (r * r) <= 1;
|
|
356
352
|
}
|
|
357
353
|
};
|
|
358
|
-
|
|
359
|
-
const
|
|
354
|
+
yt(W.ELLIPSE, In);
|
|
355
|
+
const On = {
|
|
360
356
|
area: (e) => {
|
|
361
357
|
const { points: t } = e.geometry;
|
|
362
358
|
let n = 0, o = t.length - 1;
|
|
@@ -368,35 +364,38 @@ const In = {
|
|
|
368
364
|
const { points: o } = e.geometry;
|
|
369
365
|
let i = !1;
|
|
370
366
|
for (let s = 0, r = o.length - 1; s < o.length; r = s++) {
|
|
371
|
-
const l = o[s][0], a = o[s][1], c = o[r][0],
|
|
372
|
-
a > n !=
|
|
367
|
+
const l = o[s][0], a = o[s][1], c = o[r][0], u = o[r][1];
|
|
368
|
+
a > n != u > n && t < (c - l) * (n - a) / (u - a) + l && (i = !i);
|
|
373
369
|
}
|
|
374
370
|
return i;
|
|
375
371
|
}
|
|
376
372
|
};
|
|
377
|
-
|
|
373
|
+
yt(W.POLYGON, On);
|
|
378
374
|
const Bn = {
|
|
379
375
|
area: (e) => e.geometry.w * e.geometry.h,
|
|
380
376
|
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
|
|
381
377
|
};
|
|
382
|
-
|
|
383
|
-
const
|
|
384
|
-
|
|
378
|
+
yt(W.RECTANGLE, Bn);
|
|
379
|
+
const Ze = (e) => qe(e.target), qe = (e) => {
|
|
380
|
+
var t, n;
|
|
381
|
+
return (e == null ? void 0 : e.annotation) !== void 0 && ((n = (t = e == null ? void 0 : e.selector) == null ? void 0 : t.geometry) == null ? void 0 : n.bounds) !== void 0;
|
|
382
|
+
}, Pn = (e, t = !1) => {
|
|
383
|
+
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;
|
|
385
384
|
if (r !== "xywh") throw new Error("Unsupported MediaFragment: " + n);
|
|
386
385
|
if (l && l !== "pixel") throw new Error(`Unsupported MediaFragment unit: ${l}`);
|
|
387
|
-
const [
|
|
386
|
+
const [g, h, m, y] = [a, c, u, f].map(parseFloat);
|
|
388
387
|
return {
|
|
389
388
|
type: W.RECTANGLE,
|
|
390
389
|
geometry: {
|
|
391
|
-
x:
|
|
392
|
-
y:
|
|
390
|
+
x: g,
|
|
391
|
+
y: h,
|
|
393
392
|
w: m,
|
|
394
|
-
h:
|
|
393
|
+
h: y,
|
|
395
394
|
bounds: {
|
|
396
|
-
minX:
|
|
397
|
-
minY: t ?
|
|
398
|
-
maxX:
|
|
399
|
-
maxY: t ?
|
|
395
|
+
minX: g,
|
|
396
|
+
minY: t ? h - y : h,
|
|
397
|
+
maxX: g + m,
|
|
398
|
+
maxY: t ? h : h + y
|
|
400
399
|
}
|
|
401
400
|
}
|
|
402
401
|
};
|
|
@@ -407,7 +406,7 @@ const Pn = (e, t = !1) => {
|
|
|
407
406
|
conformsTo: "http://www.w3.org/TR/media-frags/",
|
|
408
407
|
value: `xywh=pixel:${t},${n},${o},${i}`
|
|
409
408
|
};
|
|
410
|
-
},
|
|
409
|
+
}, tn = "http://www.w3.org/2000/svg", St = (e) => {
|
|
411
410
|
const t = (o) => {
|
|
412
411
|
Array.from(o.attributes).forEach((i) => {
|
|
413
412
|
i.name.startsWith("on") && o.removeAttribute(i.name);
|
|
@@ -415,18 +414,18 @@ const Pn = (e, t = !1) => {
|
|
|
415
414
|
}, n = e.getElementsByTagName("script");
|
|
416
415
|
return Array.from(n).reverse().forEach((o) => o.parentNode.removeChild(o)), Array.from(e.querySelectorAll("*")).forEach(t), e;
|
|
417
416
|
}, Dn = (e) => {
|
|
418
|
-
const o = new XMLSerializer().serializeToString(e.documentElement).replace("<svg>", `<svg xmlns="${
|
|
417
|
+
const o = new XMLSerializer().serializeToString(e.documentElement).replace("<svg>", `<svg xmlns="${tn}">`);
|
|
419
418
|
return new DOMParser().parseFromString(o, "image/svg+xml").documentElement;
|
|
420
419
|
}, Xn = (e) => {
|
|
421
|
-
const n = new DOMParser().parseFromString(e, "image/svg+xml"), o = n.lookupPrefix(
|
|
422
|
-
return o || i ?
|
|
420
|
+
const n = new DOMParser().parseFromString(e, "image/svg+xml"), o = n.lookupPrefix(tn), i = n.lookupNamespaceURI(null);
|
|
421
|
+
return o || i ? St(n).firstChild : St(Dn(n)).firstChild;
|
|
423
422
|
}, Rn = (e) => {
|
|
424
423
|
const [t, n, o] = e.match(/(<polygon points=["|'])([^("|')]*)/) || [], i = o.split(" ").map((s) => s.split(",").map(parseFloat));
|
|
425
424
|
return {
|
|
426
425
|
type: W.POLYGON,
|
|
427
426
|
geometry: {
|
|
428
427
|
points: i,
|
|
429
|
-
bounds:
|
|
428
|
+
bounds: Qe(i)
|
|
430
429
|
}
|
|
431
430
|
};
|
|
432
431
|
}, Cn = (e) => {
|
|
@@ -467,8 +466,8 @@ const Pn = (e, t = !1) => {
|
|
|
467
466
|
throw `Unsupported shape type: ${e.type}`;
|
|
468
467
|
};
|
|
469
468
|
var J = [];
|
|
470
|
-
for (var
|
|
471
|
-
J.push((
|
|
469
|
+
for (var nt = 0; nt < 256; ++nt)
|
|
470
|
+
J.push((nt + 256).toString(16).slice(1));
|
|
472
471
|
function Vn(e, t = 0) {
|
|
473
472
|
return (J[e[t + 0]] + J[e[t + 1]] + J[e[t + 2]] + J[e[t + 3]] + "-" + J[e[t + 4]] + J[e[t + 5]] + "-" + J[e[t + 6]] + J[e[t + 7]] + "-" + J[e[t + 8]] + J[e[t + 9]] + "-" + J[e[t + 10]] + J[e[t + 11]] + J[e[t + 12]] + J[e[t + 13]] + J[e[t + 14]] + J[e[t + 15]]).toLowerCase();
|
|
474
473
|
}
|
|
@@ -479,18 +478,18 @@ function jn() {
|
|
|
479
478
|
return Ge(Gn);
|
|
480
479
|
}
|
|
481
480
|
var zn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
482
|
-
const
|
|
481
|
+
const vt = {
|
|
483
482
|
randomUUID: zn
|
|
484
483
|
};
|
|
485
|
-
function
|
|
486
|
-
if (
|
|
487
|
-
return
|
|
484
|
+
function nn(e, t, n) {
|
|
485
|
+
if (vt.randomUUID && !t && !e)
|
|
486
|
+
return vt.randomUUID();
|
|
488
487
|
e = e || {};
|
|
489
488
|
var o = e.random || (e.rng || jn)();
|
|
490
489
|
return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, Vn(o);
|
|
491
490
|
}
|
|
492
|
-
var
|
|
493
|
-
function
|
|
491
|
+
var Tt = Object.prototype.hasOwnProperty;
|
|
492
|
+
function pe(e, t) {
|
|
494
493
|
var n, o;
|
|
495
494
|
if (e === t) return !0;
|
|
496
495
|
if (e && t && (n = e.constructor) === t.constructor) {
|
|
@@ -498,52 +497,52 @@ function ye(e, t) {
|
|
|
498
497
|
if (n === RegExp) return e.toString() === t.toString();
|
|
499
498
|
if (n === Array) {
|
|
500
499
|
if ((o = e.length) === t.length)
|
|
501
|
-
for (; o-- &&
|
|
500
|
+
for (; o-- && pe(e[o], t[o]); ) ;
|
|
502
501
|
return o === -1;
|
|
503
502
|
}
|
|
504
503
|
if (!n || typeof e == "object") {
|
|
505
504
|
o = 0;
|
|
506
505
|
for (n in e)
|
|
507
|
-
if (
|
|
506
|
+
if (Tt.call(e, n) && ++o && !Tt.call(t, n) || !(n in t) || !pe(e[n], t[n])) return !1;
|
|
508
507
|
return Object.keys(t).length === o;
|
|
509
508
|
}
|
|
510
509
|
}
|
|
511
510
|
return e !== e && t !== t;
|
|
512
511
|
}
|
|
513
|
-
function
|
|
512
|
+
function ot() {
|
|
514
513
|
}
|
|
515
514
|
function Hn(e, t) {
|
|
516
515
|
return e != e ? t == t : e !== t || e && typeof e == "object" || typeof e == "function";
|
|
517
516
|
}
|
|
518
|
-
const
|
|
519
|
-
function
|
|
517
|
+
const we = [];
|
|
518
|
+
function _t(e, t = ot) {
|
|
520
519
|
let n;
|
|
521
520
|
const o = /* @__PURE__ */ new Set();
|
|
522
521
|
function i(l) {
|
|
523
522
|
if (Hn(e, l) && (e = l, n)) {
|
|
524
|
-
const a = !
|
|
523
|
+
const a = !we.length;
|
|
525
524
|
for (const c of o)
|
|
526
|
-
c[1](),
|
|
525
|
+
c[1](), we.push(c, e);
|
|
527
526
|
if (a) {
|
|
528
|
-
for (let c = 0; c <
|
|
529
|
-
|
|
530
|
-
|
|
527
|
+
for (let c = 0; c < we.length; c += 2)
|
|
528
|
+
we[c][0](we[c + 1]);
|
|
529
|
+
we.length = 0;
|
|
531
530
|
}
|
|
532
531
|
}
|
|
533
532
|
}
|
|
534
533
|
function s(l) {
|
|
535
534
|
i(l(e));
|
|
536
535
|
}
|
|
537
|
-
function r(l, a =
|
|
536
|
+
function r(l, a = ot) {
|
|
538
537
|
const c = [l, a];
|
|
539
|
-
return o.add(c), o.size === 1 && (n = t(i, s) ||
|
|
538
|
+
return o.add(c), o.size === 1 && (n = t(i, s) || ot), l(e), () => {
|
|
540
539
|
o.delete(c), o.size === 0 && n && (n(), n = null);
|
|
541
540
|
};
|
|
542
541
|
}
|
|
543
542
|
return { set: i, update: s, subscribe: r };
|
|
544
543
|
}
|
|
545
544
|
const Fn = (e) => {
|
|
546
|
-
const { subscribe: t, set: n } =
|
|
545
|
+
const { subscribe: t, set: n } = _t();
|
|
547
546
|
let o;
|
|
548
547
|
return t((i) => o = i), e.observe(({ changes: i }) => {
|
|
549
548
|
if (o) {
|
|
@@ -559,75 +558,75 @@ const Fn = (e) => {
|
|
|
559
558
|
set: n
|
|
560
559
|
};
|
|
561
560
|
};
|
|
562
|
-
var
|
|
563
|
-
const je = { selected: [] }, Wn = (e) => {
|
|
564
|
-
const { subscribe:
|
|
565
|
-
let
|
|
566
|
-
|
|
567
|
-
const
|
|
568
|
-
|
|
569
|
-
},
|
|
570
|
-
var
|
|
571
|
-
return ((
|
|
572
|
-
},
|
|
573
|
-
if (
|
|
561
|
+
var on = /* @__PURE__ */ ((e) => (e.EDIT = "EDIT", e.SELECT = "SELECT", e.NONE = "NONE", e))(on || {});
|
|
562
|
+
const je = { selected: [] }, Wn = (e, t) => {
|
|
563
|
+
const { subscribe: n, set: o } = _t(je);
|
|
564
|
+
let i = t, s = je;
|
|
565
|
+
n((h) => s = h);
|
|
566
|
+
const r = () => {
|
|
567
|
+
pe(s, je) || o(je);
|
|
568
|
+
}, l = () => {
|
|
569
|
+
var h;
|
|
570
|
+
return ((h = s.selected) == null ? void 0 : h.length) === 0;
|
|
571
|
+
}, a = (h) => {
|
|
572
|
+
if (l())
|
|
574
573
|
return !1;
|
|
575
|
-
const
|
|
576
|
-
return
|
|
577
|
-
},
|
|
578
|
-
const
|
|
579
|
-
if (!
|
|
580
|
-
console.warn("Invalid selection: " +
|
|
574
|
+
const m = typeof h == "string" ? h : h.id;
|
|
575
|
+
return s.selected.some((y) => y.id === m);
|
|
576
|
+
}, c = (h, m) => {
|
|
577
|
+
const y = e.getAnnotation(h);
|
|
578
|
+
if (!y) {
|
|
579
|
+
console.warn("Invalid selection: " + h);
|
|
581
580
|
return;
|
|
582
581
|
}
|
|
583
|
-
switch (
|
|
582
|
+
switch (Mt(y, i)) {
|
|
584
583
|
case "EDIT":
|
|
585
|
-
|
|
584
|
+
o({ selected: [{ id: h, editable: !0 }], event: m });
|
|
586
585
|
break;
|
|
587
586
|
case "SELECT":
|
|
588
|
-
|
|
587
|
+
o({ selected: [{ id: h }], event: m });
|
|
589
588
|
break;
|
|
590
589
|
default:
|
|
591
|
-
|
|
590
|
+
o({ selected: [], event: m });
|
|
592
591
|
}
|
|
593
|
-
},
|
|
594
|
-
const
|
|
595
|
-
|
|
596
|
-
selected:
|
|
597
|
-
const
|
|
598
|
-
return { id:
|
|
592
|
+
}, u = (h, m) => {
|
|
593
|
+
const y = Array.isArray(h) ? h : [h], T = y.map((p) => e.getAnnotation(p)).filter((p) => !!p);
|
|
594
|
+
o({
|
|
595
|
+
selected: T.map((p) => {
|
|
596
|
+
const w = m === void 0 ? Mt(p, i) === "EDIT" : m;
|
|
597
|
+
return { id: p.id, editable: w };
|
|
599
598
|
})
|
|
600
|
-
}),
|
|
601
|
-
}, f = (
|
|
602
|
-
if (
|
|
599
|
+
}), T.length !== y.length && console.warn("Invalid selection", h);
|
|
600
|
+
}, f = (h) => {
|
|
601
|
+
if (l())
|
|
603
602
|
return !1;
|
|
604
|
-
const { selected:
|
|
605
|
-
|
|
606
|
-
},
|
|
603
|
+
const { selected: m } = s;
|
|
604
|
+
m.some(({ id: y }) => h.includes(y)) && o({ selected: m.filter(({ id: y }) => !h.includes(y)) });
|
|
605
|
+
}, g = (h) => i = h;
|
|
607
606
|
return e.observe(
|
|
608
|
-
({ changes:
|
|
607
|
+
({ changes: h }) => f((h.deleted || []).map((m) => m.id))
|
|
609
608
|
), {
|
|
610
609
|
get event() {
|
|
611
|
-
return
|
|
610
|
+
return s ? s.event : null;
|
|
612
611
|
},
|
|
613
612
|
get selected() {
|
|
614
|
-
return
|
|
613
|
+
return s ? [...s.selected] : null;
|
|
615
614
|
},
|
|
616
615
|
get userSelectAction() {
|
|
617
|
-
return
|
|
616
|
+
return i;
|
|
618
617
|
},
|
|
619
|
-
clear:
|
|
620
|
-
isEmpty:
|
|
621
|
-
isSelected:
|
|
622
|
-
setSelected:
|
|
623
|
-
setUserSelectAction:
|
|
624
|
-
subscribe:
|
|
625
|
-
userSelect:
|
|
618
|
+
clear: r,
|
|
619
|
+
isEmpty: l,
|
|
620
|
+
isSelected: a,
|
|
621
|
+
setSelected: u,
|
|
622
|
+
setUserSelectAction: g,
|
|
623
|
+
subscribe: n,
|
|
624
|
+
userSelect: c
|
|
626
625
|
};
|
|
627
|
-
},
|
|
626
|
+
}, Mt = (e, t) => typeof t == "function" ? t(e) : t || "EDIT";
|
|
628
627
|
var Q = [];
|
|
629
|
-
for (var
|
|
630
|
-
Q.push((
|
|
628
|
+
for (var it = 0; it < 256; ++it)
|
|
629
|
+
Q.push((it + 256).toString(16).slice(1));
|
|
631
630
|
function qn(e, t = 0) {
|
|
632
631
|
return (Q[e[t + 0]] + Q[e[t + 1]] + Q[e[t + 2]] + Q[e[t + 3]] + "-" + Q[e[t + 4]] + Q[e[t + 5]] + "-" + Q[e[t + 6]] + Q[e[t + 7]] + "-" + Q[e[t + 8]] + Q[e[t + 9]] + "-" + Q[e[t + 10]] + Q[e[t + 11]] + Q[e[t + 12]] + Q[e[t + 13]] + Q[e[t + 14]] + Q[e[t + 15]]).toLowerCase();
|
|
633
632
|
}
|
|
@@ -638,12 +637,12 @@ function Jn() {
|
|
|
638
637
|
return ze(Kn);
|
|
639
638
|
}
|
|
640
639
|
var Qn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
641
|
-
const
|
|
640
|
+
const Lt = {
|
|
642
641
|
randomUUID: Qn
|
|
643
642
|
};
|
|
644
643
|
function Zn(e, t, n) {
|
|
645
|
-
if (
|
|
646
|
-
return
|
|
644
|
+
if (Lt.randomUUID && !t && !e)
|
|
645
|
+
return Lt.randomUUID();
|
|
647
646
|
e = e || {};
|
|
648
647
|
var o = e.random || (e.rng || Jn)();
|
|
649
648
|
return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, qn(o);
|
|
@@ -656,8 +655,8 @@ const xn = (e, t) => {
|
|
|
656
655
|
return e.bodies.filter((o) => !n.has(o.id));
|
|
657
656
|
}, eo = (e, t) => t.bodies.map((n) => {
|
|
658
657
|
const o = e.bodies.find((i) => i.id === n.id);
|
|
659
|
-
return { newBody: n, oldBody: o && !
|
|
660
|
-
}).filter(({ oldBody: n }) => n).map(({ oldBody: n, newBody: o }) => ({ oldBody: n, newBody: o })), to = (e, t) => !
|
|
658
|
+
return { newBody: n, oldBody: o && !pe(o, n) ? o : void 0 };
|
|
659
|
+
}).filter(({ oldBody: n }) => n).map(({ oldBody: n, newBody: o }) => ({ oldBody: n, newBody: o })), to = (e, t) => !pe(e.target, t.target), sn = (e, t) => {
|
|
661
660
|
const n = xn(e, t), o = $n(e, t), i = eo(e, t);
|
|
662
661
|
return {
|
|
663
662
|
oldValue: e,
|
|
@@ -668,7 +667,7 @@ const xn = (e, t) => {
|
|
|
668
667
|
targetUpdated: to(e, t) ? { oldTarget: e.target, newTarget: t.target } : void 0
|
|
669
668
|
};
|
|
670
669
|
};
|
|
671
|
-
var
|
|
670
|
+
var z = /* @__PURE__ */ ((e) => (e.LOCAL = "LOCAL", e.REMOTE = "REMOTE", e))(z || {});
|
|
672
671
|
const no = (e, t) => {
|
|
673
672
|
var n, o;
|
|
674
673
|
const { changes: i, origin: s } = t;
|
|
@@ -677,7 +676,7 @@ const no = (e, t) => {
|
|
|
677
676
|
if (e.options.ignore) {
|
|
678
677
|
const { ignore: r } = e.options, l = (a) => a && a.length > 0;
|
|
679
678
|
if (!(l(i.created) || l(i.deleted))) {
|
|
680
|
-
const a = (n = i.updated) == null ? void 0 : n.some((
|
|
679
|
+
const a = (n = i.updated) == null ? void 0 : n.some((u) => l(u.bodiesCreated) || l(u.bodiesDeleted) || l(u.bodiesUpdated)), c = (o = i.updated) == null ? void 0 : o.some((u) => u.targetUpdated);
|
|
681
680
|
if (r === "BODY_ONLY" && a && !c || r === "TARGET_ONLY" && c && !a)
|
|
682
681
|
return !1;
|
|
683
682
|
}
|
|
@@ -692,25 +691,25 @@ const no = (e, t) => {
|
|
|
692
691
|
} else
|
|
693
692
|
return !0;
|
|
694
693
|
}, oo = (e, t) => {
|
|
695
|
-
const n = new Set((e.created || []).map((
|
|
696
|
-
...(e.created || []).filter((
|
|
694
|
+
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 = [
|
|
695
|
+
...(e.created || []).filter((f) => !s.has(f.id)).map((f) => r.has(f.id) ? t.updated.find(({ oldValue: g }) => g.id === f.id).newValue : f),
|
|
697
696
|
...t.created || []
|
|
698
697
|
], c = [
|
|
699
|
-
...(e.deleted || []).filter((
|
|
700
|
-
...(t.deleted || []).filter((
|
|
701
|
-
],
|
|
702
|
-
...(e.updated || []).filter(({ newValue:
|
|
703
|
-
const { oldValue:
|
|
704
|
-
if (r.has(
|
|
705
|
-
const m = t.updated.find((
|
|
706
|
-
return
|
|
698
|
+
...(e.deleted || []).filter((f) => !i.has(f.id)),
|
|
699
|
+
...(t.deleted || []).filter((f) => !n.has(f.id))
|
|
700
|
+
], u = [
|
|
701
|
+
...(e.updated || []).filter(({ newValue: f }) => !s.has(f.id)).map((f) => {
|
|
702
|
+
const { oldValue: g, newValue: h } = f;
|
|
703
|
+
if (r.has(h.id)) {
|
|
704
|
+
const m = t.updated.find((y) => y.oldValue.id === h.id).newValue;
|
|
705
|
+
return sn(g, m);
|
|
707
706
|
} else
|
|
708
|
-
return
|
|
707
|
+
return f;
|
|
709
708
|
}),
|
|
710
|
-
...(t.updated || []).filter(({ oldValue:
|
|
709
|
+
...(t.updated || []).filter(({ oldValue: f }) => !l.has(f.id))
|
|
711
710
|
];
|
|
712
|
-
return { created: a, deleted: c, updated:
|
|
713
|
-
},
|
|
711
|
+
return { created: a, deleted: c, updated: u };
|
|
712
|
+
}, st = (e) => {
|
|
714
713
|
const t = e.id === void 0 ? Zn() : e.id;
|
|
715
714
|
return {
|
|
716
715
|
...e,
|
|
@@ -738,56 +737,56 @@ const no = (e, t) => {
|
|
|
738
737
|
},
|
|
739
738
|
state: [...e.values()]
|
|
740
739
|
};
|
|
741
|
-
n.forEach((
|
|
742
|
-
no(
|
|
740
|
+
n.forEach((v) => {
|
|
741
|
+
no(v, S) && v.onChange(S);
|
|
743
742
|
});
|
|
744
|
-
}, r = (E, A =
|
|
743
|
+
}, r = (E, A = z.LOCAL) => {
|
|
745
744
|
if (E.id && e.get(E.id))
|
|
746
745
|
throw Error(`Cannot add annotation ${E.id} - exists already`);
|
|
747
746
|
{
|
|
748
|
-
const S =
|
|
749
|
-
e.set(S.id, S), S.bodies.forEach((
|
|
747
|
+
const S = st(E);
|
|
748
|
+
e.set(S.id, S), S.bodies.forEach((v) => t.set(v.id, S.id)), s(A, { created: [S] });
|
|
750
749
|
}
|
|
751
750
|
}, l = (E, A) => {
|
|
752
|
-
const S =
|
|
751
|
+
const S = st(typeof E == "string" ? A : E), v = typeof E == "string" ? E : E.id, N = v && e.get(v);
|
|
753
752
|
if (N) {
|
|
754
|
-
const X =
|
|
755
|
-
return
|
|
753
|
+
const X = sn(N, S);
|
|
754
|
+
return v === S.id ? e.set(v, S) : (e.delete(v), e.set(S.id, S)), N.bodies.forEach((K) => t.delete(K.id)), S.bodies.forEach((K) => t.set(K.id, S.id)), X;
|
|
756
755
|
} else
|
|
757
|
-
console.warn(`Cannot update annotation ${
|
|
758
|
-
}, a = (E, A =
|
|
759
|
-
const
|
|
760
|
-
N && s(
|
|
761
|
-
}, c = (E, A =
|
|
762
|
-
const S = E.reduce((
|
|
756
|
+
console.warn(`Cannot update annotation ${v} - does not exist`);
|
|
757
|
+
}, a = (E, A = z.LOCAL, S = z.LOCAL) => {
|
|
758
|
+
const v = io(A) ? S : A, N = l(E, A);
|
|
759
|
+
N && s(v, { updated: [N] });
|
|
760
|
+
}, c = (E, A = z.LOCAL) => {
|
|
761
|
+
const S = E.reduce((v, N) => {
|
|
763
762
|
const X = l(N);
|
|
764
|
-
return X ? [...
|
|
763
|
+
return X ? [...v, X] : v;
|
|
765
764
|
}, []);
|
|
766
765
|
S.length > 0 && s(A, { updated: S });
|
|
767
|
-
},
|
|
766
|
+
}, u = (E, A = z.LOCAL) => {
|
|
768
767
|
const S = e.get(E.annotation);
|
|
769
768
|
if (S) {
|
|
770
|
-
const
|
|
769
|
+
const v = {
|
|
771
770
|
...S,
|
|
772
771
|
bodies: [...S.bodies, E]
|
|
773
772
|
};
|
|
774
|
-
e.set(S.id,
|
|
773
|
+
e.set(S.id, v), t.set(E.id, v.id), s(A, { updated: [{
|
|
775
774
|
oldValue: S,
|
|
776
|
-
newValue:
|
|
775
|
+
newValue: v,
|
|
777
776
|
bodiesCreated: [E]
|
|
778
777
|
}] });
|
|
779
778
|
} else
|
|
780
779
|
console.warn(`Attempt to add body to missing annotation: ${E.annotation}`);
|
|
781
|
-
},
|
|
780
|
+
}, f = () => [...e.values()], g = (E = z.LOCAL) => {
|
|
782
781
|
const A = [...e.values()];
|
|
783
782
|
e.clear(), t.clear(), s(E, { deleted: A });
|
|
784
|
-
},
|
|
785
|
-
const
|
|
783
|
+
}, h = (E, A = !0, S = z.LOCAL) => {
|
|
784
|
+
const v = E.map(st);
|
|
786
785
|
if (A) {
|
|
787
786
|
const N = [...e.values()];
|
|
788
|
-
e.clear(), t.clear(),
|
|
787
|
+
e.clear(), t.clear(), v.forEach((X) => {
|
|
789
788
|
e.set(X.id, X), X.bodies.forEach((K) => t.set(K.id, X.id));
|
|
790
|
-
}), s(S, { created:
|
|
789
|
+
}), s(S, { created: v, deleted: N });
|
|
791
790
|
} else {
|
|
792
791
|
const N = E.reduce((X, K) => {
|
|
793
792
|
const ge = K.id && e.get(K.id);
|
|
@@ -795,56 +794,56 @@ const no = (e, t) => {
|
|
|
795
794
|
}, []);
|
|
796
795
|
if (N.length > 0)
|
|
797
796
|
throw Error(`Bulk insert would overwrite the following annotations: ${N.map((X) => X.id).join(", ")}`);
|
|
798
|
-
|
|
797
|
+
v.forEach((X) => {
|
|
799
798
|
e.set(X.id, X), X.bodies.forEach((K) => t.set(K.id, X.id));
|
|
800
|
-
}), s(S, { created:
|
|
799
|
+
}), s(S, { created: v });
|
|
801
800
|
}
|
|
802
801
|
}, m = (E) => {
|
|
803
802
|
const A = typeof E == "string" ? E : E.id, S = e.get(A);
|
|
804
803
|
if (S)
|
|
805
|
-
return e.delete(A), S.bodies.forEach((
|
|
804
|
+
return e.delete(A), S.bodies.forEach((v) => t.delete(v.id)), S;
|
|
806
805
|
console.warn(`Attempt to delete missing annotation: ${A}`);
|
|
807
|
-
},
|
|
806
|
+
}, y = (E, A = z.LOCAL) => {
|
|
808
807
|
const S = m(E);
|
|
809
808
|
S && s(A, { deleted: [S] });
|
|
810
|
-
},
|
|
811
|
-
const S = E.reduce((
|
|
809
|
+
}, T = (E, A = z.LOCAL) => {
|
|
810
|
+
const S = E.reduce((v, N) => {
|
|
812
811
|
const X = m(N);
|
|
813
|
-
return X ? [...
|
|
812
|
+
return X ? [...v, X] : v;
|
|
814
813
|
}, []);
|
|
815
814
|
S.length > 0 && s(A, { deleted: S });
|
|
816
815
|
}, p = (E) => {
|
|
817
816
|
const A = e.get(E.annotation);
|
|
818
817
|
if (A) {
|
|
819
|
-
const S = A.bodies.find((
|
|
818
|
+
const S = A.bodies.find((v) => v.id === E.id);
|
|
820
819
|
if (S) {
|
|
821
820
|
t.delete(S.id);
|
|
822
|
-
const
|
|
821
|
+
const v = {
|
|
823
822
|
...A,
|
|
824
823
|
bodies: A.bodies.filter((N) => N.id !== E.id)
|
|
825
824
|
};
|
|
826
|
-
return e.set(A.id,
|
|
825
|
+
return e.set(A.id, v), {
|
|
827
826
|
oldValue: A,
|
|
828
|
-
newValue:
|
|
827
|
+
newValue: v,
|
|
829
828
|
bodiesDeleted: [S]
|
|
830
829
|
};
|
|
831
830
|
} else
|
|
832
831
|
console.warn(`Attempt to delete missing body ${E.id} from annotation ${E.annotation}`);
|
|
833
832
|
} else
|
|
834
833
|
console.warn(`Attempt to delete body from missing annotation ${E.annotation}`);
|
|
835
|
-
}, w = (E, A =
|
|
834
|
+
}, w = (E, A = z.LOCAL) => {
|
|
836
835
|
const S = p(E);
|
|
837
836
|
S && s(A, { updated: [S] });
|
|
838
|
-
},
|
|
839
|
-
const S = E.map((
|
|
837
|
+
}, _ = (E, A = z.LOCAL) => {
|
|
838
|
+
const S = E.map((v) => p(v)).filter(Boolean);
|
|
840
839
|
S.length > 0 && s(A, { updated: S });
|
|
841
840
|
}, b = (E) => {
|
|
842
841
|
const A = e.get(E);
|
|
843
842
|
return A ? { ...A } : void 0;
|
|
844
|
-
},
|
|
843
|
+
}, Y = (E) => {
|
|
845
844
|
const A = t.get(E);
|
|
846
845
|
if (A) {
|
|
847
|
-
const S = b(A).bodies.find((
|
|
846
|
+
const S = b(A).bodies.find((v) => v.id === E);
|
|
848
847
|
if (S)
|
|
849
848
|
return S;
|
|
850
849
|
console.error(`Store integrity error: body ${E} in index, but not in annotation`);
|
|
@@ -855,24 +854,24 @@ const no = (e, t) => {
|
|
|
855
854
|
throw "Annotation integrity violation: annotation ID must be the same when updating bodies";
|
|
856
855
|
const S = e.get(E.annotation);
|
|
857
856
|
if (S) {
|
|
858
|
-
const
|
|
857
|
+
const v = S.bodies.find((X) => X.id === E.id), N = {
|
|
859
858
|
...S,
|
|
860
|
-
bodies: S.bodies.map((X) => X.id ===
|
|
859
|
+
bodies: S.bodies.map((X) => X.id === v.id ? A : X)
|
|
861
860
|
};
|
|
862
|
-
return e.set(S.id, N),
|
|
861
|
+
return e.set(S.id, N), v.id !== A.id && (t.delete(v.id), t.set(A.id, N.id)), {
|
|
863
862
|
oldValue: S,
|
|
864
863
|
newValue: N,
|
|
865
|
-
bodiesUpdated: [{ oldBody:
|
|
864
|
+
bodiesUpdated: [{ oldBody: v, newBody: A }]
|
|
866
865
|
};
|
|
867
866
|
} else
|
|
868
867
|
console.warn(`Attempt to add body to missing annotation ${E.annotation}`);
|
|
869
|
-
}, V = (E, A, S =
|
|
870
|
-
const
|
|
871
|
-
|
|
872
|
-
}, G = (E, A =
|
|
873
|
-
const S = E.map((
|
|
868
|
+
}, V = (E, A, S = z.LOCAL) => {
|
|
869
|
+
const v = U(E, A);
|
|
870
|
+
v && s(S, { updated: [v] });
|
|
871
|
+
}, G = (E, A = z.LOCAL) => {
|
|
872
|
+
const S = E.map((v) => U({ id: v.id, annotation: v.annotation }, v)).filter(Boolean);
|
|
874
873
|
s(A, { updated: S });
|
|
875
|
-
},
|
|
874
|
+
}, P = (E) => {
|
|
876
875
|
const A = e.get(E.annotation);
|
|
877
876
|
if (A) {
|
|
878
877
|
const S = {
|
|
@@ -895,28 +894,28 @@ const no = (e, t) => {
|
|
|
895
894
|
};
|
|
896
895
|
return {
|
|
897
896
|
addAnnotation: r,
|
|
898
|
-
addBody:
|
|
899
|
-
all:
|
|
900
|
-
bulkAddAnnotation:
|
|
901
|
-
bulkDeleteAnnotation:
|
|
902
|
-
bulkDeleteBodies:
|
|
897
|
+
addBody: u,
|
|
898
|
+
all: f,
|
|
899
|
+
bulkAddAnnotation: h,
|
|
900
|
+
bulkDeleteAnnotation: T,
|
|
901
|
+
bulkDeleteBodies: _,
|
|
903
902
|
bulkUpdateAnnotation: c,
|
|
904
903
|
bulkUpdateBodies: G,
|
|
905
|
-
bulkUpdateTargets: (E, A =
|
|
906
|
-
const S = E.map((
|
|
904
|
+
bulkUpdateTargets: (E, A = z.LOCAL) => {
|
|
905
|
+
const S = E.map((v) => P(v)).filter(Boolean);
|
|
907
906
|
S.length > 0 && s(A, { updated: S });
|
|
908
907
|
},
|
|
909
|
-
clear:
|
|
910
|
-
deleteAnnotation:
|
|
908
|
+
clear: g,
|
|
909
|
+
deleteAnnotation: y,
|
|
911
910
|
deleteBody: w,
|
|
912
911
|
getAnnotation: b,
|
|
913
|
-
getBody:
|
|
912
|
+
getBody: Y,
|
|
914
913
|
observe: o,
|
|
915
914
|
unobserve: i,
|
|
916
915
|
updateAnnotation: a,
|
|
917
916
|
updateBody: V,
|
|
918
|
-
updateTarget: (E, A =
|
|
919
|
-
const S =
|
|
917
|
+
updateTarget: (E, A = z.LOCAL) => {
|
|
918
|
+
const S = P(E);
|
|
920
919
|
S && s(A, { updated: [S] });
|
|
921
920
|
}
|
|
922
921
|
};
|
|
@@ -944,74 +943,74 @@ let lo = () => ({
|
|
|
944
943
|
const ao = 250, co = (e) => {
|
|
945
944
|
const t = lo(), n = [];
|
|
946
945
|
let o = -1, i = !1, s = 0;
|
|
947
|
-
const r = (
|
|
946
|
+
const r = (h) => {
|
|
948
947
|
if (!i) {
|
|
949
|
-
const { changes: m } =
|
|
950
|
-
if (
|
|
948
|
+
const { changes: m } = h, y = performance.now();
|
|
949
|
+
if (y - s > ao)
|
|
951
950
|
n.splice(o + 1), n.push(m), o = n.length - 1;
|
|
952
951
|
else {
|
|
953
|
-
const
|
|
954
|
-
n[
|
|
952
|
+
const T = n.length - 1;
|
|
953
|
+
n[T] = oo(n[T], m);
|
|
955
954
|
}
|
|
956
|
-
s =
|
|
955
|
+
s = y;
|
|
957
956
|
}
|
|
958
957
|
i = !1;
|
|
959
958
|
};
|
|
960
|
-
e.observe(r, { origin:
|
|
961
|
-
const l = (
|
|
959
|
+
e.observe(r, { origin: z.LOCAL });
|
|
960
|
+
const l = (h) => h && h.length > 0 && e.bulkDeleteAnnotation(h), a = (h) => h && h.length > 0 && e.bulkAddAnnotation(h, !1), c = (h) => h && h.length > 0 && e.bulkUpdateAnnotation(h.map(({ oldValue: m }) => m)), u = (h) => h && h.length > 0 && e.bulkUpdateAnnotation(h.map(({ newValue: m }) => m)), f = (h) => h && h.length > 0 && e.bulkAddAnnotation(h, !1), g = (h) => h && h.length > 0 && e.bulkDeleteAnnotation(h);
|
|
962
961
|
return {
|
|
963
962
|
canRedo: () => n.length - 1 > o,
|
|
964
963
|
canUndo: () => o > -1,
|
|
965
964
|
destroy: () => e.unobserve(r),
|
|
966
|
-
on: (
|
|
965
|
+
on: (h, m) => t.on(h, m),
|
|
967
966
|
redo: () => {
|
|
968
967
|
if (n.length - 1 > o) {
|
|
969
968
|
i = !0;
|
|
970
|
-
const { created:
|
|
971
|
-
a(
|
|
969
|
+
const { created: h, updated: m, deleted: y } = n[o + 1];
|
|
970
|
+
a(h), u(m), g(y), t.emit("redo", n[o + 1]), o += 1;
|
|
972
971
|
}
|
|
973
972
|
},
|
|
974
973
|
undo: () => {
|
|
975
974
|
if (o > -1) {
|
|
976
975
|
i = !0;
|
|
977
|
-
const { created:
|
|
978
|
-
l(
|
|
976
|
+
const { created: h, updated: m, deleted: y } = n[o];
|
|
977
|
+
l(h), c(m), f(y), t.emit("undo", n[o]), o -= 1;
|
|
979
978
|
}
|
|
980
979
|
}
|
|
981
980
|
};
|
|
982
981
|
}, fo = () => {
|
|
983
|
-
const { subscribe: e, set: t } =
|
|
982
|
+
const { subscribe: e, set: t } = _t([]);
|
|
984
983
|
return {
|
|
985
984
|
subscribe: e,
|
|
986
985
|
set: t
|
|
987
986
|
};
|
|
988
987
|
}, uo = (e, t, n, o) => {
|
|
989
988
|
const { store: i, selection: s, hover: r, viewport: l } = e, a = /* @__PURE__ */ new Map();
|
|
990
|
-
let c = [],
|
|
991
|
-
const
|
|
989
|
+
let c = [], u, f;
|
|
990
|
+
const g = (p, w) => {
|
|
992
991
|
a.has(p) ? a.get(p).push(w) : a.set(p, [w]);
|
|
993
|
-
},
|
|
994
|
-
const
|
|
995
|
-
if (
|
|
996
|
-
const b =
|
|
997
|
-
b !== -1 &&
|
|
992
|
+
}, h = (p, w) => {
|
|
993
|
+
const _ = a.get(p);
|
|
994
|
+
if (_) {
|
|
995
|
+
const b = _.indexOf(w);
|
|
996
|
+
b !== -1 && _.splice(b, 1);
|
|
998
997
|
}
|
|
999
|
-
}, m = (p, w,
|
|
998
|
+
}, m = (p, w, _) => {
|
|
1000
999
|
a.has(p) && setTimeout(() => {
|
|
1001
1000
|
a.get(p).forEach((b) => {
|
|
1002
1001
|
if (n) {
|
|
1003
|
-
const
|
|
1004
|
-
b(
|
|
1002
|
+
const Y = Array.isArray(w) ? w.map((V) => n.serialize(V)) : n.serialize(w), U = _ ? _ instanceof PointerEvent ? _ : n.serialize(_) : void 0;
|
|
1003
|
+
b(Y, U);
|
|
1005
1004
|
} else
|
|
1006
|
-
b(w,
|
|
1005
|
+
b(w, _);
|
|
1007
1006
|
});
|
|
1008
1007
|
}, 1);
|
|
1009
|
-
},
|
|
1010
|
-
const { selected: p } = s, w = (p || []).map(({ id:
|
|
1011
|
-
w.forEach((
|
|
1012
|
-
const b = c.find((
|
|
1013
|
-
(!b || !
|
|
1014
|
-
}), c = c.map((
|
|
1008
|
+
}, y = () => {
|
|
1009
|
+
const { selected: p } = s, w = (p || []).map(({ id: _ }) => i.getAnnotation(_));
|
|
1010
|
+
w.forEach((_) => {
|
|
1011
|
+
const b = c.find((Y) => Y.id === _.id);
|
|
1012
|
+
(!b || !pe(b, _)) && m("updateAnnotation", _, b);
|
|
1013
|
+
}), c = c.map((_) => w.find(({ id: Y }) => Y === _.id) || _);
|
|
1015
1014
|
};
|
|
1016
1015
|
s.subscribe(({ selected: p }) => {
|
|
1017
1016
|
if (!(c.length === 0 && p.length === 0)) {
|
|
@@ -1019,17 +1018,17 @@ const ao = 250, co = (e) => {
|
|
|
1019
1018
|
c = p.map(({ id: w }) => i.getAnnotation(w));
|
|
1020
1019
|
else if (c.length > 0 && p.length === 0)
|
|
1021
1020
|
c.forEach((w) => {
|
|
1022
|
-
const
|
|
1023
|
-
|
|
1021
|
+
const _ = i.getAnnotation(w.id);
|
|
1022
|
+
_ && !pe(_, w) && m("updateAnnotation", _, w);
|
|
1024
1023
|
}), c = [];
|
|
1025
1024
|
else {
|
|
1026
|
-
const w = new Set(c.map((b) => b.id)),
|
|
1027
|
-
c.filter((b) => !
|
|
1028
|
-
const
|
|
1029
|
-
|
|
1025
|
+
const w = new Set(c.map((b) => b.id)), _ = new Set(p.map(({ id: b }) => b));
|
|
1026
|
+
c.filter((b) => !_.has(b.id)).forEach((b) => {
|
|
1027
|
+
const Y = i.getAnnotation(b.id);
|
|
1028
|
+
Y && !pe(Y, b) && m("updateAnnotation", Y, b);
|
|
1030
1029
|
}), c = [
|
|
1031
1030
|
// Remove annotations that were deselected
|
|
1032
|
-
...c.filter((b) =>
|
|
1031
|
+
...c.filter((b) => _.has(b.id)),
|
|
1033
1032
|
// Add editable annotations that were selected
|
|
1034
1033
|
...p.filter(({ id: b }) => !w.has(b)).map(({ id: b }) => i.getAnnotation(b))
|
|
1035
1034
|
];
|
|
@@ -1037,29 +1036,29 @@ const ao = 250, co = (e) => {
|
|
|
1037
1036
|
m("selectionChanged", c);
|
|
1038
1037
|
}
|
|
1039
1038
|
}), r.subscribe((p) => {
|
|
1040
|
-
!
|
|
1039
|
+
!u && p ? m("mouseEnterAnnotation", i.getAnnotation(p)) : u && !p ? m("mouseLeaveAnnotation", i.getAnnotation(u)) : u && p && (m("mouseLeaveAnnotation", i.getAnnotation(u)), m("mouseEnterAnnotation", i.getAnnotation(p))), u = p;
|
|
1041
1040
|
}), l == null || l.subscribe((p) => m("viewportIntersect", p.map((w) => i.getAnnotation(w)))), i.observe((p) => {
|
|
1042
|
-
o && (
|
|
1043
|
-
const { created: w, deleted:
|
|
1044
|
-
(w || []).forEach((b) => m("createAnnotation", b)), (
|
|
1041
|
+
o && (f && clearTimeout(f), f = setTimeout(y, 1e3));
|
|
1042
|
+
const { created: w, deleted: _ } = p.changes;
|
|
1043
|
+
(w || []).forEach((b) => m("createAnnotation", b)), (_ || []).forEach((b) => m("deleteAnnotation", b)), (p.changes.updated || []).filter((b) => [
|
|
1045
1044
|
...b.bodiesCreated || [],
|
|
1046
1045
|
...b.bodiesDeleted || [],
|
|
1047
1046
|
...b.bodiesUpdated || []
|
|
1048
|
-
].length > 0).forEach(({ oldValue: b, newValue:
|
|
1047
|
+
].length > 0).forEach(({ oldValue: b, newValue: Y }) => {
|
|
1049
1048
|
const U = c.find((V) => V.id === b.id) || b;
|
|
1050
|
-
c = c.map((V) => V.id === b.id ?
|
|
1049
|
+
c = c.map((V) => V.id === b.id ? Y : V), m("updateAnnotation", Y, U);
|
|
1051
1050
|
});
|
|
1052
|
-
}, { origin:
|
|
1051
|
+
}, { origin: z.LOCAL }), i.observe((p) => {
|
|
1053
1052
|
if (c) {
|
|
1054
|
-
const w = new Set(c.map((b) => b.id)),
|
|
1055
|
-
|
|
1053
|
+
const w = new Set(c.map((b) => b.id)), _ = (p.changes.updated || []).filter(({ newValue: b }) => w.has(b.id)).map(({ newValue: b }) => b);
|
|
1054
|
+
_.length > 0 && (c = c.map((b) => _.find((U) => U.id === b.id) || b));
|
|
1056
1055
|
}
|
|
1057
|
-
}, { origin:
|
|
1058
|
-
const
|
|
1059
|
-
const { updated:
|
|
1060
|
-
p ? (
|
|
1056
|
+
}, { origin: z.REMOTE });
|
|
1057
|
+
const T = (p) => (w) => {
|
|
1058
|
+
const { updated: _ } = w;
|
|
1059
|
+
p ? (_ || []).forEach((b) => m("updateAnnotation", b.oldValue, b.newValue)) : (_ || []).forEach((b) => m("updateAnnotation", b.newValue, b.oldValue));
|
|
1061
1060
|
};
|
|
1062
|
-
return t.on("undo",
|
|
1061
|
+
return t.on("undo", T(!0)), t.on("redo", T(!1)), { on: g, off: h, emit: m };
|
|
1063
1062
|
}, ho = (e) => (t) => t.reduce((n, o) => {
|
|
1064
1063
|
const { parsed: i, error: s } = e.parse(o);
|
|
1065
1064
|
return s ? {
|
|
@@ -1074,18 +1073,18 @@ const ao = 250, co = (e) => {
|
|
|
1074
1073
|
}, { parsed: [], failed: [] }), go = (e, t, n) => {
|
|
1075
1074
|
const { store: o, selection: i } = e, s = (p) => {
|
|
1076
1075
|
if (n) {
|
|
1077
|
-
const { parsed: w, error:
|
|
1078
|
-
w ? o.addAnnotation(w,
|
|
1076
|
+
const { parsed: w, error: _ } = n.parse(p);
|
|
1077
|
+
w ? o.addAnnotation(w, z.REMOTE) : console.error(_);
|
|
1079
1078
|
} else
|
|
1080
|
-
o.addAnnotation(p,
|
|
1079
|
+
o.addAnnotation(p, z.REMOTE);
|
|
1081
1080
|
}, r = () => i.clear(), l = () => o.clear(), a = (p) => {
|
|
1082
1081
|
const w = o.getAnnotation(p);
|
|
1083
1082
|
return n && w ? n.serialize(w) : w;
|
|
1084
|
-
}, c = () => n ? o.all().map(n.serialize) : o.all(),
|
|
1083
|
+
}, c = () => n ? o.all().map(n.serialize) : o.all(), u = () => {
|
|
1085
1084
|
var p;
|
|
1086
|
-
const w = (((p = i.selected) == null ? void 0 : p.map((
|
|
1085
|
+
const w = (((p = i.selected) == null ? void 0 : p.map((_) => _.id)) || []).map((_) => o.getAnnotation(_)).filter(Boolean);
|
|
1087
1086
|
return n ? w.map(n.serialize) : w;
|
|
1088
|
-
},
|
|
1087
|
+
}, f = (p, w = !0) => fetch(p).then((_) => _.json()).then((_) => (h(_, w), _)), g = (p) => {
|
|
1089
1088
|
if (typeof p == "string") {
|
|
1090
1089
|
const w = o.getAnnotation(p);
|
|
1091
1090
|
if (o.deleteAnnotation(p), w)
|
|
@@ -1095,20 +1094,20 @@ const ao = 250, co = (e) => {
|
|
|
1095
1094
|
if (w)
|
|
1096
1095
|
return o.deleteAnnotation(w), p;
|
|
1097
1096
|
}
|
|
1098
|
-
},
|
|
1097
|
+
}, h = (p, w = !0) => {
|
|
1099
1098
|
if (n) {
|
|
1100
|
-
const { parsed:
|
|
1101
|
-
b.length > 0 && console.warn(`Discarded ${b.length} invalid annotations`, b), o.bulkAddAnnotation(
|
|
1099
|
+
const { parsed: _, failed: b } = ho(n)(p);
|
|
1100
|
+
b.length > 0 && console.warn(`Discarded ${b.length} invalid annotations`, b), o.bulkAddAnnotation(_, w, z.REMOTE);
|
|
1102
1101
|
} else
|
|
1103
|
-
o.bulkAddAnnotation(p, w,
|
|
1102
|
+
o.bulkAddAnnotation(p, w, z.REMOTE);
|
|
1104
1103
|
}, m = (p, w) => {
|
|
1105
1104
|
p ? i.setSelected(p, w) : i.clear();
|
|
1106
|
-
},
|
|
1105
|
+
}, y = (p) => {
|
|
1107
1106
|
i.clear(), i.setUserSelectAction(p);
|
|
1108
|
-
},
|
|
1107
|
+
}, T = (p) => {
|
|
1109
1108
|
if (n) {
|
|
1110
|
-
const w = n.parse(p).parsed,
|
|
1111
|
-
return o.updateAnnotation(w),
|
|
1109
|
+
const w = n.parse(p).parsed, _ = n.serialize(o.getAnnotation(w.id));
|
|
1110
|
+
return o.updateAnnotation(w), _;
|
|
1112
1111
|
} else {
|
|
1113
1112
|
const w = o.getAnnotation(p.id);
|
|
1114
1113
|
return o.updateAnnotation(p), w;
|
|
@@ -1122,15 +1121,15 @@ const ao = 250, co = (e) => {
|
|
|
1122
1121
|
clearAnnotations: l,
|
|
1123
1122
|
getAnnotationById: a,
|
|
1124
1123
|
getAnnotations: c,
|
|
1125
|
-
getSelected:
|
|
1126
|
-
loadAnnotations:
|
|
1124
|
+
getSelected: u,
|
|
1125
|
+
loadAnnotations: f,
|
|
1127
1126
|
redo: t.redo,
|
|
1128
|
-
removeAnnotation:
|
|
1129
|
-
setAnnotations:
|
|
1127
|
+
removeAnnotation: g,
|
|
1128
|
+
setAnnotations: h,
|
|
1130
1129
|
setSelected: m,
|
|
1131
|
-
setUserSelectAction:
|
|
1130
|
+
setUserSelectAction: y,
|
|
1132
1131
|
undo: t.undo,
|
|
1133
|
-
updateAnnotation:
|
|
1132
|
+
updateAnnotation: T
|
|
1134
1133
|
};
|
|
1135
1134
|
}, mo = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
1136
1135
|
let po = (e) => crypto.getRandomValues(new Uint8Array(e)), yo = (e, t, n) => {
|
|
@@ -1157,18 +1156,18 @@ const bo = () => ({ isGuest: !0, id: _o("1234567890abcdefghijklmnopqrstuvwxyzABC
|
|
|
1157
1156
|
n = (n << 5) - n + s, n |= 0;
|
|
1158
1157
|
}
|
|
1159
1158
|
return `${n}`;
|
|
1160
|
-
},
|
|
1161
|
-
const { id: o, type: i, purpose: s, value: r, created: l, modified: a, creator: c, ...
|
|
1159
|
+
}, rn = (e) => e ? typeof e == "object" ? { ...e } : e : void 0, Ao = (e, t) => (Array.isArray(e) ? e : [e]).map((n) => {
|
|
1160
|
+
const { id: o, type: i, purpose: s, value: r, created: l, modified: a, creator: c, ...u } = n;
|
|
1162
1161
|
return {
|
|
1163
1162
|
id: o || `temp-${Eo(n)}`,
|
|
1164
1163
|
annotation: t,
|
|
1165
1164
|
type: i,
|
|
1166
1165
|
purpose: s,
|
|
1167
1166
|
value: r,
|
|
1168
|
-
creator:
|
|
1167
|
+
creator: rn(c),
|
|
1169
1168
|
created: l ? new Date(l) : void 0,
|
|
1170
1169
|
updated: a ? new Date(a) : void 0,
|
|
1171
|
-
...
|
|
1170
|
+
...u
|
|
1172
1171
|
};
|
|
1173
1172
|
}), So = (e) => e.map((t) => {
|
|
1174
1173
|
var n;
|
|
@@ -1181,29 +1180,29 @@ const bo = () => ({ isGuest: !0, id: _o("1234567890abcdefghijklmnopqrstuvwxyzABC
|
|
|
1181
1180
|
});
|
|
1182
1181
|
wo();
|
|
1183
1182
|
const zi = (e, t = { strict: !0, invertY: !1 }) => ({ parse: (i) => vo(i, t), serialize: (i) => To(i, e, t) }), vo = (e, t = { strict: !0, invertY: !1 }) => {
|
|
1184
|
-
const n = e.id ||
|
|
1183
|
+
const n = e.id || nn(), {
|
|
1185
1184
|
creator: o,
|
|
1186
1185
|
created: i,
|
|
1187
1186
|
modified: s,
|
|
1188
1187
|
body: r,
|
|
1189
1188
|
...l
|
|
1190
|
-
} = e, a = Ao(r || [], n), c = Array.isArray(e.target) ? e.target[0] : e.target,
|
|
1191
|
-
return
|
|
1189
|
+
} = e, a = Ao(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" ? Pn(u, t.invertY) : (u == null ? void 0 : u.type) === "SvgSelector" ? Nn(u) : void 0;
|
|
1190
|
+
return f || !t.strict ? {
|
|
1192
1191
|
parsed: {
|
|
1193
1192
|
...l,
|
|
1194
1193
|
id: n,
|
|
1195
1194
|
bodies: a,
|
|
1196
1195
|
target: {
|
|
1197
1196
|
created: i ? new Date(i) : void 0,
|
|
1198
|
-
creator:
|
|
1197
|
+
creator: rn(o),
|
|
1199
1198
|
updated: s ? new Date(s) : void 0,
|
|
1200
1199
|
...Array.isArray(l.target) ? l.target[0] : l.target,
|
|
1201
1200
|
annotation: n,
|
|
1202
|
-
selector:
|
|
1201
|
+
selector: f || u
|
|
1203
1202
|
}
|
|
1204
1203
|
}
|
|
1205
1204
|
} : {
|
|
1206
|
-
error: Error(`Invalid selector: ${JSON.stringify(
|
|
1205
|
+
error: Error(`Invalid selector: ${JSON.stringify(u)}`)
|
|
1207
1206
|
};
|
|
1208
1207
|
}, To = (e, t, n = { strict: !0, invertY: !1 }) => {
|
|
1209
1208
|
const {
|
|
@@ -1218,12 +1217,12 @@ const zi = (e, t = { strict: !0, invertY: !1 }) => ({ parse: (i) => vo(i, t), se
|
|
|
1218
1217
|
let c;
|
|
1219
1218
|
try {
|
|
1220
1219
|
c = o.type == W.RECTANGLE ? Yn(o.geometry) : Un(o);
|
|
1221
|
-
} catch (
|
|
1220
|
+
} catch (f) {
|
|
1222
1221
|
if (n.strict)
|
|
1223
|
-
throw
|
|
1222
|
+
throw f;
|
|
1224
1223
|
c = o;
|
|
1225
1224
|
}
|
|
1226
|
-
const
|
|
1225
|
+
const u = {
|
|
1227
1226
|
...e,
|
|
1228
1227
|
"@context": "http://www.w3.org/ns/anno.jsonld",
|
|
1229
1228
|
id: e.id,
|
|
@@ -1238,13 +1237,13 @@ const zi = (e, t = { strict: !0, invertY: !1 }) => ({ parse: (i) => vo(i, t), se
|
|
|
1238
1237
|
selector: c
|
|
1239
1238
|
}
|
|
1240
1239
|
};
|
|
1241
|
-
return delete
|
|
1240
|
+
return delete u.bodies, "annotation" in u.target && delete u.target.annotation, u;
|
|
1242
1241
|
};
|
|
1243
|
-
function
|
|
1242
|
+
function kt(e, t, n) {
|
|
1244
1243
|
const o = e.slice();
|
|
1245
1244
|
return o[10] = t[n], o[12] = n, o;
|
|
1246
1245
|
}
|
|
1247
|
-
function
|
|
1246
|
+
function It(e) {
|
|
1248
1247
|
let t, n;
|
|
1249
1248
|
return t = new Be({
|
|
1250
1249
|
props: {
|
|
@@ -1273,7 +1272,7 @@ function Lt(e) {
|
|
|
1273
1272
|
te(t.$$.fragment);
|
|
1274
1273
|
},
|
|
1275
1274
|
m(o, i) {
|
|
1276
|
-
|
|
1275
|
+
x(t, o, i), n = !0;
|
|
1277
1276
|
},
|
|
1278
1277
|
p(o, i) {
|
|
1279
1278
|
e = o;
|
|
@@ -1287,46 +1286,46 @@ function Lt(e) {
|
|
|
1287
1286
|
e[3]), t.$set(s);
|
|
1288
1287
|
},
|
|
1289
1288
|
i(o) {
|
|
1290
|
-
n || (
|
|
1289
|
+
n || (B(t.$$.fragment, o), n = !0);
|
|
1291
1290
|
},
|
|
1292
1291
|
o(o) {
|
|
1293
1292
|
R(t.$$.fragment, o), n = !1;
|
|
1294
1293
|
},
|
|
1295
1294
|
d(o) {
|
|
1296
|
-
|
|
1295
|
+
$(t, o);
|
|
1297
1296
|
}
|
|
1298
1297
|
};
|
|
1299
1298
|
}
|
|
1300
1299
|
function Mo(e) {
|
|
1301
|
-
let t, n, o, i, s, r, l, a, c,
|
|
1300
|
+
let t, n, o, i, s, r, l, a, c, u, f, g = Te(
|
|
1302
1301
|
/*geom*/
|
|
1303
1302
|
e[4].points
|
|
1304
|
-
),
|
|
1305
|
-
for (let
|
|
1306
|
-
|
|
1307
|
-
const m = (
|
|
1308
|
-
|
|
1303
|
+
), h = [];
|
|
1304
|
+
for (let y = 0; y < g.length; y += 1)
|
|
1305
|
+
h[y] = It(kt(e, g, y));
|
|
1306
|
+
const m = (y) => R(h[y], 1, 1, () => {
|
|
1307
|
+
h[y] = null;
|
|
1309
1308
|
});
|
|
1310
1309
|
return {
|
|
1311
1310
|
c() {
|
|
1312
1311
|
t = C("polygon"), i = ie(), s = C("polygon"), l = ie();
|
|
1313
|
-
for (let
|
|
1314
|
-
|
|
1315
|
-
a = le(),
|
|
1316
|
-
e[1] ? "display:none;" : void 0),
|
|
1317
|
-
e[4].points.map(
|
|
1312
|
+
for (let y = 0; y < h.length; y += 1)
|
|
1313
|
+
h[y].c();
|
|
1314
|
+
a = le(), d(t, "class", "a9s-outer"), d(t, "style", n = /*computedStyle*/
|
|
1315
|
+
e[1] ? "display:none;" : void 0), d(t, "points", o = /*geom*/
|
|
1316
|
+
e[4].points.map(Ot).join(" ")), d(s, "class", "a9s-inner a9s-shape-handle"), d(
|
|
1318
1317
|
s,
|
|
1319
1318
|
"style",
|
|
1320
1319
|
/*computedStyle*/
|
|
1321
1320
|
e[1]
|
|
1322
|
-
),
|
|
1323
|
-
e[4].points.map(
|
|
1324
|
-
},
|
|
1325
|
-
m(
|
|
1326
|
-
I(
|
|
1327
|
-
for (let p = 0; p <
|
|
1328
|
-
|
|
1329
|
-
I(
|
|
1321
|
+
), d(s, "points", r = /*geom*/
|
|
1322
|
+
e[4].points.map(Bt).join(" "));
|
|
1323
|
+
},
|
|
1324
|
+
m(y, T) {
|
|
1325
|
+
I(y, t, T), I(y, i, T), I(y, s, T), I(y, l, T);
|
|
1326
|
+
for (let p = 0; p < h.length; p += 1)
|
|
1327
|
+
h[p] && h[p].m(y, T);
|
|
1328
|
+
I(y, a, T), c = !0, u || (f = [
|
|
1330
1329
|
F(t, "pointerdown", function() {
|
|
1331
1330
|
q(
|
|
1332
1331
|
/*grab*/
|
|
@@ -1339,58 +1338,58 @@ function Mo(e) {
|
|
|
1339
1338
|
e[9]("SHAPE")
|
|
1340
1339
|
) && e[9]("SHAPE").apply(this, arguments);
|
|
1341
1340
|
})
|
|
1342
|
-
],
|
|
1341
|
+
], u = !0);
|
|
1343
1342
|
},
|
|
1344
|
-
p(
|
|
1345
|
-
if (e =
|
|
1343
|
+
p(y, T) {
|
|
1344
|
+
if (e = y, (!c || T & /*computedStyle*/
|
|
1346
1345
|
2 && n !== (n = /*computedStyle*/
|
|
1347
|
-
e[1] ? "display:none;" : void 0)) &&
|
|
1346
|
+
e[1] ? "display:none;" : void 0)) && d(t, "style", n), (!c || T & /*geom*/
|
|
1348
1347
|
16 && o !== (o = /*geom*/
|
|
1349
|
-
e[4].points.map(
|
|
1350
|
-
2) &&
|
|
1348
|
+
e[4].points.map(Ot).join(" "))) && d(t, "points", o), (!c || T & /*computedStyle*/
|
|
1349
|
+
2) && d(
|
|
1351
1350
|
s,
|
|
1352
1351
|
"style",
|
|
1353
1352
|
/*computedStyle*/
|
|
1354
1353
|
e[1]
|
|
1355
|
-
), (!c ||
|
|
1354
|
+
), (!c || T & /*geom*/
|
|
1356
1355
|
16 && r !== (r = /*geom*/
|
|
1357
|
-
e[4].points.map(
|
|
1356
|
+
e[4].points.map(Bt).join(" "))) && d(s, "points", r), T & /*geom, viewportScale, grab*/
|
|
1358
1357
|
536) {
|
|
1359
|
-
|
|
1358
|
+
g = Te(
|
|
1360
1359
|
/*geom*/
|
|
1361
1360
|
e[4].points
|
|
1362
1361
|
);
|
|
1363
1362
|
let p;
|
|
1364
|
-
for (p = 0; p <
|
|
1365
|
-
const w =
|
|
1366
|
-
|
|
1363
|
+
for (p = 0; p < g.length; p += 1) {
|
|
1364
|
+
const w = kt(e, g, p);
|
|
1365
|
+
h[p] ? (h[p].p(w, T), B(h[p], 1)) : (h[p] = It(w), h[p].c(), B(h[p], 1), h[p].m(a.parentNode, a));
|
|
1367
1366
|
}
|
|
1368
|
-
for (se(), p =
|
|
1367
|
+
for (se(), p = g.length; p < h.length; p += 1)
|
|
1369
1368
|
m(p);
|
|
1370
1369
|
re();
|
|
1371
1370
|
}
|
|
1372
1371
|
},
|
|
1373
|
-
i(
|
|
1372
|
+
i(y) {
|
|
1374
1373
|
if (!c) {
|
|
1375
|
-
for (let
|
|
1376
|
-
|
|
1374
|
+
for (let T = 0; T < g.length; T += 1)
|
|
1375
|
+
B(h[T]);
|
|
1377
1376
|
c = !0;
|
|
1378
1377
|
}
|
|
1379
1378
|
},
|
|
1380
|
-
o(
|
|
1381
|
-
|
|
1382
|
-
for (let
|
|
1383
|
-
R(
|
|
1379
|
+
o(y) {
|
|
1380
|
+
h = h.filter(Boolean);
|
|
1381
|
+
for (let T = 0; T < h.length; T += 1)
|
|
1382
|
+
R(h[T]);
|
|
1384
1383
|
c = !1;
|
|
1385
1384
|
},
|
|
1386
|
-
d(
|
|
1387
|
-
|
|
1385
|
+
d(y) {
|
|
1386
|
+
y && (k(t), k(i), k(s), k(l), k(a)), mt(h, y), u = !1, de(f);
|
|
1388
1387
|
}
|
|
1389
1388
|
};
|
|
1390
1389
|
}
|
|
1391
1390
|
function Lo(e) {
|
|
1392
1391
|
let t, n;
|
|
1393
|
-
return t = new
|
|
1392
|
+
return t = new an({
|
|
1394
1393
|
props: {
|
|
1395
1394
|
shape: (
|
|
1396
1395
|
/*shape*/
|
|
@@ -1430,7 +1429,7 @@ function Lo(e) {
|
|
|
1430
1429
|
te(t.$$.fragment);
|
|
1431
1430
|
},
|
|
1432
1431
|
m(o, i) {
|
|
1433
|
-
|
|
1432
|
+
x(t, o, i), n = !0;
|
|
1434
1433
|
},
|
|
1435
1434
|
p(o, [i]) {
|
|
1436
1435
|
const s = {};
|
|
@@ -1442,37 +1441,37 @@ function Lo(e) {
|
|
|
1442
1441
|
8730 && (s.$$scope = { dirty: i, ctx: o }), t.$set(s);
|
|
1443
1442
|
},
|
|
1444
1443
|
i(o) {
|
|
1445
|
-
n || (
|
|
1444
|
+
n || (B(t.$$.fragment, o), n = !0);
|
|
1446
1445
|
},
|
|
1447
1446
|
o(o) {
|
|
1448
1447
|
R(t.$$.fragment, o), n = !1;
|
|
1449
1448
|
},
|
|
1450
1449
|
d(o) {
|
|
1451
|
-
|
|
1450
|
+
$(t, o);
|
|
1452
1451
|
}
|
|
1453
1452
|
};
|
|
1454
1453
|
}
|
|
1455
|
-
const
|
|
1454
|
+
const Ot = (e) => e.join(","), Bt = (e) => e.join(",");
|
|
1456
1455
|
function ko(e, t, n) {
|
|
1457
1456
|
let o, { shape: i } = t, { computedStyle: s } = t, { transform: r } = t, { viewportScale: l = 1 } = t;
|
|
1458
|
-
const a = (
|
|
1459
|
-
let
|
|
1460
|
-
const
|
|
1461
|
-
|
|
1462
|
-
const p =
|
|
1463
|
-
return { ...
|
|
1457
|
+
const a = (g, h, m) => {
|
|
1458
|
+
let y;
|
|
1459
|
+
const T = g.geometry;
|
|
1460
|
+
h === "SHAPE" ? y = T.points.map(([w, _]) => [w + m[0], _ + m[1]]) : y = T.points.map(([w, _], b) => h === `HANDLE-${b}` ? [w + m[0], _ + m[1]] : [w, _]);
|
|
1461
|
+
const p = Qe(y);
|
|
1462
|
+
return { ...g, geometry: { points: y, bounds: p } };
|
|
1464
1463
|
};
|
|
1465
|
-
function c(
|
|
1466
|
-
he.call(this, e,
|
|
1464
|
+
function c(g) {
|
|
1465
|
+
he.call(this, e, g);
|
|
1467
1466
|
}
|
|
1468
|
-
function
|
|
1469
|
-
he.call(this, e,
|
|
1467
|
+
function u(g) {
|
|
1468
|
+
he.call(this, e, g);
|
|
1470
1469
|
}
|
|
1471
|
-
function
|
|
1472
|
-
he.call(this, e,
|
|
1470
|
+
function f(g) {
|
|
1471
|
+
he.call(this, e, g);
|
|
1473
1472
|
}
|
|
1474
|
-
return e.$$set = (
|
|
1475
|
-
"shape" in
|
|
1473
|
+
return e.$$set = (g) => {
|
|
1474
|
+
"shape" in g && n(0, i = g.shape), "computedStyle" in g && n(1, s = g.computedStyle), "transform" in g && n(2, r = g.transform), "viewportScale" in g && n(3, l = g.viewportScale);
|
|
1476
1475
|
}, e.$$.update = () => {
|
|
1477
1476
|
e.$$.dirty & /*shape*/
|
|
1478
1477
|
1 && n(4, o = i.geometry);
|
|
@@ -1484,11 +1483,11 @@ function ko(e, t, n) {
|
|
|
1484
1483
|
o,
|
|
1485
1484
|
a,
|
|
1486
1485
|
c,
|
|
1487
|
-
|
|
1488
|
-
|
|
1486
|
+
u,
|
|
1487
|
+
f
|
|
1489
1488
|
];
|
|
1490
1489
|
}
|
|
1491
|
-
class
|
|
1490
|
+
class Io extends oe {
|
|
1492
1491
|
constructor(t) {
|
|
1493
1492
|
super(), ne(this, t, ko, Lo, Z, {
|
|
1494
1493
|
shape: 0,
|
|
@@ -1498,31 +1497,31 @@ class Oo extends oe {
|
|
|
1498
1497
|
});
|
|
1499
1498
|
}
|
|
1500
1499
|
}
|
|
1501
|
-
const
|
|
1500
|
+
const rt = (e, t) => {
|
|
1502
1501
|
const n = Math.abs(t[0] - e[0]), o = Math.abs(t[1] - e[1]);
|
|
1503
1502
|
return Math.sqrt(Math.pow(n, 2) + Math.pow(o, 2));
|
|
1504
|
-
},
|
|
1505
|
-
function
|
|
1503
|
+
}, be = [];
|
|
1504
|
+
function Oo(e, t = H) {
|
|
1506
1505
|
let n;
|
|
1507
1506
|
const o = /* @__PURE__ */ new Set();
|
|
1508
1507
|
function i(l) {
|
|
1509
1508
|
if (Z(e, l) && (e = l, n)) {
|
|
1510
|
-
const a = !
|
|
1509
|
+
const a = !be.length;
|
|
1511
1510
|
for (const c of o)
|
|
1512
|
-
c[1](),
|
|
1511
|
+
c[1](), be.push(c, e);
|
|
1513
1512
|
if (a) {
|
|
1514
|
-
for (let c = 0; c <
|
|
1515
|
-
|
|
1516
|
-
|
|
1513
|
+
for (let c = 0; c < be.length; c += 2)
|
|
1514
|
+
be[c][0](be[c + 1]);
|
|
1515
|
+
be.length = 0;
|
|
1517
1516
|
}
|
|
1518
1517
|
}
|
|
1519
1518
|
}
|
|
1520
1519
|
function s(l) {
|
|
1521
1520
|
i(l(e));
|
|
1522
1521
|
}
|
|
1523
|
-
function r(l, a =
|
|
1522
|
+
function r(l, a = H) {
|
|
1524
1523
|
const c = [l, a];
|
|
1525
|
-
return o.add(c), o.size === 1 && (n = t(i, s) ||
|
|
1524
|
+
return o.add(c), o.size === 1 && (n = t(i, s) || H), l(e), () => {
|
|
1526
1525
|
o.delete(c), o.size === 0 && n && (n(), n = null);
|
|
1527
1526
|
};
|
|
1528
1527
|
}
|
|
@@ -1540,7 +1539,7 @@ const Bo = (e, t) => {
|
|
|
1540
1539
|
t.setAttribute("viewBox", `0 0 ${n} ${o}`);
|
|
1541
1540
|
}, Po = (e, t) => {
|
|
1542
1541
|
Bo(e, t);
|
|
1543
|
-
const { subscribe: n, set: o } =
|
|
1542
|
+
const { subscribe: n, set: o } = Oo(1);
|
|
1544
1543
|
let i;
|
|
1545
1544
|
return window.ResizeObserver && (i = new ResizeObserver(() => {
|
|
1546
1545
|
const r = t.getBoundingClientRect(), { width: l, height: a } = t.viewBox.baseVal, c = Math.max(
|
|
@@ -1557,17 +1556,17 @@ function Do(e) {
|
|
|
1557
1556
|
let t, n, o, i, s, r;
|
|
1558
1557
|
return {
|
|
1559
1558
|
c() {
|
|
1560
|
-
t = C("rect"),
|
|
1561
|
-
e[8].class || ""}`.trim()) + " svelte-1sgkh33"),
|
|
1559
|
+
t = C("rect"), d(t, "class", n = Ke(`a9s-handle ${/*$$props*/
|
|
1560
|
+
e[8].class || ""}`.trim()) + " svelte-1sgkh33"), d(t, "x", o = /*x*/
|
|
1562
1561
|
e[0] - /*handleSize*/
|
|
1563
|
-
e[5] / 2),
|
|
1562
|
+
e[5] / 2), d(t, "y", i = /*y*/
|
|
1564
1563
|
e[1] - /*handleSize*/
|
|
1565
|
-
e[5] / 2),
|
|
1564
|
+
e[5] / 2), d(
|
|
1566
1565
|
t,
|
|
1567
1566
|
"width",
|
|
1568
1567
|
/*handleSize*/
|
|
1569
1568
|
e[5]
|
|
1570
|
-
),
|
|
1569
|
+
), d(
|
|
1571
1570
|
t,
|
|
1572
1571
|
"height",
|
|
1573
1572
|
/*handleSize*/
|
|
@@ -1584,21 +1583,21 @@ function Do(e) {
|
|
|
1584
1583
|
},
|
|
1585
1584
|
p(l, a) {
|
|
1586
1585
|
a & /*$$props*/
|
|
1587
|
-
256 && n !== (n =
|
|
1588
|
-
l[8].class || ""}`.trim()) + " svelte-1sgkh33") &&
|
|
1586
|
+
256 && n !== (n = Ke(`a9s-handle ${/*$$props*/
|
|
1587
|
+
l[8].class || ""}`.trim()) + " svelte-1sgkh33") && d(t, "class", n), a & /*x, handleSize*/
|
|
1589
1588
|
33 && o !== (o = /*x*/
|
|
1590
1589
|
l[0] - /*handleSize*/
|
|
1591
|
-
l[5] / 2) &&
|
|
1590
|
+
l[5] / 2) && d(t, "x", o), a & /*y, handleSize*/
|
|
1592
1591
|
34 && i !== (i = /*y*/
|
|
1593
1592
|
l[1] - /*handleSize*/
|
|
1594
|
-
l[5] / 2) &&
|
|
1595
|
-
32 &&
|
|
1593
|
+
l[5] / 2) && d(t, "y", i), a & /*handleSize*/
|
|
1594
|
+
32 && d(
|
|
1596
1595
|
t,
|
|
1597
1596
|
"width",
|
|
1598
1597
|
/*handleSize*/
|
|
1599
1598
|
l[5]
|
|
1600
1599
|
), a & /*handleSize*/
|
|
1601
|
-
32 &&
|
|
1600
|
+
32 && d(
|
|
1602
1601
|
t,
|
|
1603
1602
|
"height",
|
|
1604
1603
|
/*handleSize*/
|
|
@@ -1606,7 +1605,7 @@ function Do(e) {
|
|
|
1606
1605
|
);
|
|
1607
1606
|
},
|
|
1608
1607
|
d(l) {
|
|
1609
|
-
l &&
|
|
1608
|
+
l && k(t), s = !1, r();
|
|
1610
1609
|
}
|
|
1611
1610
|
};
|
|
1612
1611
|
}
|
|
@@ -1614,42 +1613,42 @@ function Xo(e) {
|
|
|
1614
1613
|
let t, n, o, i, s, r, l, a, c;
|
|
1615
1614
|
return {
|
|
1616
1615
|
c() {
|
|
1617
|
-
t = C("g"), n = C("circle"), i = C("rect"),
|
|
1616
|
+
t = C("g"), n = C("circle"), i = C("rect"), d(
|
|
1618
1617
|
n,
|
|
1619
1618
|
"cx",
|
|
1620
1619
|
/*x*/
|
|
1621
1620
|
e[0]
|
|
1622
|
-
),
|
|
1621
|
+
), d(
|
|
1623
1622
|
n,
|
|
1624
1623
|
"cy",
|
|
1625
1624
|
/*y*/
|
|
1626
1625
|
e[1]
|
|
1627
|
-
),
|
|
1626
|
+
), d(n, "r", o = /*radius*/
|
|
1628
1627
|
e[3] / /*scale*/
|
|
1629
|
-
e[2]),
|
|
1628
|
+
e[2]), d(n, "class", "a9s-touch-halo svelte-1sgkh33"), me(
|
|
1630
1629
|
n,
|
|
1631
1630
|
"touched",
|
|
1632
1631
|
/*touched*/
|
|
1633
1632
|
e[4]
|
|
1634
|
-
),
|
|
1635
|
-
e[8].class || ""}`.trim()) + " svelte-1sgkh33"),
|
|
1633
|
+
), d(i, "class", s = Ke(`a9s-handle ${/*$$props*/
|
|
1634
|
+
e[8].class || ""}`.trim()) + " svelte-1sgkh33"), d(i, "x", r = /*x*/
|
|
1636
1635
|
e[0] - /*handleSize*/
|
|
1637
|
-
e[5] / 2),
|
|
1636
|
+
e[5] / 2), d(i, "y", l = /*y*/
|
|
1638
1637
|
e[1] - /*handleSize*/
|
|
1639
|
-
e[5] / 2),
|
|
1638
|
+
e[5] / 2), d(
|
|
1640
1639
|
i,
|
|
1641
1640
|
"width",
|
|
1642
1641
|
/*handleSize*/
|
|
1643
1642
|
e[5]
|
|
1644
|
-
),
|
|
1643
|
+
), d(
|
|
1645
1644
|
i,
|
|
1646
1645
|
"height",
|
|
1647
1646
|
/*handleSize*/
|
|
1648
1647
|
e[5]
|
|
1649
|
-
),
|
|
1648
|
+
), d(t, "class", "a9s-touch-handle");
|
|
1650
1649
|
},
|
|
1651
|
-
m(
|
|
1652
|
-
I(
|
|
1650
|
+
m(u, f) {
|
|
1651
|
+
I(u, t, f), ue(t, n), ue(t, i), a || (c = [
|
|
1653
1652
|
F(
|
|
1654
1653
|
n,
|
|
1655
1654
|
"pointerdown",
|
|
@@ -1688,52 +1687,52 @@ function Xo(e) {
|
|
|
1688
1687
|
)
|
|
1689
1688
|
], a = !0);
|
|
1690
1689
|
},
|
|
1691
|
-
p(
|
|
1692
|
-
|
|
1693
|
-
1 &&
|
|
1690
|
+
p(u, f) {
|
|
1691
|
+
f & /*x*/
|
|
1692
|
+
1 && d(
|
|
1694
1693
|
n,
|
|
1695
1694
|
"cx",
|
|
1696
1695
|
/*x*/
|
|
1697
|
-
|
|
1698
|
-
),
|
|
1699
|
-
2 &&
|
|
1696
|
+
u[0]
|
|
1697
|
+
), f & /*y*/
|
|
1698
|
+
2 && d(
|
|
1700
1699
|
n,
|
|
1701
1700
|
"cy",
|
|
1702
1701
|
/*y*/
|
|
1703
|
-
|
|
1704
|
-
),
|
|
1702
|
+
u[1]
|
|
1703
|
+
), f & /*radius, scale*/
|
|
1705
1704
|
12 && o !== (o = /*radius*/
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
16 &&
|
|
1705
|
+
u[3] / /*scale*/
|
|
1706
|
+
u[2]) && d(n, "r", o), f & /*touched*/
|
|
1707
|
+
16 && me(
|
|
1709
1708
|
n,
|
|
1710
1709
|
"touched",
|
|
1711
1710
|
/*touched*/
|
|
1712
|
-
|
|
1713
|
-
),
|
|
1714
|
-
256 && s !== (s =
|
|
1715
|
-
|
|
1711
|
+
u[4]
|
|
1712
|
+
), f & /*$$props*/
|
|
1713
|
+
256 && s !== (s = Ke(`a9s-handle ${/*$$props*/
|
|
1714
|
+
u[8].class || ""}`.trim()) + " svelte-1sgkh33") && d(i, "class", s), f & /*x, handleSize*/
|
|
1716
1715
|
33 && r !== (r = /*x*/
|
|
1717
|
-
|
|
1718
|
-
|
|
1716
|
+
u[0] - /*handleSize*/
|
|
1717
|
+
u[5] / 2) && d(i, "x", r), f & /*y, handleSize*/
|
|
1719
1718
|
34 && l !== (l = /*y*/
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
32 &&
|
|
1719
|
+
u[1] - /*handleSize*/
|
|
1720
|
+
u[5] / 2) && d(i, "y", l), f & /*handleSize*/
|
|
1721
|
+
32 && d(
|
|
1723
1722
|
i,
|
|
1724
1723
|
"width",
|
|
1725
1724
|
/*handleSize*/
|
|
1726
|
-
|
|
1727
|
-
),
|
|
1728
|
-
32 &&
|
|
1725
|
+
u[5]
|
|
1726
|
+
), f & /*handleSize*/
|
|
1727
|
+
32 && d(
|
|
1729
1728
|
i,
|
|
1730
1729
|
"height",
|
|
1731
1730
|
/*handleSize*/
|
|
1732
|
-
|
|
1731
|
+
u[5]
|
|
1733
1732
|
);
|
|
1734
1733
|
},
|
|
1735
|
-
d(
|
|
1736
|
-
|
|
1734
|
+
d(u) {
|
|
1735
|
+
u && k(t), a = !1, de(c);
|
|
1737
1736
|
}
|
|
1738
1737
|
};
|
|
1739
1738
|
}
|
|
@@ -1753,10 +1752,10 @@ function Ro(e) {
|
|
|
1753
1752
|
p(s, [r]) {
|
|
1754
1753
|
i.p(s, r);
|
|
1755
1754
|
},
|
|
1756
|
-
i:
|
|
1757
|
-
o:
|
|
1755
|
+
i: H,
|
|
1756
|
+
o: H,
|
|
1758
1757
|
d(s) {
|
|
1759
|
-
s &&
|
|
1758
|
+
s && k(t), i.d(s);
|
|
1760
1759
|
}
|
|
1761
1760
|
};
|
|
1762
1761
|
}
|
|
@@ -1764,22 +1763,22 @@ function Co(e, t, n) {
|
|
|
1764
1763
|
let o, { x: i } = t, { y: s } = t, { scale: r } = t, { radius: l = 30 } = t, a = !1;
|
|
1765
1764
|
const c = (m) => {
|
|
1766
1765
|
m.pointerType === "touch" && n(4, a = !0);
|
|
1767
|
-
},
|
|
1768
|
-
function
|
|
1766
|
+
}, u = () => n(4, a = !1);
|
|
1767
|
+
function f(m) {
|
|
1769
1768
|
he.call(this, e, m);
|
|
1770
1769
|
}
|
|
1771
|
-
function
|
|
1770
|
+
function g(m) {
|
|
1772
1771
|
he.call(this, e, m);
|
|
1773
1772
|
}
|
|
1774
|
-
function
|
|
1773
|
+
function h(m) {
|
|
1775
1774
|
he.call(this, e, m);
|
|
1776
1775
|
}
|
|
1777
1776
|
return e.$$set = (m) => {
|
|
1778
|
-
n(8, t =
|
|
1777
|
+
n(8, t = ut(ut({}, t), Et(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);
|
|
1779
1778
|
}, e.$$.update = () => {
|
|
1780
1779
|
e.$$.dirty & /*scale*/
|
|
1781
1780
|
4 && n(5, o = 10 / r);
|
|
1782
|
-
}, t =
|
|
1781
|
+
}, t = Et(t), [
|
|
1783
1782
|
i,
|
|
1784
1783
|
s,
|
|
1785
1784
|
r,
|
|
@@ -1787,11 +1786,11 @@ function Co(e, t, n) {
|
|
|
1787
1786
|
a,
|
|
1788
1787
|
o,
|
|
1789
1788
|
c,
|
|
1790
|
-
f,
|
|
1791
|
-
t,
|
|
1792
1789
|
u,
|
|
1793
|
-
|
|
1794
|
-
|
|
1790
|
+
t,
|
|
1791
|
+
f,
|
|
1792
|
+
g,
|
|
1793
|
+
h
|
|
1795
1794
|
];
|
|
1796
1795
|
}
|
|
1797
1796
|
class Be extends oe {
|
|
@@ -1800,7 +1799,7 @@ class Be extends oe {
|
|
|
1800
1799
|
}
|
|
1801
1800
|
}
|
|
1802
1801
|
function No(e) {
|
|
1803
|
-
let t, n, o, i, s, r, l, a, c,
|
|
1802
|
+
let t, n, o, i, s, r, l, a, c, u, f, g, h, m, y, T, p, w, _, b, Y, U, V, G, P, E, A, S, v, N, X, K, ge, ae, Le, ce, ke, fe, Ie, L, D, j, ee;
|
|
1804
1803
|
return ae = new Be({
|
|
1805
1804
|
props: {
|
|
1806
1805
|
class: "a9s-corner-handle-topleft",
|
|
@@ -1867,7 +1866,7 @@ function No(e) {
|
|
|
1867
1866
|
/*grab*/
|
|
1868
1867
|
e[9]("BOTTOM_RIGHT")
|
|
1869
1868
|
) && e[9]("BOTTOM_RIGHT").apply(this, arguments);
|
|
1870
|
-
}),
|
|
1869
|
+
}), L = new Be({
|
|
1871
1870
|
props: {
|
|
1872
1871
|
class: "a9s-corner-handle-bottomleft",
|
|
1873
1872
|
x: (
|
|
@@ -1884,45 +1883,45 @@ function No(e) {
|
|
|
1884
1883
|
e[3]
|
|
1885
1884
|
)
|
|
1886
1885
|
}
|
|
1887
|
-
}),
|
|
1886
|
+
}), L.$on("pointerdown", function() {
|
|
1888
1887
|
q(
|
|
1889
1888
|
/*grab*/
|
|
1890
1889
|
e[9]("BOTTOM_LEFT")
|
|
1891
1890
|
) && e[9]("BOTTOM_LEFT").apply(this, arguments);
|
|
1892
1891
|
}), {
|
|
1893
1892
|
c() {
|
|
1894
|
-
t = C("rect"), l = ie(), a = C("rect"),
|
|
1895
|
-
e[1] ? "display:none;" : void 0),
|
|
1896
|
-
e[4].x),
|
|
1897
|
-
e[4].y),
|
|
1898
|
-
e[4].w),
|
|
1899
|
-
e[4].h),
|
|
1893
|
+
t = C("rect"), l = ie(), a = C("rect"), h = ie(), m = C("rect"), w = ie(), _ = C("rect"), V = ie(), G = C("rect"), S = ie(), v = C("rect"), ge = ie(), te(ae.$$.fragment), Le = ie(), te(ce.$$.fragment), ke = ie(), te(fe.$$.fragment), Ie = ie(), te(L.$$.fragment), d(t, "class", "a9s-outer"), d(t, "style", n = /*computedStyle*/
|
|
1894
|
+
e[1] ? "display:none;" : void 0), d(t, "x", o = /*geom*/
|
|
1895
|
+
e[4].x), d(t, "y", i = /*geom*/
|
|
1896
|
+
e[4].y), d(t, "width", s = /*geom*/
|
|
1897
|
+
e[4].w), d(t, "height", r = /*geom*/
|
|
1898
|
+
e[4].h), d(a, "class", "a9s-inner a9s-shape-handle"), d(
|
|
1900
1899
|
a,
|
|
1901
1900
|
"style",
|
|
1902
1901
|
/*computedStyle*/
|
|
1903
1902
|
e[1]
|
|
1904
|
-
),
|
|
1905
|
-
e[4].x),
|
|
1906
|
-
e[4].y),
|
|
1907
|
-
e[4].w),
|
|
1908
|
-
e[4].h),
|
|
1909
|
-
e[4].x),
|
|
1910
|
-
e[4].y),
|
|
1911
|
-
e[4].w),
|
|
1903
|
+
), d(a, "x", c = /*geom*/
|
|
1904
|
+
e[4].x), d(a, "y", u = /*geom*/
|
|
1905
|
+
e[4].y), d(a, "width", f = /*geom*/
|
|
1906
|
+
e[4].w), d(a, "height", g = /*geom*/
|
|
1907
|
+
e[4].h), d(m, "class", "a9s-edge-handle a9s-edge-handle-top"), d(m, "x", y = /*geom*/
|
|
1908
|
+
e[4].x), d(m, "y", T = /*geom*/
|
|
1909
|
+
e[4].y), d(m, "height", 1), d(m, "width", p = /*geom*/
|
|
1910
|
+
e[4].w), d(_, "class", "a9s-edge-handle a9s-edge-handle-right"), d(_, "x", b = /*geom*/
|
|
1912
1911
|
e[4].x + /*geom*/
|
|
1913
|
-
e[4].w),
|
|
1914
|
-
e[4].y),
|
|
1915
|
-
e[4].h),
|
|
1916
|
-
e[4].x),
|
|
1912
|
+
e[4].w), d(_, "y", Y = /*geom*/
|
|
1913
|
+
e[4].y), d(_, "height", U = /*geom*/
|
|
1914
|
+
e[4].h), d(_, "width", 1), d(G, "class", "a9s-edge-handle a9s-edge-handle-bottom"), d(G, "x", P = /*geom*/
|
|
1915
|
+
e[4].x), d(G, "y", E = /*geom*/
|
|
1917
1916
|
e[4].y + /*geom*/
|
|
1918
|
-
e[4].h),
|
|
1919
|
-
e[4].w),
|
|
1920
|
-
e[4].x),
|
|
1921
|
-
e[4].y),
|
|
1922
|
-
e[4].h),
|
|
1923
|
-
},
|
|
1924
|
-
m(
|
|
1925
|
-
I(
|
|
1917
|
+
e[4].h), d(G, "height", 1), d(G, "width", A = /*geom*/
|
|
1918
|
+
e[4].w), d(v, "class", "a9s-edge-handle a9s-edge-handle-left"), d(v, "x", N = /*geom*/
|
|
1919
|
+
e[4].x), d(v, "y", X = /*geom*/
|
|
1920
|
+
e[4].y), d(v, "height", K = /*geom*/
|
|
1921
|
+
e[4].h), d(v, "width", 1);
|
|
1922
|
+
},
|
|
1923
|
+
m(O, M) {
|
|
1924
|
+
I(O, t, M), I(O, l, M), I(O, a, M), I(O, h, M), I(O, m, M), I(O, w, M), I(O, _, M), I(O, V, M), I(O, G, M), I(O, S, M), I(O, v, M), I(O, ge, M), x(ae, O, M), I(O, Le, M), x(ce, O, M), I(O, ke, M), x(fe, O, M), I(O, Ie, M), x(L, O, M), D = !0, j || (ee = [
|
|
1926
1925
|
F(t, "pointerdown", function() {
|
|
1927
1926
|
q(
|
|
1928
1927
|
/*grab*/
|
|
@@ -1941,7 +1940,7 @@ function No(e) {
|
|
|
1941
1940
|
e[9]("TOP")
|
|
1942
1941
|
) && e[9]("TOP").apply(this, arguments);
|
|
1943
1942
|
}),
|
|
1944
|
-
F(
|
|
1943
|
+
F(_, "pointerdown", function() {
|
|
1945
1944
|
q(
|
|
1946
1945
|
/*grab*/
|
|
1947
1946
|
e[9]("RIGHT")
|
|
@@ -1953,66 +1952,66 @@ function No(e) {
|
|
|
1953
1952
|
e[9]("BOTTOM")
|
|
1954
1953
|
) && e[9]("BOTTOM").apply(this, arguments);
|
|
1955
1954
|
}),
|
|
1956
|
-
F(
|
|
1955
|
+
F(v, "pointerdown", function() {
|
|
1957
1956
|
q(
|
|
1958
1957
|
/*grab*/
|
|
1959
1958
|
e[9]("LEFT")
|
|
1960
1959
|
) && e[9]("LEFT").apply(this, arguments);
|
|
1961
1960
|
})
|
|
1962
|
-
],
|
|
1961
|
+
], j = !0);
|
|
1963
1962
|
},
|
|
1964
|
-
p(
|
|
1965
|
-
e =
|
|
1963
|
+
p(O, M) {
|
|
1964
|
+
e = O, (!D || M & /*computedStyle*/
|
|
1966
1965
|
2 && n !== (n = /*computedStyle*/
|
|
1967
|
-
e[1] ? "display:none;" : void 0)) &&
|
|
1966
|
+
e[1] ? "display:none;" : void 0)) && d(t, "style", n), (!D || M & /*geom*/
|
|
1968
1967
|
16 && o !== (o = /*geom*/
|
|
1969
|
-
e[4].x)) &&
|
|
1968
|
+
e[4].x)) && d(t, "x", o), (!D || M & /*geom*/
|
|
1970
1969
|
16 && i !== (i = /*geom*/
|
|
1971
|
-
e[4].y)) &&
|
|
1970
|
+
e[4].y)) && d(t, "y", i), (!D || M & /*geom*/
|
|
1972
1971
|
16 && s !== (s = /*geom*/
|
|
1973
|
-
e[4].w)) &&
|
|
1972
|
+
e[4].w)) && d(t, "width", s), (!D || M & /*geom*/
|
|
1974
1973
|
16 && r !== (r = /*geom*/
|
|
1975
|
-
e[4].h)) &&
|
|
1976
|
-
2) &&
|
|
1974
|
+
e[4].h)) && d(t, "height", r), (!D || M & /*computedStyle*/
|
|
1975
|
+
2) && d(
|
|
1977
1976
|
a,
|
|
1978
1977
|
"style",
|
|
1979
1978
|
/*computedStyle*/
|
|
1980
1979
|
e[1]
|
|
1981
|
-
), (!
|
|
1980
|
+
), (!D || M & /*geom*/
|
|
1982
1981
|
16 && c !== (c = /*geom*/
|
|
1983
|
-
e[4].x)) &&
|
|
1984
|
-
16 && f !== (f = /*geom*/
|
|
1985
|
-
e[4].y)) && h(a, "y", f), (!k || M & /*geom*/
|
|
1982
|
+
e[4].x)) && d(a, "x", c), (!D || M & /*geom*/
|
|
1986
1983
|
16 && u !== (u = /*geom*/
|
|
1987
|
-
e[4].
|
|
1988
|
-
16 &&
|
|
1989
|
-
e[4].
|
|
1990
|
-
16 &&
|
|
1991
|
-
e[4].
|
|
1992
|
-
16 &&
|
|
1993
|
-
e[4].
|
|
1984
|
+
e[4].y)) && d(a, "y", u), (!D || M & /*geom*/
|
|
1985
|
+
16 && f !== (f = /*geom*/
|
|
1986
|
+
e[4].w)) && d(a, "width", f), (!D || M & /*geom*/
|
|
1987
|
+
16 && g !== (g = /*geom*/
|
|
1988
|
+
e[4].h)) && d(a, "height", g), (!D || M & /*geom*/
|
|
1989
|
+
16 && y !== (y = /*geom*/
|
|
1990
|
+
e[4].x)) && d(m, "x", y), (!D || M & /*geom*/
|
|
1991
|
+
16 && T !== (T = /*geom*/
|
|
1992
|
+
e[4].y)) && d(m, "y", T), (!D || M & /*geom*/
|
|
1994
1993
|
16 && p !== (p = /*geom*/
|
|
1995
|
-
e[4].w)) &&
|
|
1994
|
+
e[4].w)) && d(m, "width", p), (!D || M & /*geom*/
|
|
1996
1995
|
16 && b !== (b = /*geom*/
|
|
1997
1996
|
e[4].x + /*geom*/
|
|
1998
|
-
e[4].w)) &&
|
|
1999
|
-
16 && B !== (B = /*geom*/
|
|
2000
|
-
e[4].y)) && h(y, "y", B), (!k || M & /*geom*/
|
|
2001
|
-
16 && U !== (U = /*geom*/
|
|
2002
|
-
e[4].h)) && h(y, "height", U), (!k || M & /*geom*/
|
|
1997
|
+
e[4].w)) && d(_, "x", b), (!D || M & /*geom*/
|
|
2003
1998
|
16 && Y !== (Y = /*geom*/
|
|
2004
|
-
e[4].
|
|
1999
|
+
e[4].y)) && d(_, "y", Y), (!D || M & /*geom*/
|
|
2000
|
+
16 && U !== (U = /*geom*/
|
|
2001
|
+
e[4].h)) && d(_, "height", U), (!D || M & /*geom*/
|
|
2002
|
+
16 && P !== (P = /*geom*/
|
|
2003
|
+
e[4].x)) && d(G, "x", P), (!D || M & /*geom*/
|
|
2005
2004
|
16 && E !== (E = /*geom*/
|
|
2006
2005
|
e[4].y + /*geom*/
|
|
2007
|
-
e[4].h)) &&
|
|
2006
|
+
e[4].h)) && d(G, "y", E), (!D || M & /*geom*/
|
|
2008
2007
|
16 && A !== (A = /*geom*/
|
|
2009
|
-
e[4].w)) &&
|
|
2008
|
+
e[4].w)) && d(G, "width", A), (!D || M & /*geom*/
|
|
2010
2009
|
16 && N !== (N = /*geom*/
|
|
2011
|
-
e[4].x)) &&
|
|
2010
|
+
e[4].x)) && d(v, "x", N), (!D || M & /*geom*/
|
|
2012
2011
|
16 && X !== (X = /*geom*/
|
|
2013
|
-
e[4].y)) &&
|
|
2012
|
+
e[4].y)) && d(v, "y", X), (!D || M & /*geom*/
|
|
2014
2013
|
16 && K !== (K = /*geom*/
|
|
2015
|
-
e[4].h)) &&
|
|
2014
|
+
e[4].h)) && d(v, "height", K);
|
|
2016
2015
|
const Ce = {};
|
|
2017
2016
|
M & /*geom*/
|
|
2018
2017
|
16 && (Ce.x = /*geom*/
|
|
@@ -2048,22 +2047,22 @@ function No(e) {
|
|
|
2048
2047
|
e[4].y + /*geom*/
|
|
2049
2048
|
e[4].h), M & /*viewportScale*/
|
|
2050
2049
|
8 && (Ve.scale = /*viewportScale*/
|
|
2051
|
-
e[3]),
|
|
2050
|
+
e[3]), L.$set(Ve);
|
|
2052
2051
|
},
|
|
2053
|
-
i(
|
|
2054
|
-
|
|
2052
|
+
i(O) {
|
|
2053
|
+
D || (B(ae.$$.fragment, O), B(ce.$$.fragment, O), B(fe.$$.fragment, O), B(L.$$.fragment, O), D = !0);
|
|
2055
2054
|
},
|
|
2056
|
-
o(
|
|
2057
|
-
R(ae.$$.fragment,
|
|
2055
|
+
o(O) {
|
|
2056
|
+
R(ae.$$.fragment, O), R(ce.$$.fragment, O), R(fe.$$.fragment, O), R(L.$$.fragment, O), D = !1;
|
|
2058
2057
|
},
|
|
2059
|
-
d(
|
|
2060
|
-
|
|
2058
|
+
d(O) {
|
|
2059
|
+
O && (k(t), k(l), k(a), k(h), k(m), k(w), k(_), k(V), k(G), k(S), k(v), k(ge), k(Le), k(ke), k(Ie)), $(ae, O), $(ce, O), $(fe, O), $(L, O), j = !1, de(ee);
|
|
2061
2060
|
}
|
|
2062
2061
|
};
|
|
2063
2062
|
}
|
|
2064
2063
|
function Uo(e) {
|
|
2065
2064
|
let t, n;
|
|
2066
|
-
return t = new
|
|
2065
|
+
return t = new an({
|
|
2067
2066
|
props: {
|
|
2068
2067
|
shape: (
|
|
2069
2068
|
/*shape*/
|
|
@@ -2103,7 +2102,7 @@ function Uo(e) {
|
|
|
2103
2102
|
te(t.$$.fragment);
|
|
2104
2103
|
},
|
|
2105
2104
|
m(o, i) {
|
|
2106
|
-
|
|
2105
|
+
x(t, o, i), n = !0;
|
|
2107
2106
|
},
|
|
2108
2107
|
p(o, [i]) {
|
|
2109
2108
|
const s = {};
|
|
@@ -2115,44 +2114,44 @@ function Uo(e) {
|
|
|
2115
2114
|
1562 && (s.$$scope = { dirty: i, ctx: o }), t.$set(s);
|
|
2116
2115
|
},
|
|
2117
2116
|
i(o) {
|
|
2118
|
-
n || (
|
|
2117
|
+
n || (B(t.$$.fragment, o), n = !0);
|
|
2119
2118
|
},
|
|
2120
2119
|
o(o) {
|
|
2121
2120
|
R(t.$$.fragment, o), n = !1;
|
|
2122
2121
|
},
|
|
2123
2122
|
d(o) {
|
|
2124
|
-
|
|
2123
|
+
$(t, o);
|
|
2125
2124
|
}
|
|
2126
2125
|
};
|
|
2127
2126
|
}
|
|
2128
2127
|
function Vo(e, t, n) {
|
|
2129
2128
|
let o, { shape: i } = t, { computedStyle: s } = t, { transform: r } = t, { viewportScale: l = 1 } = t;
|
|
2130
|
-
const a = (
|
|
2131
|
-
const
|
|
2132
|
-
let [
|
|
2133
|
-
const [b,
|
|
2134
|
-
if (
|
|
2135
|
-
|
|
2129
|
+
const a = (g, h, m) => {
|
|
2130
|
+
const y = g.geometry.bounds;
|
|
2131
|
+
let [T, p] = [y.minX, y.minY], [w, _] = [y.maxX, y.maxY];
|
|
2132
|
+
const [b, Y] = m;
|
|
2133
|
+
if (h === "SHAPE")
|
|
2134
|
+
T += b, w += b, p += Y, _ += Y;
|
|
2136
2135
|
else {
|
|
2137
|
-
switch (
|
|
2136
|
+
switch (h) {
|
|
2138
2137
|
case "TOP":
|
|
2139
2138
|
case "TOP_LEFT":
|
|
2140
2139
|
case "TOP_RIGHT": {
|
|
2141
|
-
p +=
|
|
2140
|
+
p += Y;
|
|
2142
2141
|
break;
|
|
2143
2142
|
}
|
|
2144
2143
|
case "BOTTOM":
|
|
2145
2144
|
case "BOTTOM_LEFT":
|
|
2146
2145
|
case "BOTTOM_RIGHT": {
|
|
2147
|
-
|
|
2146
|
+
_ += Y;
|
|
2148
2147
|
break;
|
|
2149
2148
|
}
|
|
2150
2149
|
}
|
|
2151
|
-
switch (
|
|
2150
|
+
switch (h) {
|
|
2152
2151
|
case "LEFT":
|
|
2153
2152
|
case "TOP_LEFT":
|
|
2154
2153
|
case "BOTTOM_LEFT": {
|
|
2155
|
-
|
|
2154
|
+
T += b;
|
|
2156
2155
|
break;
|
|
2157
2156
|
}
|
|
2158
2157
|
case "RIGHT":
|
|
@@ -2163,34 +2162,34 @@ function Vo(e, t, n) {
|
|
|
2163
2162
|
}
|
|
2164
2163
|
}
|
|
2165
2164
|
}
|
|
2166
|
-
const U = Math.min(
|
|
2165
|
+
const U = Math.min(T, w), V = Math.min(p, _), G = Math.abs(w - T), P = Math.abs(_ - p);
|
|
2167
2166
|
return {
|
|
2168
|
-
...
|
|
2167
|
+
...g,
|
|
2169
2168
|
geometry: {
|
|
2170
2169
|
x: U,
|
|
2171
2170
|
y: V,
|
|
2172
2171
|
w: G,
|
|
2173
|
-
h:
|
|
2172
|
+
h: P,
|
|
2174
2173
|
bounds: {
|
|
2175
2174
|
minX: U,
|
|
2176
2175
|
minY: V,
|
|
2177
2176
|
maxX: U + G,
|
|
2178
|
-
maxY: V +
|
|
2177
|
+
maxY: V + P
|
|
2179
2178
|
}
|
|
2180
2179
|
}
|
|
2181
2180
|
};
|
|
2182
2181
|
};
|
|
2183
|
-
function c(
|
|
2184
|
-
he.call(this, e,
|
|
2182
|
+
function c(g) {
|
|
2183
|
+
he.call(this, e, g);
|
|
2185
2184
|
}
|
|
2186
|
-
function
|
|
2187
|
-
he.call(this, e,
|
|
2185
|
+
function u(g) {
|
|
2186
|
+
he.call(this, e, g);
|
|
2188
2187
|
}
|
|
2189
|
-
function
|
|
2190
|
-
he.call(this, e,
|
|
2188
|
+
function f(g) {
|
|
2189
|
+
he.call(this, e, g);
|
|
2191
2190
|
}
|
|
2192
|
-
return e.$$set = (
|
|
2193
|
-
"shape" in
|
|
2191
|
+
return e.$$set = (g) => {
|
|
2192
|
+
"shape" in g && n(0, i = g.shape), "computedStyle" in g && n(1, s = g.computedStyle), "transform" in g && n(2, r = g.transform), "viewportScale" in g && n(3, l = g.viewportScale);
|
|
2194
2193
|
}, e.$$.update = () => {
|
|
2195
2194
|
e.$$.dirty & /*shape*/
|
|
2196
2195
|
1 && n(4, o = i.geometry);
|
|
@@ -2202,8 +2201,8 @@ function Vo(e, t, n) {
|
|
|
2202
2201
|
o,
|
|
2203
2202
|
a,
|
|
2204
2203
|
c,
|
|
2205
|
-
|
|
2206
|
-
|
|
2204
|
+
u,
|
|
2205
|
+
f
|
|
2207
2206
|
];
|
|
2208
2207
|
}
|
|
2209
2208
|
class Go extends oe {
|
|
@@ -2216,10 +2215,10 @@ class Go extends oe {
|
|
|
2216
2215
|
});
|
|
2217
2216
|
}
|
|
2218
2217
|
}
|
|
2219
|
-
const
|
|
2218
|
+
const ln = /* @__PURE__ */ new Map([
|
|
2220
2219
|
[W.RECTANGLE, Go],
|
|
2221
|
-
[W.POLYGON,
|
|
2222
|
-
]), jo = (e) =>
|
|
2220
|
+
[W.POLYGON, Io]
|
|
2221
|
+
]), jo = (e) => ln.get(e.type), zo = (e, t) => ln.set(e, t), Ho = (e) => ({}), Pt = (e) => ({ grab: (
|
|
2223
2222
|
/*onGrab*/
|
|
2224
2223
|
e[0]
|
|
2225
2224
|
) });
|
|
@@ -2228,16 +2227,16 @@ function Fo(e) {
|
|
|
2228
2227
|
const s = (
|
|
2229
2228
|
/*#slots*/
|
|
2230
2229
|
e[7].default
|
|
2231
|
-
), r =
|
|
2230
|
+
), r = pn(
|
|
2232
2231
|
s,
|
|
2233
2232
|
e,
|
|
2234
2233
|
/*$$scope*/
|
|
2235
2234
|
e[6],
|
|
2236
|
-
|
|
2235
|
+
Pt
|
|
2237
2236
|
);
|
|
2238
2237
|
return {
|
|
2239
2238
|
c() {
|
|
2240
|
-
t = C("g"), r && r.c(),
|
|
2239
|
+
t = C("g"), r && r.c(), d(t, "class", "a9s-annotation selected");
|
|
2241
2240
|
},
|
|
2242
2241
|
m(l, a) {
|
|
2243
2242
|
I(l, t, a), r && r.m(t, null), n = !0, o || (i = [
|
|
@@ -2257,60 +2256,60 @@ function Fo(e) {
|
|
|
2257
2256
|
},
|
|
2258
2257
|
p(l, [a]) {
|
|
2259
2258
|
r && r.p && (!n || a & /*$$scope*/
|
|
2260
|
-
64) &&
|
|
2259
|
+
64) && _n(
|
|
2261
2260
|
r,
|
|
2262
2261
|
s,
|
|
2263
2262
|
l,
|
|
2264
2263
|
/*$$scope*/
|
|
2265
2264
|
l[6],
|
|
2266
|
-
n ?
|
|
2265
|
+
n ? yn(
|
|
2267
2266
|
s,
|
|
2268
2267
|
/*$$scope*/
|
|
2269
2268
|
l[6],
|
|
2270
2269
|
a,
|
|
2271
2270
|
Ho
|
|
2272
|
-
) :
|
|
2271
|
+
) : wn(
|
|
2273
2272
|
/*$$scope*/
|
|
2274
2273
|
l[6]
|
|
2275
2274
|
),
|
|
2276
|
-
|
|
2275
|
+
Pt
|
|
2277
2276
|
);
|
|
2278
2277
|
},
|
|
2279
2278
|
i(l) {
|
|
2280
|
-
n || (
|
|
2279
|
+
n || (B(r, l), n = !0);
|
|
2281
2280
|
},
|
|
2282
2281
|
o(l) {
|
|
2283
2282
|
R(r, l), n = !1;
|
|
2284
2283
|
},
|
|
2285
2284
|
d(l) {
|
|
2286
|
-
l &&
|
|
2285
|
+
l && k(t), r && r.d(l), o = !1, de(i);
|
|
2287
2286
|
}
|
|
2288
2287
|
};
|
|
2289
2288
|
}
|
|
2290
2289
|
function Wo(e, t, n) {
|
|
2291
2290
|
let { $$slots: o = {}, $$scope: i } = t;
|
|
2292
|
-
const s =
|
|
2293
|
-
let { shape: r } = t, { editor: l } = t, { transform: a } = t, c,
|
|
2294
|
-
const
|
|
2295
|
-
c =
|
|
2296
|
-
},
|
|
2291
|
+
const s = Me();
|
|
2292
|
+
let { shape: r } = t, { editor: l } = t, { transform: a } = t, c, u, f;
|
|
2293
|
+
const g = (y) => (T) => {
|
|
2294
|
+
c = y, u = a.elementToImage(T.offsetX, T.offsetY), f = r, T.target.setPointerCapture(T.pointerId), s("grab", T);
|
|
2295
|
+
}, h = (y) => {
|
|
2297
2296
|
if (c) {
|
|
2298
|
-
const [
|
|
2299
|
-
n(3, r = l(
|
|
2297
|
+
const [T, p] = a.elementToImage(y.offsetX, y.offsetY), w = [T - u[0], p - u[1]];
|
|
2298
|
+
n(3, r = l(f, c, w)), s("change", r);
|
|
2300
2299
|
}
|
|
2301
|
-
}, m = (
|
|
2302
|
-
|
|
2300
|
+
}, m = (y) => {
|
|
2301
|
+
y.target.releasePointerCapture(y.pointerId), c = void 0, f = r, s("release", y);
|
|
2303
2302
|
};
|
|
2304
|
-
return e.$$set = (
|
|
2305
|
-
"shape" in
|
|
2306
|
-
}, [
|
|
2303
|
+
return e.$$set = (y) => {
|
|
2304
|
+
"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);
|
|
2305
|
+
}, [g, h, m, r, l, a, i, o];
|
|
2307
2306
|
}
|
|
2308
|
-
class
|
|
2307
|
+
class an extends oe {
|
|
2309
2308
|
constructor(t) {
|
|
2310
2309
|
super(), ne(this, t, Wo, Fo, Z, { shape: 3, editor: 4, transform: 5 });
|
|
2311
2310
|
}
|
|
2312
2311
|
}
|
|
2313
|
-
const
|
|
2312
|
+
const xe = (e, t) => {
|
|
2314
2313
|
const n = typeof t == "function" ? t(e) : t;
|
|
2315
2314
|
if (n) {
|
|
2316
2315
|
const { fill: o, fillOpacity: i, stroke: s, strokeWidth: r, strokeOpacity: l } = n;
|
|
@@ -2320,29 +2319,29 @@ const Qe = (e, t) => {
|
|
|
2320
2319
|
};
|
|
2321
2320
|
function qo(e, t, n) {
|
|
2322
2321
|
let o;
|
|
2323
|
-
const i =
|
|
2324
|
-
let { annotation: s } = t, { editor: r } = t, { style: l } = t, { target: a } = t, { transform: c } = t, { viewportScale:
|
|
2325
|
-
return Re(() => (n(6,
|
|
2322
|
+
const i = Me();
|
|
2323
|
+
let { annotation: s } = t, { editor: r } = t, { style: l } = t, { target: a } = t, { transform: c } = t, { viewportScale: u } = t, f;
|
|
2324
|
+
return Re(() => (n(6, f = new r({
|
|
2326
2325
|
target: a,
|
|
2327
2326
|
props: {
|
|
2328
2327
|
shape: s.target.selector,
|
|
2329
2328
|
computedStyle: o,
|
|
2330
2329
|
transform: c,
|
|
2331
|
-
viewportScale:
|
|
2330
|
+
viewportScale: u
|
|
2332
2331
|
}
|
|
2333
|
-
})),
|
|
2334
|
-
|
|
2335
|
-
}),
|
|
2336
|
-
|
|
2337
|
-
})), e.$$set = (
|
|
2338
|
-
"annotation" in
|
|
2332
|
+
})), f.$on("change", (g) => {
|
|
2333
|
+
f.$$set({ shape: g.detail }), i("change", g.detail);
|
|
2334
|
+
}), f.$on("grab", (g) => i("grab", g.detail)), f.$on("release", (g) => i("release", g.detail)), () => {
|
|
2335
|
+
f.$destroy();
|
|
2336
|
+
})), e.$$set = (g) => {
|
|
2337
|
+
"annotation" in g && n(0, s = g.annotation), "editor" in g && n(1, r = g.editor), "style" in g && n(2, l = g.style), "target" in g && n(3, a = g.target), "transform" in g && n(4, c = g.transform), "viewportScale" in g && n(5, u = g.viewportScale);
|
|
2339
2338
|
}, e.$$.update = () => {
|
|
2340
2339
|
e.$$.dirty & /*annotation, style*/
|
|
2341
|
-
5 && (o =
|
|
2342
|
-
65 && s && (
|
|
2343
|
-
80 &&
|
|
2344
|
-
96 &&
|
|
2345
|
-
}, [s, r, l, a, c,
|
|
2340
|
+
5 && (o = xe(s, l)), e.$$.dirty & /*annotation, editorComponent*/
|
|
2341
|
+
65 && s && (f == null || f.$set({ shape: s.target.selector })), e.$$.dirty & /*editorComponent, transform*/
|
|
2342
|
+
80 && f && f.$set({ transform: c }), e.$$.dirty & /*editorComponent, viewportScale*/
|
|
2343
|
+
96 && f && f.$set({ viewportScale: u });
|
|
2344
|
+
}, [s, r, l, a, c, u, f];
|
|
2346
2345
|
}
|
|
2347
2346
|
class Ko extends oe {
|
|
2348
2347
|
constructor(t) {
|
|
@@ -2357,25 +2356,25 @@ class Ko extends oe {
|
|
|
2357
2356
|
}
|
|
2358
2357
|
}
|
|
2359
2358
|
function Jo(e, t, n) {
|
|
2360
|
-
const o =
|
|
2359
|
+
const o = Me();
|
|
2361
2360
|
let { drawingMode: i } = t, { target: s } = t, { tool: r } = t, { transform: l } = t, { viewportScale: a } = t, c;
|
|
2362
2361
|
return Re(() => {
|
|
2363
|
-
const
|
|
2364
|
-
|
|
2362
|
+
const u = s.closest("svg"), f = [], g = (h, m, y) => {
|
|
2363
|
+
u == null || u.addEventListener(h, m, y), f.push(() => u == null ? void 0 : u.removeEventListener(h, m, y));
|
|
2365
2364
|
};
|
|
2366
2365
|
return n(5, c = new r({
|
|
2367
2366
|
target: s,
|
|
2368
2367
|
props: {
|
|
2369
|
-
addEventListener:
|
|
2368
|
+
addEventListener: g,
|
|
2370
2369
|
drawingMode: i,
|
|
2371
2370
|
transform: l,
|
|
2372
2371
|
viewportScale: a
|
|
2373
2372
|
}
|
|
2374
|
-
})), c.$on("create", (
|
|
2375
|
-
|
|
2373
|
+
})), c.$on("create", (h) => o("create", h.detail)), () => {
|
|
2374
|
+
f.forEach((h) => h()), c.$destroy();
|
|
2376
2375
|
};
|
|
2377
|
-
}), e.$$set = (
|
|
2378
|
-
"drawingMode" in
|
|
2376
|
+
}), e.$$set = (u) => {
|
|
2377
|
+
"drawingMode" in u && n(0, i = u.drawingMode), "target" in u && n(1, s = u.target), "tool" in u && n(2, r = u.tool), "transform" in u && n(3, l = u.transform), "viewportScale" in u && n(4, a = u.viewportScale);
|
|
2379
2378
|
}, e.$$.update = () => {
|
|
2380
2379
|
e.$$.dirty & /*toolComponent, transform*/
|
|
2381
2380
|
40 && c && c.$set({ transform: l }), e.$$.dirty & /*toolComponent, viewportScale*/
|
|
@@ -2393,46 +2392,46 @@ class Qo extends oe {
|
|
|
2393
2392
|
});
|
|
2394
2393
|
}
|
|
2395
2394
|
}
|
|
2396
|
-
function
|
|
2395
|
+
function Yt(e) {
|
|
2397
2396
|
let t, n;
|
|
2398
2397
|
return {
|
|
2399
2398
|
c() {
|
|
2400
|
-
t = C("rect"), n = C("rect"),
|
|
2399
|
+
t = C("rect"), n = C("rect"), d(t, "class", "a9s-outer"), d(
|
|
2401
2400
|
t,
|
|
2402
2401
|
"x",
|
|
2403
2402
|
/*x*/
|
|
2404
2403
|
e[1]
|
|
2405
|
-
),
|
|
2404
|
+
), d(
|
|
2406
2405
|
t,
|
|
2407
2406
|
"y",
|
|
2408
2407
|
/*y*/
|
|
2409
2408
|
e[2]
|
|
2410
|
-
),
|
|
2409
|
+
), d(
|
|
2411
2410
|
t,
|
|
2412
2411
|
"width",
|
|
2413
2412
|
/*w*/
|
|
2414
2413
|
e[3]
|
|
2415
|
-
),
|
|
2414
|
+
), d(
|
|
2416
2415
|
t,
|
|
2417
2416
|
"height",
|
|
2418
2417
|
/*h*/
|
|
2419
2418
|
e[4]
|
|
2420
|
-
),
|
|
2419
|
+
), d(n, "class", "a9s-inner"), d(
|
|
2421
2420
|
n,
|
|
2422
2421
|
"x",
|
|
2423
2422
|
/*x*/
|
|
2424
2423
|
e[1]
|
|
2425
|
-
),
|
|
2424
|
+
), d(
|
|
2426
2425
|
n,
|
|
2427
2426
|
"y",
|
|
2428
2427
|
/*y*/
|
|
2429
2428
|
e[2]
|
|
2430
|
-
),
|
|
2429
|
+
), d(
|
|
2431
2430
|
n,
|
|
2432
2431
|
"width",
|
|
2433
2432
|
/*w*/
|
|
2434
2433
|
e[3]
|
|
2435
|
-
),
|
|
2434
|
+
), d(
|
|
2436
2435
|
n,
|
|
2437
2436
|
"height",
|
|
2438
2437
|
/*h*/
|
|
@@ -2444,49 +2443,49 @@ function Bt(e) {
|
|
|
2444
2443
|
},
|
|
2445
2444
|
p(o, i) {
|
|
2446
2445
|
i & /*x*/
|
|
2447
|
-
2 &&
|
|
2446
|
+
2 && d(
|
|
2448
2447
|
t,
|
|
2449
2448
|
"x",
|
|
2450
2449
|
/*x*/
|
|
2451
2450
|
o[1]
|
|
2452
2451
|
), i & /*y*/
|
|
2453
|
-
4 &&
|
|
2452
|
+
4 && d(
|
|
2454
2453
|
t,
|
|
2455
2454
|
"y",
|
|
2456
2455
|
/*y*/
|
|
2457
2456
|
o[2]
|
|
2458
2457
|
), i & /*w*/
|
|
2459
|
-
8 &&
|
|
2458
|
+
8 && d(
|
|
2460
2459
|
t,
|
|
2461
2460
|
"width",
|
|
2462
2461
|
/*w*/
|
|
2463
2462
|
o[3]
|
|
2464
2463
|
), i & /*h*/
|
|
2465
|
-
16 &&
|
|
2464
|
+
16 && d(
|
|
2466
2465
|
t,
|
|
2467
2466
|
"height",
|
|
2468
2467
|
/*h*/
|
|
2469
2468
|
o[4]
|
|
2470
2469
|
), i & /*x*/
|
|
2471
|
-
2 &&
|
|
2470
|
+
2 && d(
|
|
2472
2471
|
n,
|
|
2473
2472
|
"x",
|
|
2474
2473
|
/*x*/
|
|
2475
2474
|
o[1]
|
|
2476
2475
|
), i & /*y*/
|
|
2477
|
-
4 &&
|
|
2476
|
+
4 && d(
|
|
2478
2477
|
n,
|
|
2479
2478
|
"y",
|
|
2480
2479
|
/*y*/
|
|
2481
2480
|
o[2]
|
|
2482
2481
|
), i & /*w*/
|
|
2483
|
-
8 &&
|
|
2482
|
+
8 && d(
|
|
2484
2483
|
n,
|
|
2485
2484
|
"width",
|
|
2486
2485
|
/*w*/
|
|
2487
2486
|
o[3]
|
|
2488
2487
|
), i & /*h*/
|
|
2489
|
-
16 &&
|
|
2488
|
+
16 && d(
|
|
2490
2489
|
n,
|
|
2491
2490
|
"height",
|
|
2492
2491
|
/*h*/
|
|
@@ -2494,63 +2493,63 @@ function Bt(e) {
|
|
|
2494
2493
|
);
|
|
2495
2494
|
},
|
|
2496
2495
|
d(o) {
|
|
2497
|
-
o && (
|
|
2496
|
+
o && (k(t), k(n));
|
|
2498
2497
|
}
|
|
2499
2498
|
};
|
|
2500
2499
|
}
|
|
2501
2500
|
function Zo(e) {
|
|
2502
2501
|
let t, n = (
|
|
2503
2502
|
/*origin*/
|
|
2504
|
-
e[0] &&
|
|
2503
|
+
e[0] && Yt(e)
|
|
2505
2504
|
);
|
|
2506
2505
|
return {
|
|
2507
2506
|
c() {
|
|
2508
|
-
t = C("g"), n && n.c(),
|
|
2507
|
+
t = C("g"), n && n.c(), d(t, "class", "a9s-annotation a9s-rubberband");
|
|
2509
2508
|
},
|
|
2510
2509
|
m(o, i) {
|
|
2511
2510
|
I(o, t, i), n && n.m(t, null);
|
|
2512
2511
|
},
|
|
2513
2512
|
p(o, [i]) {
|
|
2514
2513
|
/*origin*/
|
|
2515
|
-
o[0] ? n ? n.p(o, i) : (n =
|
|
2514
|
+
o[0] ? n ? n.p(o, i) : (n = Yt(o), n.c(), n.m(t, null)) : n && (n.d(1), n = null);
|
|
2516
2515
|
},
|
|
2517
|
-
i:
|
|
2518
|
-
o:
|
|
2516
|
+
i: H,
|
|
2517
|
+
o: H,
|
|
2519
2518
|
d(o) {
|
|
2520
|
-
o &&
|
|
2519
|
+
o && k(t), n && n.d();
|
|
2521
2520
|
}
|
|
2522
2521
|
};
|
|
2523
2522
|
}
|
|
2524
2523
|
function xo(e, t, n) {
|
|
2525
|
-
const o =
|
|
2526
|
-
let { addEventListener: i } = t, { drawingMode: s } = t, { transform: r } = t, l, a, c,
|
|
2524
|
+
const o = Me();
|
|
2525
|
+
let { addEventListener: i } = t, { drawingMode: s } = t, { transform: r } = t, l, a, c, u, f, g, h;
|
|
2527
2526
|
const m = (w) => {
|
|
2528
|
-
const
|
|
2529
|
-
l = performance.now(), s === "drag" && (n(0, a = r.elementToImage(
|
|
2530
|
-
},
|
|
2531
|
-
const
|
|
2532
|
-
a && (c = r.elementToImage(
|
|
2533
|
-
},
|
|
2534
|
-
const
|
|
2527
|
+
const _ = w;
|
|
2528
|
+
l = performance.now(), s === "drag" && (n(0, a = r.elementToImage(_.offsetX, _.offsetY)), c = a, n(1, u = a[0]), n(2, f = a[1]), n(3, g = 1), n(4, h = 1));
|
|
2529
|
+
}, y = (w) => {
|
|
2530
|
+
const _ = w;
|
|
2531
|
+
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, g = Math.abs(c[0] - a[0])), n(4, h = Math.abs(c[1] - a[1])));
|
|
2532
|
+
}, T = (w) => {
|
|
2533
|
+
const _ = w, b = performance.now() - l;
|
|
2535
2534
|
if (s === "click") {
|
|
2536
2535
|
if (b > 300) return;
|
|
2537
|
-
a ? p() : (n(0, a = r.elementToImage(
|
|
2538
|
-
} else a && (b > 300 ||
|
|
2536
|
+
a ? p() : (n(0, a = r.elementToImage(_.offsetX, _.offsetY)), c = a, n(1, u = a[0]), n(2, f = a[1]), n(3, g = 1), n(4, h = 1));
|
|
2537
|
+
} else a && (b > 300 || g * h > 100 ? (_.stopPropagation(), p()) : (n(0, a = void 0), c = void 0));
|
|
2539
2538
|
}, p = () => {
|
|
2540
|
-
if (
|
|
2539
|
+
if (g * h > 15) {
|
|
2541
2540
|
const w = {
|
|
2542
2541
|
type: W.RECTANGLE,
|
|
2543
2542
|
geometry: {
|
|
2544
2543
|
bounds: {
|
|
2545
|
-
minX:
|
|
2546
|
-
minY:
|
|
2547
|
-
maxX:
|
|
2548
|
-
maxY:
|
|
2544
|
+
minX: u,
|
|
2545
|
+
minY: f,
|
|
2546
|
+
maxX: u + g,
|
|
2547
|
+
maxY: f + h
|
|
2549
2548
|
},
|
|
2550
|
-
x:
|
|
2551
|
-
y:
|
|
2552
|
-
w:
|
|
2553
|
-
h
|
|
2549
|
+
x: u,
|
|
2550
|
+
y: f,
|
|
2551
|
+
w: g,
|
|
2552
|
+
h
|
|
2554
2553
|
}
|
|
2555
2554
|
};
|
|
2556
2555
|
o("create", w);
|
|
@@ -2558,10 +2557,10 @@ function xo(e, t, n) {
|
|
|
2558
2557
|
n(0, a = void 0), c = void 0;
|
|
2559
2558
|
};
|
|
2560
2559
|
return Re(() => {
|
|
2561
|
-
i("pointerdown", m), i("pointermove",
|
|
2560
|
+
i("pointerdown", m), i("pointermove", y), i("pointerup", T, !0);
|
|
2562
2561
|
}), e.$$set = (w) => {
|
|
2563
2562
|
"addEventListener" in w && n(5, i = w.addEventListener), "drawingMode" in w && n(6, s = w.drawingMode), "transform" in w && n(7, r = w.transform);
|
|
2564
|
-
}, [a,
|
|
2563
|
+
}, [a, u, f, g, h, i, s, r];
|
|
2565
2564
|
}
|
|
2566
2565
|
class $o extends oe {
|
|
2567
2566
|
constructor(t) {
|
|
@@ -2572,7 +2571,7 @@ class $o extends oe {
|
|
|
2572
2571
|
});
|
|
2573
2572
|
}
|
|
2574
2573
|
}
|
|
2575
|
-
function
|
|
2574
|
+
function lt(e) {
|
|
2576
2575
|
const t = e.slice(), n = (
|
|
2577
2576
|
/*isClosable*/
|
|
2578
2577
|
(t[2] ? (
|
|
@@ -2587,15 +2586,15 @@ function st(e) {
|
|
|
2587
2586
|
);
|
|
2588
2587
|
return t[16] = n, t;
|
|
2589
2588
|
}
|
|
2590
|
-
function
|
|
2589
|
+
function Dt(e) {
|
|
2591
2590
|
let t, n, o, i, s, r = (
|
|
2592
2591
|
/*isClosable*/
|
|
2593
|
-
e[2] &&
|
|
2592
|
+
e[2] && Xt(e)
|
|
2594
2593
|
);
|
|
2595
2594
|
return {
|
|
2596
2595
|
c() {
|
|
2597
|
-
t = C("polygon"), o = C("polygon"), r && r.c(), s = le(),
|
|
2598
|
-
e[16]),
|
|
2596
|
+
t = C("polygon"), o = C("polygon"), r && r.c(), s = le(), d(t, "class", "a9s-outer"), d(t, "points", n = /*coords*/
|
|
2597
|
+
e[16]), d(o, "class", "a9s-inner"), d(o, "points", i = /*coords*/
|
|
2599
2598
|
e[16]);
|
|
2600
2599
|
},
|
|
2601
2600
|
m(l, a) {
|
|
@@ -2604,30 +2603,30 @@ function Pt(e) {
|
|
|
2604
2603
|
p(l, a) {
|
|
2605
2604
|
a & /*isClosable, points, cursor*/
|
|
2606
2605
|
7 && n !== (n = /*coords*/
|
|
2607
|
-
l[16]) &&
|
|
2606
|
+
l[16]) && d(t, "points", n), a & /*isClosable, points, cursor*/
|
|
2608
2607
|
7 && i !== (i = /*coords*/
|
|
2609
|
-
l[16]) &&
|
|
2610
|
-
l[2] ? r ? r.p(l, a) : (r =
|
|
2608
|
+
l[16]) && d(o, "points", i), /*isClosable*/
|
|
2609
|
+
l[2] ? r ? r.p(l, a) : (r = Xt(l), r.c(), r.m(s.parentNode, s)) : r && (r.d(1), r = null);
|
|
2611
2610
|
},
|
|
2612
2611
|
d(l) {
|
|
2613
|
-
l && (
|
|
2612
|
+
l && (k(t), k(o), k(s)), r && r.d(l);
|
|
2614
2613
|
}
|
|
2615
2614
|
};
|
|
2616
2615
|
}
|
|
2617
|
-
function
|
|
2616
|
+
function Xt(e) {
|
|
2618
2617
|
let t, n, o;
|
|
2619
2618
|
return {
|
|
2620
2619
|
c() {
|
|
2621
|
-
t = C("rect"),
|
|
2620
|
+
t = C("rect"), d(t, "class", "a9s-corner-handle"), d(t, "x", n = /*points*/
|
|
2622
2621
|
e[0][0][0] - /*handleSize*/
|
|
2623
|
-
e[3] / 2),
|
|
2622
|
+
e[3] / 2), d(t, "y", o = /*points*/
|
|
2624
2623
|
e[0][0][1] - /*handleSize*/
|
|
2625
|
-
e[3] / 2),
|
|
2624
|
+
e[3] / 2), d(
|
|
2626
2625
|
t,
|
|
2627
2626
|
"height",
|
|
2628
2627
|
/*handleSize*/
|
|
2629
2628
|
e[3]
|
|
2630
|
-
),
|
|
2629
|
+
), d(
|
|
2631
2630
|
t,
|
|
2632
2631
|
"width",
|
|
2633
2632
|
/*handleSize*/
|
|
@@ -2641,17 +2640,17 @@ function Yt(e) {
|
|
|
2641
2640
|
s & /*points, handleSize*/
|
|
2642
2641
|
9 && n !== (n = /*points*/
|
|
2643
2642
|
i[0][0][0] - /*handleSize*/
|
|
2644
|
-
i[3] / 2) &&
|
|
2643
|
+
i[3] / 2) && d(t, "x", n), s & /*points, handleSize*/
|
|
2645
2644
|
9 && o !== (o = /*points*/
|
|
2646
2645
|
i[0][0][1] - /*handleSize*/
|
|
2647
|
-
i[3] / 2) &&
|
|
2648
|
-
8 &&
|
|
2646
|
+
i[3] / 2) && d(t, "y", o), s & /*handleSize*/
|
|
2647
|
+
8 && d(
|
|
2649
2648
|
t,
|
|
2650
2649
|
"height",
|
|
2651
2650
|
/*handleSize*/
|
|
2652
2651
|
i[3]
|
|
2653
2652
|
), s & /*handleSize*/
|
|
2654
|
-
8 &&
|
|
2653
|
+
8 && d(
|
|
2655
2654
|
t,
|
|
2656
2655
|
"width",
|
|
2657
2656
|
/*handleSize*/
|
|
@@ -2659,105 +2658,105 @@ function Yt(e) {
|
|
|
2659
2658
|
);
|
|
2660
2659
|
},
|
|
2661
2660
|
d(i) {
|
|
2662
|
-
i &&
|
|
2661
|
+
i && k(t);
|
|
2663
2662
|
}
|
|
2664
2663
|
};
|
|
2665
2664
|
}
|
|
2666
2665
|
function ei(e) {
|
|
2667
2666
|
let t, n = (
|
|
2668
2667
|
/*cursor*/
|
|
2669
|
-
e[1] &&
|
|
2668
|
+
e[1] && Dt(lt(e))
|
|
2670
2669
|
);
|
|
2671
2670
|
return {
|
|
2672
2671
|
c() {
|
|
2673
|
-
t = C("g"), n && n.c(),
|
|
2672
|
+
t = C("g"), n && n.c(), d(t, "class", "a9s-annotation a9s-rubberband");
|
|
2674
2673
|
},
|
|
2675
2674
|
m(o, i) {
|
|
2676
2675
|
I(o, t, i), n && n.m(t, null);
|
|
2677
2676
|
},
|
|
2678
2677
|
p(o, [i]) {
|
|
2679
2678
|
/*cursor*/
|
|
2680
|
-
o[1] ? n ? n.p(
|
|
2679
|
+
o[1] ? n ? n.p(lt(o), i) : (n = Dt(lt(o)), n.c(), n.m(t, null)) : n && (n.d(1), n = null);
|
|
2681
2680
|
},
|
|
2682
|
-
i:
|
|
2683
|
-
o:
|
|
2681
|
+
i: H,
|
|
2682
|
+
o: H,
|
|
2684
2683
|
d(o) {
|
|
2685
|
-
o &&
|
|
2684
|
+
o && k(t), n && n.d();
|
|
2686
2685
|
}
|
|
2687
2686
|
};
|
|
2688
2687
|
}
|
|
2689
2688
|
const ti = 20, ni = 1500;
|
|
2690
2689
|
function oi(e, t, n) {
|
|
2691
2690
|
let o;
|
|
2692
|
-
const i =
|
|
2693
|
-
let { addEventListener: s } = t, { drawingMode: r } = t, { transform: l } = t, { viewportScale: a = 1 } = t, c,
|
|
2694
|
-
const m = (
|
|
2695
|
-
const b =
|
|
2696
|
-
if (c = { timeStamp:
|
|
2691
|
+
const i = Me();
|
|
2692
|
+
let { addEventListener: s } = t, { drawingMode: r } = t, { transform: l } = t, { viewportScale: a = 1 } = t, c, u = [], f, g, h = !1;
|
|
2693
|
+
const m = (_) => {
|
|
2694
|
+
const b = _, { timeStamp: Y, offsetX: U, offsetY: V } = b;
|
|
2695
|
+
if (c = { timeStamp: Y, offsetX: U, offsetY: V }, r === "drag" && u.length === 0) {
|
|
2697
2696
|
const G = l.elementToImage(b.offsetX, b.offsetY);
|
|
2698
|
-
|
|
2697
|
+
u.push(G), n(1, f = G);
|
|
2699
2698
|
}
|
|
2700
|
-
},
|
|
2701
|
-
const b =
|
|
2702
|
-
if (
|
|
2703
|
-
if (n(1,
|
|
2704
|
-
const
|
|
2705
|
-
n(2,
|
|
2699
|
+
}, y = (_) => {
|
|
2700
|
+
const b = _;
|
|
2701
|
+
if (g && clearTimeout(g), u.length > 0) {
|
|
2702
|
+
if (n(1, f = l.elementToImage(b.offsetX, b.offsetY)), u.length > 2) {
|
|
2703
|
+
const Y = rt(f, u[0]) * a;
|
|
2704
|
+
n(2, h = Y < ti);
|
|
2706
2705
|
}
|
|
2707
|
-
b.pointerType === "touch" && (
|
|
2706
|
+
b.pointerType === "touch" && (g = setTimeout(
|
|
2708
2707
|
() => {
|
|
2709
2708
|
p();
|
|
2710
2709
|
},
|
|
2711
2710
|
ni
|
|
2712
2711
|
));
|
|
2713
2712
|
}
|
|
2714
|
-
},
|
|
2715
|
-
const b =
|
|
2716
|
-
if (
|
|
2717
|
-
const
|
|
2718
|
-
if (
|
|
2719
|
-
if (
|
|
2713
|
+
}, T = (_) => {
|
|
2714
|
+
const b = _;
|
|
2715
|
+
if (g && clearTimeout(g), r === "click") {
|
|
2716
|
+
const Y = b.timeStamp - c.timeStamp, U = rt([c.offsetX, c.offsetY], [b.offsetX, b.offsetY]);
|
|
2717
|
+
if (Y > 300 || U > 15) return;
|
|
2718
|
+
if (h)
|
|
2720
2719
|
w();
|
|
2721
|
-
else if (
|
|
2720
|
+
else if (u.length === 0) {
|
|
2722
2721
|
const V = l.elementToImage(b.offsetX, b.offsetY);
|
|
2723
|
-
|
|
2722
|
+
u.push(V), n(1, f = V);
|
|
2724
2723
|
} else
|
|
2725
|
-
|
|
2724
|
+
u.push(f);
|
|
2726
2725
|
} else {
|
|
2727
|
-
if (
|
|
2728
|
-
n(0,
|
|
2726
|
+
if (u.length === 1 && rt(u[0], f) <= 4) {
|
|
2727
|
+
n(0, u = []), n(1, f = void 0);
|
|
2729
2728
|
return;
|
|
2730
2729
|
}
|
|
2731
|
-
b.stopImmediatePropagation(),
|
|
2730
|
+
b.stopImmediatePropagation(), h ? w() : u.push(f);
|
|
2732
2731
|
}
|
|
2733
2732
|
}, p = () => {
|
|
2734
|
-
if (!
|
|
2735
|
-
const
|
|
2733
|
+
if (!f) return;
|
|
2734
|
+
const _ = [...u, f], b = {
|
|
2736
2735
|
type: W.POLYGON,
|
|
2737
|
-
geometry: { bounds:
|
|
2736
|
+
geometry: { bounds: Qe(_), points: _ }
|
|
2738
2737
|
};
|
|
2739
|
-
|
|
2738
|
+
gt(b) > 4 && (n(0, u = []), n(1, f = void 0), i("create", b));
|
|
2740
2739
|
}, w = () => {
|
|
2741
|
-
const
|
|
2740
|
+
const _ = {
|
|
2742
2741
|
type: W.POLYGON,
|
|
2743
2742
|
geometry: {
|
|
2744
|
-
bounds:
|
|
2745
|
-
points: [...
|
|
2743
|
+
bounds: Qe(u),
|
|
2744
|
+
points: [...u]
|
|
2746
2745
|
}
|
|
2747
2746
|
};
|
|
2748
|
-
n(0,
|
|
2747
|
+
n(0, u = []), n(1, f = void 0), i("create", _);
|
|
2749
2748
|
};
|
|
2750
2749
|
return Re(() => {
|
|
2751
|
-
s("pointerdown", m, !0), s("pointermove",
|
|
2752
|
-
}), e.$$set = (
|
|
2753
|
-
"addEventListener" in
|
|
2750
|
+
s("pointerdown", m, !0), s("pointermove", y), s("pointerup", T, !0), s("dblclick", p, !0);
|
|
2751
|
+
}), e.$$set = (_) => {
|
|
2752
|
+
"addEventListener" in _ && n(4, s = _.addEventListener), "drawingMode" in _ && n(5, r = _.drawingMode), "transform" in _ && n(6, l = _.transform), "viewportScale" in _ && n(7, a = _.viewportScale);
|
|
2754
2753
|
}, e.$$.update = () => {
|
|
2755
2754
|
e.$$.dirty & /*viewportScale*/
|
|
2756
2755
|
128 && n(3, o = 10 / a);
|
|
2757
2756
|
}, [
|
|
2758
|
-
f,
|
|
2759
2757
|
u,
|
|
2760
|
-
|
|
2758
|
+
f,
|
|
2759
|
+
h,
|
|
2761
2760
|
o,
|
|
2762
2761
|
s,
|
|
2763
2762
|
r,
|
|
@@ -2775,61 +2774,61 @@ class ii extends oe {
|
|
|
2775
2774
|
});
|
|
2776
2775
|
}
|
|
2777
2776
|
}
|
|
2778
|
-
const
|
|
2777
|
+
const wt = /* @__PURE__ */ new Map([
|
|
2779
2778
|
["rectangle", { tool: $o }],
|
|
2780
2779
|
["polygon", { tool: ii }]
|
|
2781
|
-
]),
|
|
2780
|
+
]), cn = () => [...wt.keys()], fn = (e) => wt.get(e), si = (e, t, n) => wt.set(e, { tool: t, opts: n });
|
|
2782
2781
|
function ri(e) {
|
|
2783
2782
|
let t, n, o, i, s;
|
|
2784
2783
|
return {
|
|
2785
2784
|
c() {
|
|
2786
|
-
t = C("g"), n = C("ellipse"), i = C("ellipse"),
|
|
2787
|
-
e[1] ? "display:none;" : void 0),
|
|
2785
|
+
t = C("g"), n = C("ellipse"), i = C("ellipse"), d(n, "class", "a9s-outer"), d(n, "style", o = /*computedStyle*/
|
|
2786
|
+
e[1] ? "display:none;" : void 0), d(
|
|
2788
2787
|
n,
|
|
2789
2788
|
"cx",
|
|
2790
2789
|
/*cx*/
|
|
2791
2790
|
e[2]
|
|
2792
|
-
),
|
|
2791
|
+
), d(
|
|
2793
2792
|
n,
|
|
2794
2793
|
"cy",
|
|
2795
2794
|
/*cy*/
|
|
2796
2795
|
e[3]
|
|
2797
|
-
),
|
|
2796
|
+
), d(
|
|
2798
2797
|
n,
|
|
2799
2798
|
"rx",
|
|
2800
2799
|
/*rx*/
|
|
2801
2800
|
e[4]
|
|
2802
|
-
),
|
|
2801
|
+
), d(
|
|
2803
2802
|
n,
|
|
2804
2803
|
"ry",
|
|
2805
2804
|
/*ry*/
|
|
2806
2805
|
e[5]
|
|
2807
|
-
),
|
|
2806
|
+
), d(i, "class", "a9s-inner"), d(
|
|
2808
2807
|
i,
|
|
2809
2808
|
"style",
|
|
2810
2809
|
/*computedStyle*/
|
|
2811
2810
|
e[1]
|
|
2812
|
-
),
|
|
2811
|
+
), d(
|
|
2813
2812
|
i,
|
|
2814
2813
|
"cx",
|
|
2815
2814
|
/*cx*/
|
|
2816
2815
|
e[2]
|
|
2817
|
-
),
|
|
2816
|
+
), d(
|
|
2818
2817
|
i,
|
|
2819
2818
|
"cy",
|
|
2820
2819
|
/*cy*/
|
|
2821
2820
|
e[3]
|
|
2822
|
-
),
|
|
2821
|
+
), d(
|
|
2823
2822
|
i,
|
|
2824
2823
|
"rx",
|
|
2825
2824
|
/*rx*/
|
|
2826
2825
|
e[4]
|
|
2827
|
-
),
|
|
2826
|
+
), d(
|
|
2828
2827
|
i,
|
|
2829
2828
|
"ry",
|
|
2830
2829
|
/*ry*/
|
|
2831
2830
|
e[5]
|
|
2832
|
-
),
|
|
2831
|
+
), d(t, "class", "a9s-annotation"), d(t, "data-id", s = /*annotation*/
|
|
2833
2832
|
e[0].id);
|
|
2834
2833
|
},
|
|
2835
2834
|
m(r, l) {
|
|
@@ -2838,32 +2837,32 @@ function ri(e) {
|
|
|
2838
2837
|
p(r, [l]) {
|
|
2839
2838
|
l & /*computedStyle*/
|
|
2840
2839
|
2 && o !== (o = /*computedStyle*/
|
|
2841
|
-
r[1] ? "display:none;" : void 0) &&
|
|
2842
|
-
2 &&
|
|
2840
|
+
r[1] ? "display:none;" : void 0) && d(n, "style", o), l & /*computedStyle*/
|
|
2841
|
+
2 && d(
|
|
2843
2842
|
i,
|
|
2844
2843
|
"style",
|
|
2845
2844
|
/*computedStyle*/
|
|
2846
2845
|
r[1]
|
|
2847
2846
|
), l & /*annotation*/
|
|
2848
2847
|
1 && s !== (s = /*annotation*/
|
|
2849
|
-
r[0].id) &&
|
|
2848
|
+
r[0].id) && d(t, "data-id", s);
|
|
2850
2849
|
},
|
|
2851
|
-
i:
|
|
2852
|
-
o:
|
|
2850
|
+
i: H,
|
|
2851
|
+
o: H,
|
|
2853
2852
|
d(r) {
|
|
2854
|
-
r &&
|
|
2853
|
+
r && k(t);
|
|
2855
2854
|
}
|
|
2856
2855
|
};
|
|
2857
2856
|
}
|
|
2858
2857
|
function li(e, t, n) {
|
|
2859
2858
|
let o, { annotation: i } = t, { geom: s } = t, { style: r } = t;
|
|
2860
|
-
const { cx: l, cy: a, rx: c, ry:
|
|
2861
|
-
return e.$$set = (
|
|
2862
|
-
"annotation" in
|
|
2859
|
+
const { cx: l, cy: a, rx: c, ry: u } = s;
|
|
2860
|
+
return e.$$set = (f) => {
|
|
2861
|
+
"annotation" in f && n(0, i = f.annotation), "geom" in f && n(6, s = f.geom), "style" in f && n(7, r = f.style);
|
|
2863
2862
|
}, e.$$.update = () => {
|
|
2864
2863
|
e.$$.dirty & /*annotation, style*/
|
|
2865
|
-
129 && n(1, o =
|
|
2866
|
-
}, [i, o, l, a, c,
|
|
2864
|
+
129 && n(1, o = xe(i, r));
|
|
2865
|
+
}, [i, o, l, a, c, u, s, r];
|
|
2867
2866
|
}
|
|
2868
2867
|
class ai extends oe {
|
|
2869
2868
|
constructor(t) {
|
|
@@ -2874,23 +2873,23 @@ function ci(e) {
|
|
|
2874
2873
|
let t, n, o, i, s;
|
|
2875
2874
|
return {
|
|
2876
2875
|
c() {
|
|
2877
|
-
t = C("g"), n = C("polygon"), i = C("polygon"),
|
|
2878
|
-
e[1] ? "display:none;" : void 0),
|
|
2876
|
+
t = C("g"), n = C("polygon"), i = C("polygon"), d(n, "class", "a9s-outer"), d(n, "style", o = /*computedStyle*/
|
|
2877
|
+
e[1] ? "display:none;" : void 0), d(
|
|
2879
2878
|
n,
|
|
2880
2879
|
"points",
|
|
2881
2880
|
/*points*/
|
|
2882
2881
|
e[2].map(fi).join(" ")
|
|
2883
|
-
),
|
|
2882
|
+
), d(i, "class", "a9s-inner"), d(
|
|
2884
2883
|
i,
|
|
2885
2884
|
"style",
|
|
2886
2885
|
/*computedStyle*/
|
|
2887
2886
|
e[1]
|
|
2888
|
-
),
|
|
2887
|
+
), d(
|
|
2889
2888
|
i,
|
|
2890
2889
|
"points",
|
|
2891
2890
|
/*points*/
|
|
2892
2891
|
e[2].map(ui).join(" ")
|
|
2893
|
-
),
|
|
2892
|
+
), d(t, "class", "a9s-annotation"), d(t, "data-id", s = /*annotation*/
|
|
2894
2893
|
e[0].id);
|
|
2895
2894
|
},
|
|
2896
2895
|
m(r, l) {
|
|
@@ -2899,20 +2898,20 @@ function ci(e) {
|
|
|
2899
2898
|
p(r, [l]) {
|
|
2900
2899
|
l & /*computedStyle*/
|
|
2901
2900
|
2 && o !== (o = /*computedStyle*/
|
|
2902
|
-
r[1] ? "display:none;" : void 0) &&
|
|
2903
|
-
2 &&
|
|
2901
|
+
r[1] ? "display:none;" : void 0) && d(n, "style", o), l & /*computedStyle*/
|
|
2902
|
+
2 && d(
|
|
2904
2903
|
i,
|
|
2905
2904
|
"style",
|
|
2906
2905
|
/*computedStyle*/
|
|
2907
2906
|
r[1]
|
|
2908
2907
|
), l & /*annotation*/
|
|
2909
2908
|
1 && s !== (s = /*annotation*/
|
|
2910
|
-
r[0].id) &&
|
|
2909
|
+
r[0].id) && d(t, "data-id", s);
|
|
2911
2910
|
},
|
|
2912
|
-
i:
|
|
2913
|
-
o:
|
|
2911
|
+
i: H,
|
|
2912
|
+
o: H,
|
|
2914
2913
|
d(r) {
|
|
2915
|
-
r &&
|
|
2914
|
+
r && k(t);
|
|
2916
2915
|
}
|
|
2917
2916
|
};
|
|
2918
2917
|
}
|
|
@@ -2924,7 +2923,7 @@ function di(e, t, n) {
|
|
|
2924
2923
|
"annotation" in a && n(0, i = a.annotation), "geom" in a && n(3, s = a.geom), "style" in a && n(4, r = a.style);
|
|
2925
2924
|
}, e.$$.update = () => {
|
|
2926
2925
|
e.$$.dirty & /*annotation, style*/
|
|
2927
|
-
17 && n(1, o =
|
|
2926
|
+
17 && n(1, o = xe(i, r));
|
|
2928
2927
|
}, [i, o, l, s, r];
|
|
2929
2928
|
}
|
|
2930
2929
|
class hi extends oe {
|
|
@@ -2936,53 +2935,53 @@ function gi(e) {
|
|
|
2936
2935
|
let t, n, o, i, s;
|
|
2937
2936
|
return {
|
|
2938
2937
|
c() {
|
|
2939
|
-
t = C("g"), n = C("rect"), i = C("rect"),
|
|
2940
|
-
e[5] ? "display:none;" : void 0),
|
|
2938
|
+
t = C("g"), n = C("rect"), i = C("rect"), d(n, "class", "a9s-outer"), d(n, "style", o = /*computedStyle*/
|
|
2939
|
+
e[5] ? "display:none;" : void 0), d(
|
|
2941
2940
|
n,
|
|
2942
2941
|
"x",
|
|
2943
2942
|
/*x*/
|
|
2944
2943
|
e[4]
|
|
2945
|
-
),
|
|
2944
|
+
), d(
|
|
2946
2945
|
n,
|
|
2947
2946
|
"y",
|
|
2948
2947
|
/*y*/
|
|
2949
2948
|
e[3]
|
|
2950
|
-
),
|
|
2949
|
+
), d(
|
|
2951
2950
|
n,
|
|
2952
2951
|
"width",
|
|
2953
2952
|
/*w*/
|
|
2954
2953
|
e[2]
|
|
2955
|
-
),
|
|
2954
|
+
), d(
|
|
2956
2955
|
n,
|
|
2957
2956
|
"height",
|
|
2958
2957
|
/*h*/
|
|
2959
2958
|
e[1]
|
|
2960
|
-
),
|
|
2959
|
+
), d(i, "class", "a9s-inner"), d(
|
|
2961
2960
|
i,
|
|
2962
2961
|
"style",
|
|
2963
2962
|
/*computedStyle*/
|
|
2964
2963
|
e[5]
|
|
2965
|
-
),
|
|
2964
|
+
), d(
|
|
2966
2965
|
i,
|
|
2967
2966
|
"x",
|
|
2968
2967
|
/*x*/
|
|
2969
2968
|
e[4]
|
|
2970
|
-
),
|
|
2969
|
+
), d(
|
|
2971
2970
|
i,
|
|
2972
2971
|
"y",
|
|
2973
2972
|
/*y*/
|
|
2974
2973
|
e[3]
|
|
2975
|
-
),
|
|
2974
|
+
), d(
|
|
2976
2975
|
i,
|
|
2977
2976
|
"width",
|
|
2978
2977
|
/*w*/
|
|
2979
2978
|
e[2]
|
|
2980
|
-
),
|
|
2979
|
+
), d(
|
|
2981
2980
|
i,
|
|
2982
2981
|
"height",
|
|
2983
2982
|
/*h*/
|
|
2984
2983
|
e[1]
|
|
2985
|
-
),
|
|
2984
|
+
), d(t, "class", "a9s-annotation"), d(t, "data-id", s = /*annotation*/
|
|
2986
2985
|
e[0].id);
|
|
2987
2986
|
},
|
|
2988
2987
|
m(r, l) {
|
|
@@ -2991,80 +2990,80 @@ function gi(e) {
|
|
|
2991
2990
|
p(r, [l]) {
|
|
2992
2991
|
l & /*computedStyle*/
|
|
2993
2992
|
32 && o !== (o = /*computedStyle*/
|
|
2994
|
-
r[5] ? "display:none;" : void 0) &&
|
|
2995
|
-
16 &&
|
|
2993
|
+
r[5] ? "display:none;" : void 0) && d(n, "style", o), l & /*x*/
|
|
2994
|
+
16 && d(
|
|
2996
2995
|
n,
|
|
2997
2996
|
"x",
|
|
2998
2997
|
/*x*/
|
|
2999
2998
|
r[4]
|
|
3000
2999
|
), l & /*y*/
|
|
3001
|
-
8 &&
|
|
3000
|
+
8 && d(
|
|
3002
3001
|
n,
|
|
3003
3002
|
"y",
|
|
3004
3003
|
/*y*/
|
|
3005
3004
|
r[3]
|
|
3006
3005
|
), l & /*w*/
|
|
3007
|
-
4 &&
|
|
3006
|
+
4 && d(
|
|
3008
3007
|
n,
|
|
3009
3008
|
"width",
|
|
3010
3009
|
/*w*/
|
|
3011
3010
|
r[2]
|
|
3012
3011
|
), l & /*h*/
|
|
3013
|
-
2 &&
|
|
3012
|
+
2 && d(
|
|
3014
3013
|
n,
|
|
3015
3014
|
"height",
|
|
3016
3015
|
/*h*/
|
|
3017
3016
|
r[1]
|
|
3018
3017
|
), l & /*computedStyle*/
|
|
3019
|
-
32 &&
|
|
3018
|
+
32 && d(
|
|
3020
3019
|
i,
|
|
3021
3020
|
"style",
|
|
3022
3021
|
/*computedStyle*/
|
|
3023
3022
|
r[5]
|
|
3024
3023
|
), l & /*x*/
|
|
3025
|
-
16 &&
|
|
3024
|
+
16 && d(
|
|
3026
3025
|
i,
|
|
3027
3026
|
"x",
|
|
3028
3027
|
/*x*/
|
|
3029
3028
|
r[4]
|
|
3030
3029
|
), l & /*y*/
|
|
3031
|
-
8 &&
|
|
3030
|
+
8 && d(
|
|
3032
3031
|
i,
|
|
3033
3032
|
"y",
|
|
3034
3033
|
/*y*/
|
|
3035
3034
|
r[3]
|
|
3036
3035
|
), l & /*w*/
|
|
3037
|
-
4 &&
|
|
3036
|
+
4 && d(
|
|
3038
3037
|
i,
|
|
3039
3038
|
"width",
|
|
3040
3039
|
/*w*/
|
|
3041
3040
|
r[2]
|
|
3042
3041
|
), l & /*h*/
|
|
3043
|
-
2 &&
|
|
3042
|
+
2 && d(
|
|
3044
3043
|
i,
|
|
3045
3044
|
"height",
|
|
3046
3045
|
/*h*/
|
|
3047
3046
|
r[1]
|
|
3048
3047
|
), l & /*annotation*/
|
|
3049
3048
|
1 && s !== (s = /*annotation*/
|
|
3050
|
-
r[0].id) &&
|
|
3049
|
+
r[0].id) && d(t, "data-id", s);
|
|
3051
3050
|
},
|
|
3052
|
-
i:
|
|
3053
|
-
o:
|
|
3051
|
+
i: H,
|
|
3052
|
+
o: H,
|
|
3054
3053
|
d(r) {
|
|
3055
|
-
r &&
|
|
3054
|
+
r && k(t);
|
|
3056
3055
|
}
|
|
3057
3056
|
};
|
|
3058
3057
|
}
|
|
3059
3058
|
function mi(e, t, n) {
|
|
3060
|
-
let o, i, s, r, l, { annotation: a } = t, { geom: c } = t, { style:
|
|
3061
|
-
return e.$$set = (
|
|
3062
|
-
"annotation" in
|
|
3059
|
+
let o, i, s, r, l, { annotation: a } = t, { geom: c } = t, { style: u } = t;
|
|
3060
|
+
return e.$$set = (f) => {
|
|
3061
|
+
"annotation" in f && n(0, a = f.annotation), "geom" in f && n(6, c = f.geom), "style" in f && n(7, u = f.style);
|
|
3063
3062
|
}, e.$$.update = () => {
|
|
3064
3063
|
e.$$.dirty & /*annotation, style*/
|
|
3065
|
-
129 && n(5, o =
|
|
3064
|
+
129 && n(5, o = xe(a, u)), e.$$.dirty & /*geom*/
|
|
3066
3065
|
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)));
|
|
3067
|
-
}, [a, l, r, s, i, o, c,
|
|
3066
|
+
}, [a, l, r, s, i, o, c, u];
|
|
3068
3067
|
}
|
|
3069
3068
|
class pi extends oe {
|
|
3070
3069
|
constructor(t) {
|
|
@@ -3081,46 +3080,46 @@ const Hi = {
|
|
|
3081
3080
|
return [s, r];
|
|
3082
3081
|
}
|
|
3083
3082
|
}), _i = 250, wi = (e, t) => {
|
|
3084
|
-
const n =
|
|
3083
|
+
const n = Me();
|
|
3085
3084
|
let o;
|
|
3086
3085
|
return { onPointerDown: () => o = performance.now(), onPointerUp: (r) => {
|
|
3087
3086
|
if (performance.now() - o < _i) {
|
|
3088
|
-
const { x: a, y: c } =
|
|
3089
|
-
|
|
3087
|
+
const { x: a, y: c } = un(r, e), u = t.getAt(a, c);
|
|
3088
|
+
u ? n("click", { originalEvent: r, annotation: u }) : n("click", { originalEvent: r });
|
|
3090
3089
|
}
|
|
3091
3090
|
} };
|
|
3092
|
-
},
|
|
3091
|
+
}, un = (e, t) => {
|
|
3093
3092
|
const n = t.createSVGPoint(), o = t.getBoundingClientRect(), i = e.clientX - o.x, s = e.clientY - o.y, { left: r, top: l } = t.getBoundingClientRect();
|
|
3094
3093
|
return n.x = i + r, n.y = s + l, n.matrixTransform(t.getScreenCTM().inverse());
|
|
3095
|
-
}
|
|
3096
|
-
function
|
|
3094
|
+
};
|
|
3095
|
+
function Rt(e, t, n) {
|
|
3097
3096
|
const o = e.slice();
|
|
3098
|
-
o[
|
|
3097
|
+
o[35] = t[n];
|
|
3099
3098
|
const i = (
|
|
3100
3099
|
/*getEditor*/
|
|
3101
3100
|
o[23](
|
|
3102
3101
|
/*editable*/
|
|
3103
|
-
o[
|
|
3102
|
+
o[35].target.selector
|
|
3104
3103
|
)
|
|
3105
3104
|
);
|
|
3106
|
-
return o[
|
|
3105
|
+
return o[36] = i, o;
|
|
3107
3106
|
}
|
|
3108
|
-
function
|
|
3107
|
+
function Ct(e, t, n) {
|
|
3109
3108
|
const o = e.slice();
|
|
3110
|
-
return o[
|
|
3109
|
+
return o[39] = t[n], o;
|
|
3111
3110
|
}
|
|
3112
|
-
function
|
|
3111
|
+
function at(e) {
|
|
3113
3112
|
const t = e.slice(), n = (
|
|
3114
3113
|
/*annotation*/
|
|
3115
|
-
t[
|
|
3114
|
+
t[39].target.selector
|
|
3116
3115
|
);
|
|
3117
|
-
return t[
|
|
3116
|
+
return t[42] = n, t;
|
|
3118
3117
|
}
|
|
3119
|
-
function
|
|
3118
|
+
function Nt(e) {
|
|
3120
3119
|
let t = (
|
|
3121
3120
|
/*annotation*/
|
|
3122
|
-
e[
|
|
3123
|
-
), n, o, i =
|
|
3121
|
+
e[39].id
|
|
3122
|
+
), n, o, i = Ut(e);
|
|
3124
3123
|
return {
|
|
3125
3124
|
c() {
|
|
3126
3125
|
i.c(), n = le();
|
|
@@ -3131,16 +3130,16 @@ function Rt(e) {
|
|
|
3131
3130
|
p(s, r) {
|
|
3132
3131
|
r[0] & /*$store*/
|
|
3133
3132
|
32768 && Z(t, t = /*annotation*/
|
|
3134
|
-
s[
|
|
3133
|
+
s[39].id) ? (se(), R(i, 1, 1, H), re(), i = Ut(s), i.c(), B(i, 1), i.m(n.parentNode, n)) : i.p(s, r);
|
|
3135
3134
|
},
|
|
3136
3135
|
i(s) {
|
|
3137
|
-
o || (
|
|
3136
|
+
o || (B(i), o = !0);
|
|
3138
3137
|
},
|
|
3139
3138
|
o(s) {
|
|
3140
3139
|
R(i), o = !1;
|
|
3141
3140
|
},
|
|
3142
3141
|
d(s) {
|
|
3143
|
-
s &&
|
|
3142
|
+
s && k(n), i.d(s);
|
|
3144
3143
|
}
|
|
3145
3144
|
};
|
|
3146
3145
|
}
|
|
@@ -3150,11 +3149,11 @@ function bi(e) {
|
|
|
3150
3149
|
props: {
|
|
3151
3150
|
annotation: (
|
|
3152
3151
|
/*annotation*/
|
|
3153
|
-
e[
|
|
3152
|
+
e[39]
|
|
3154
3153
|
),
|
|
3155
3154
|
geom: (
|
|
3156
3155
|
/*selector*/
|
|
3157
|
-
e[
|
|
3156
|
+
e[42].geometry
|
|
3158
3157
|
),
|
|
3159
3158
|
style: (
|
|
3160
3159
|
/*style*/
|
|
@@ -3166,26 +3165,26 @@ function bi(e) {
|
|
|
3166
3165
|
te(t.$$.fragment);
|
|
3167
3166
|
},
|
|
3168
3167
|
m(o, i) {
|
|
3169
|
-
|
|
3168
|
+
x(t, o, i), n = !0;
|
|
3170
3169
|
},
|
|
3171
3170
|
p(o, i) {
|
|
3172
3171
|
const s = {};
|
|
3173
3172
|
i[0] & /*$store*/
|
|
3174
3173
|
32768 && (s.annotation = /*annotation*/
|
|
3175
|
-
o[
|
|
3174
|
+
o[39]), i[0] & /*$store*/
|
|
3176
3175
|
32768 && (s.geom = /*selector*/
|
|
3177
|
-
o[
|
|
3176
|
+
o[42].geometry), i[0] & /*style*/
|
|
3178
3177
|
2 && (s.style = /*style*/
|
|
3179
3178
|
o[1]), t.$set(s);
|
|
3180
3179
|
},
|
|
3181
3180
|
i(o) {
|
|
3182
|
-
n || (
|
|
3181
|
+
n || (B(t.$$.fragment, o), n = !0);
|
|
3183
3182
|
},
|
|
3184
3183
|
o(o) {
|
|
3185
3184
|
R(t.$$.fragment, o), n = !1;
|
|
3186
3185
|
},
|
|
3187
3186
|
d(o) {
|
|
3188
|
-
|
|
3187
|
+
$(t, o);
|
|
3189
3188
|
}
|
|
3190
3189
|
};
|
|
3191
3190
|
}
|
|
@@ -3195,11 +3194,11 @@ function Ei(e) {
|
|
|
3195
3194
|
props: {
|
|
3196
3195
|
annotation: (
|
|
3197
3196
|
/*annotation*/
|
|
3198
|
-
e[
|
|
3197
|
+
e[39]
|
|
3199
3198
|
),
|
|
3200
3199
|
geom: (
|
|
3201
3200
|
/*selector*/
|
|
3202
|
-
e[
|
|
3201
|
+
e[42].geometry
|
|
3203
3202
|
),
|
|
3204
3203
|
style: (
|
|
3205
3204
|
/*style*/
|
|
@@ -3211,26 +3210,26 @@ function Ei(e) {
|
|
|
3211
3210
|
te(t.$$.fragment);
|
|
3212
3211
|
},
|
|
3213
3212
|
m(o, i) {
|
|
3214
|
-
|
|
3213
|
+
x(t, o, i), n = !0;
|
|
3215
3214
|
},
|
|
3216
3215
|
p(o, i) {
|
|
3217
3216
|
const s = {};
|
|
3218
3217
|
i[0] & /*$store*/
|
|
3219
3218
|
32768 && (s.annotation = /*annotation*/
|
|
3220
|
-
o[
|
|
3219
|
+
o[39]), i[0] & /*$store*/
|
|
3221
3220
|
32768 && (s.geom = /*selector*/
|
|
3222
|
-
o[
|
|
3221
|
+
o[42].geometry), i[0] & /*style*/
|
|
3223
3222
|
2 && (s.style = /*style*/
|
|
3224
3223
|
o[1]), t.$set(s);
|
|
3225
3224
|
},
|
|
3226
3225
|
i(o) {
|
|
3227
|
-
n || (
|
|
3226
|
+
n || (B(t.$$.fragment, o), n = !0);
|
|
3228
3227
|
},
|
|
3229
3228
|
o(o) {
|
|
3230
3229
|
R(t.$$.fragment, o), n = !1;
|
|
3231
3230
|
},
|
|
3232
3231
|
d(o) {
|
|
3233
|
-
|
|
3232
|
+
$(t, o);
|
|
3234
3233
|
}
|
|
3235
3234
|
};
|
|
3236
3235
|
}
|
|
@@ -3241,11 +3240,11 @@ function Ai(e) {
|
|
|
3241
3240
|
props: {
|
|
3242
3241
|
annotation: (
|
|
3243
3242
|
/*annotation*/
|
|
3244
|
-
e[
|
|
3243
|
+
e[39]
|
|
3245
3244
|
),
|
|
3246
3245
|
geom: (
|
|
3247
3246
|
/*selector*/
|
|
3248
|
-
(o = e[
|
|
3247
|
+
(o = e[42]) == null ? void 0 : o.geometry
|
|
3249
3248
|
),
|
|
3250
3249
|
style: (
|
|
3251
3250
|
/*style*/
|
|
@@ -3257,42 +3256,42 @@ function Ai(e) {
|
|
|
3257
3256
|
te(t.$$.fragment);
|
|
3258
3257
|
},
|
|
3259
3258
|
m(i, s) {
|
|
3260
|
-
|
|
3259
|
+
x(t, i, s), n = !0;
|
|
3261
3260
|
},
|
|
3262
3261
|
p(i, s) {
|
|
3263
3262
|
var l;
|
|
3264
3263
|
const r = {};
|
|
3265
3264
|
s[0] & /*$store*/
|
|
3266
3265
|
32768 && (r.annotation = /*annotation*/
|
|
3267
|
-
i[
|
|
3266
|
+
i[39]), s[0] & /*$store*/
|
|
3268
3267
|
32768 && (r.geom = /*selector*/
|
|
3269
|
-
(l = i[
|
|
3268
|
+
(l = i[42]) == null ? void 0 : l.geometry), s[0] & /*style*/
|
|
3270
3269
|
2 && (r.style = /*style*/
|
|
3271
3270
|
i[1]), t.$set(r);
|
|
3272
3271
|
},
|
|
3273
3272
|
i(i) {
|
|
3274
|
-
n || (
|
|
3273
|
+
n || (B(t.$$.fragment, i), n = !0);
|
|
3275
3274
|
},
|
|
3276
3275
|
o(i) {
|
|
3277
3276
|
R(t.$$.fragment, i), n = !1;
|
|
3278
3277
|
},
|
|
3279
3278
|
d(i) {
|
|
3280
|
-
|
|
3279
|
+
$(t, i);
|
|
3281
3280
|
}
|
|
3282
3281
|
};
|
|
3283
3282
|
}
|
|
3284
|
-
function
|
|
3283
|
+
function Ut(e) {
|
|
3285
3284
|
let t, n, o, i;
|
|
3286
3285
|
const s = [Ai, Ei, bi], r = [];
|
|
3287
3286
|
function l(a, c) {
|
|
3288
|
-
var
|
|
3287
|
+
var u, f, g;
|
|
3289
3288
|
return (
|
|
3290
3289
|
/*selector*/
|
|
3291
|
-
((
|
|
3290
|
+
((u = a[42]) == null ? void 0 : u.type) === W.ELLIPSE ? 0 : (
|
|
3292
3291
|
/*selector*/
|
|
3293
|
-
((
|
|
3292
|
+
((f = a[42]) == null ? void 0 : f.type) === W.RECTANGLE ? 1 : (
|
|
3294
3293
|
/*selector*/
|
|
3295
|
-
((
|
|
3294
|
+
((g = a[42]) == null ? void 0 : g.type) === W.POLYGON ? 2 : -1
|
|
3296
3295
|
)
|
|
3297
3296
|
)
|
|
3298
3297
|
);
|
|
@@ -3305,28 +3304,31 @@ function Ct(e) {
|
|
|
3305
3304
|
~t && r[t].m(a, c), I(a, o, c), i = !0;
|
|
3306
3305
|
},
|
|
3307
3306
|
p(a, c) {
|
|
3308
|
-
let
|
|
3309
|
-
t = l(a), t ===
|
|
3310
|
-
r[
|
|
3311
|
-
}), re()), ~t ? (n = r[t], n ? n.p(a, c) : (n = r[t] = s[t](a), n.c()),
|
|
3307
|
+
let u = t;
|
|
3308
|
+
t = l(a), t === u ? ~t && r[t].p(a, c) : (n && (se(), R(r[u], 1, 1, () => {
|
|
3309
|
+
r[u] = null;
|
|
3310
|
+
}), re()), ~t ? (n = r[t], n ? n.p(a, c) : (n = r[t] = s[t](a), n.c()), B(n, 1), n.m(o.parentNode, o)) : n = null);
|
|
3312
3311
|
},
|
|
3313
3312
|
i(a) {
|
|
3314
|
-
i || (
|
|
3313
|
+
i || (B(n), i = !0);
|
|
3315
3314
|
},
|
|
3316
3315
|
o(a) {
|
|
3317
3316
|
R(n), i = !1;
|
|
3318
3317
|
},
|
|
3319
3318
|
d(a) {
|
|
3320
|
-
a &&
|
|
3319
|
+
a && k(o), ~t && r[t].d(a);
|
|
3321
3320
|
}
|
|
3322
3321
|
};
|
|
3323
3322
|
}
|
|
3324
|
-
function
|
|
3325
|
-
let t =
|
|
3323
|
+
function Vt(e) {
|
|
3324
|
+
let t = Ze(
|
|
3325
|
+
/*annotation*/
|
|
3326
|
+
e[39]
|
|
3327
|
+
) && !/*isEditable*/
|
|
3326
3328
|
e[8](
|
|
3327
3329
|
/*annotation*/
|
|
3328
|
-
e[
|
|
3329
|
-
), n, o, i = t &&
|
|
3330
|
+
e[39]
|
|
3331
|
+
), n, o, i = t && Nt(at(e));
|
|
3330
3332
|
return {
|
|
3331
3333
|
c() {
|
|
3332
3334
|
i && i.c(), n = le();
|
|
@@ -3335,28 +3337,31 @@ function Nt(e) {
|
|
|
3335
3337
|
i && i.m(s, r), I(s, n, r), o = !0;
|
|
3336
3338
|
},
|
|
3337
3339
|
p(s, r) {
|
|
3338
|
-
r[0] &
|
|
3339
|
-
33024 && (t =
|
|
3340
|
+
r[0] & /*$store, isEditable*/
|
|
3341
|
+
33024 && (t = Ze(
|
|
3342
|
+
/*annotation*/
|
|
3343
|
+
s[39]
|
|
3344
|
+
) && !/*isEditable*/
|
|
3340
3345
|
s[8](
|
|
3341
3346
|
/*annotation*/
|
|
3342
|
-
s[
|
|
3343
|
-
)), t ? i ? (i.p(
|
|
3344
|
-
33024 &&
|
|
3347
|
+
s[39]
|
|
3348
|
+
)), t ? i ? (i.p(at(s), r), r[0] & /*$store, isEditable*/
|
|
3349
|
+
33024 && B(i, 1)) : (i = Nt(at(s)), i.c(), B(i, 1), i.m(n.parentNode, n)) : i && (se(), R(i, 1, 1, () => {
|
|
3345
3350
|
i = null;
|
|
3346
3351
|
}), re());
|
|
3347
3352
|
},
|
|
3348
3353
|
i(s) {
|
|
3349
|
-
o || (
|
|
3354
|
+
o || (B(i), o = !0);
|
|
3350
3355
|
},
|
|
3351
3356
|
o(s) {
|
|
3352
3357
|
R(i), o = !1;
|
|
3353
3358
|
},
|
|
3354
3359
|
d(s) {
|
|
3355
|
-
s &&
|
|
3360
|
+
s && k(n), i && i.d(s);
|
|
3356
3361
|
}
|
|
3357
3362
|
};
|
|
3358
3363
|
}
|
|
3359
|
-
function
|
|
3364
|
+
function Gt(e) {
|
|
3360
3365
|
let t, n, o, i;
|
|
3361
3366
|
const s = [vi, Si], r = [];
|
|
3362
3367
|
function l(a, c) {
|
|
@@ -3377,19 +3382,19 @@ function Ut(e) {
|
|
|
3377
3382
|
~t && r[t].m(a, c), I(a, o, c), i = !0;
|
|
3378
3383
|
},
|
|
3379
3384
|
p(a, c) {
|
|
3380
|
-
let
|
|
3381
|
-
t = l(a), t ===
|
|
3382
|
-
r[
|
|
3383
|
-
}), re()), ~t ? (n = r[t], n ? n.p(a, c) : (n = r[t] = s[t](a), n.c()),
|
|
3385
|
+
let u = t;
|
|
3386
|
+
t = l(a), t === u ? ~t && r[t].p(a, c) : (n && (se(), R(r[u], 1, 1, () => {
|
|
3387
|
+
r[u] = null;
|
|
3388
|
+
}), re()), ~t ? (n = r[t], n ? n.p(a, c) : (n = r[t] = s[t](a), n.c()), B(n, 1), n.m(o.parentNode, o)) : n = null);
|
|
3384
3389
|
},
|
|
3385
3390
|
i(a) {
|
|
3386
|
-
i || (
|
|
3391
|
+
i || (B(n), i = !0);
|
|
3387
3392
|
},
|
|
3388
3393
|
o(a) {
|
|
3389
3394
|
R(n), i = !1;
|
|
3390
3395
|
},
|
|
3391
3396
|
d(a) {
|
|
3392
|
-
a &&
|
|
3397
|
+
a && k(o), ~t && r[t].d(a);
|
|
3393
3398
|
}
|
|
3394
3399
|
};
|
|
3395
3400
|
}
|
|
@@ -3397,7 +3402,7 @@ function Si(e) {
|
|
|
3397
3402
|
let t = (
|
|
3398
3403
|
/*toolName*/
|
|
3399
3404
|
e[2]
|
|
3400
|
-
), n, o, i =
|
|
3405
|
+
), n, o, i = jt(e);
|
|
3401
3406
|
return {
|
|
3402
3407
|
c() {
|
|
3403
3408
|
i.c(), n = le();
|
|
@@ -3408,26 +3413,26 @@ function Si(e) {
|
|
|
3408
3413
|
p(s, r) {
|
|
3409
3414
|
r[0] & /*toolName*/
|
|
3410
3415
|
4 && Z(t, t = /*toolName*/
|
|
3411
|
-
s[2]) ? (se(), R(i, 1, 1,
|
|
3416
|
+
s[2]) ? (se(), R(i, 1, 1, H), re(), i = jt(s), i.c(), B(i, 1), i.m(n.parentNode, n)) : i.p(s, r);
|
|
3412
3417
|
},
|
|
3413
3418
|
i(s) {
|
|
3414
|
-
o || (
|
|
3419
|
+
o || (B(i), o = !0);
|
|
3415
3420
|
},
|
|
3416
3421
|
o(s) {
|
|
3417
3422
|
R(i), o = !1;
|
|
3418
3423
|
},
|
|
3419
3424
|
d(s) {
|
|
3420
|
-
s &&
|
|
3425
|
+
s && k(n), i.d(s);
|
|
3421
3426
|
}
|
|
3422
3427
|
};
|
|
3423
3428
|
}
|
|
3424
3429
|
function vi(e) {
|
|
3425
|
-
let t, n, o =
|
|
3430
|
+
let t, n, o = Te(
|
|
3426
3431
|
/*editableAnnotations*/
|
|
3427
3432
|
e[7]
|
|
3428
3433
|
), i = [];
|
|
3429
3434
|
for (let r = 0; r < o.length; r += 1)
|
|
3430
|
-
i[r] =
|
|
3435
|
+
i[r] = Ft(Rt(e, o, r));
|
|
3431
3436
|
const s = (r) => R(i[r], 1, 1, () => {
|
|
3432
3437
|
i[r] = null;
|
|
3433
3438
|
});
|
|
@@ -3445,14 +3450,14 @@ function vi(e) {
|
|
|
3445
3450
|
p(r, l) {
|
|
3446
3451
|
if (l[0] & /*editableAnnotations, drawingEl, getEditor, style, transform, $scale, onChangeSelected*/
|
|
3447
3452
|
10553506) {
|
|
3448
|
-
o =
|
|
3453
|
+
o = Te(
|
|
3449
3454
|
/*editableAnnotations*/
|
|
3450
3455
|
r[7]
|
|
3451
3456
|
);
|
|
3452
3457
|
let a;
|
|
3453
3458
|
for (a = 0; a < o.length; a += 1) {
|
|
3454
|
-
const c =
|
|
3455
|
-
i[a] ? (i[a].p(c, l),
|
|
3459
|
+
const c = Rt(r, o, a);
|
|
3460
|
+
i[a] ? (i[a].p(c, l), B(i[a], 1)) : (i[a] = Ft(c), i[a].c(), B(i[a], 1), i[a].m(t.parentNode, t));
|
|
3456
3461
|
}
|
|
3457
3462
|
for (se(), a = o.length; a < i.length; a += 1)
|
|
3458
3463
|
s(a);
|
|
@@ -3462,22 +3467,22 @@ function vi(e) {
|
|
|
3462
3467
|
i(r) {
|
|
3463
3468
|
if (!n) {
|
|
3464
3469
|
for (let l = 0; l < o.length; l += 1)
|
|
3465
|
-
|
|
3470
|
+
B(i[l]);
|
|
3466
3471
|
n = !0;
|
|
3467
3472
|
}
|
|
3468
3473
|
},
|
|
3469
3474
|
o(r) {
|
|
3470
|
-
i = i.filter(
|
|
3475
|
+
i = i.filter(Boolean);
|
|
3471
3476
|
for (let l = 0; l < i.length; l += 1)
|
|
3472
3477
|
R(i[l]);
|
|
3473
3478
|
n = !1;
|
|
3474
3479
|
},
|
|
3475
3480
|
d(r) {
|
|
3476
|
-
r &&
|
|
3481
|
+
r && k(t), mt(i, r);
|
|
3477
3482
|
}
|
|
3478
3483
|
};
|
|
3479
3484
|
}
|
|
3480
|
-
function
|
|
3485
|
+
function jt(e) {
|
|
3481
3486
|
let t, n;
|
|
3482
3487
|
return t = new Qo({
|
|
3483
3488
|
props: {
|
|
@@ -3511,7 +3516,7 @@ function Vt(e) {
|
|
|
3511
3516
|
te(t.$$.fragment);
|
|
3512
3517
|
},
|
|
3513
3518
|
m(o, i) {
|
|
3514
|
-
|
|
3519
|
+
x(t, o, i), n = !0;
|
|
3515
3520
|
},
|
|
3516
3521
|
p(o, i) {
|
|
3517
3522
|
const s = {};
|
|
@@ -3528,21 +3533,21 @@ function Vt(e) {
|
|
|
3528
3533
|
o[16]), t.$set(s);
|
|
3529
3534
|
},
|
|
3530
3535
|
i(o) {
|
|
3531
|
-
n || (
|
|
3536
|
+
n || (B(t.$$.fragment, o), n = !0);
|
|
3532
3537
|
},
|
|
3533
3538
|
o(o) {
|
|
3534
3539
|
R(t.$$.fragment, o), n = !1;
|
|
3535
3540
|
},
|
|
3536
3541
|
d(o) {
|
|
3537
|
-
|
|
3542
|
+
$(t, o);
|
|
3538
3543
|
}
|
|
3539
3544
|
};
|
|
3540
3545
|
}
|
|
3541
|
-
function
|
|
3546
|
+
function zt(e) {
|
|
3542
3547
|
let t = (
|
|
3543
3548
|
/*editable*/
|
|
3544
|
-
e[
|
|
3545
|
-
), n, o, i =
|
|
3549
|
+
e[35].id
|
|
3550
|
+
), n, o, i = Ht(e);
|
|
3546
3551
|
return {
|
|
3547
3552
|
c() {
|
|
3548
3553
|
i.c(), n = le();
|
|
@@ -3553,20 +3558,20 @@ function Gt(e) {
|
|
|
3553
3558
|
p(s, r) {
|
|
3554
3559
|
r[0] & /*editableAnnotations*/
|
|
3555
3560
|
128 && Z(t, t = /*editable*/
|
|
3556
|
-
s[
|
|
3561
|
+
s[35].id) ? (se(), R(i, 1, 1, H), re(), i = Ht(s), i.c(), B(i, 1), i.m(n.parentNode, n)) : i.p(s, r);
|
|
3557
3562
|
},
|
|
3558
3563
|
i(s) {
|
|
3559
|
-
o || (
|
|
3564
|
+
o || (B(i), o = !0);
|
|
3560
3565
|
},
|
|
3561
3566
|
o(s) {
|
|
3562
3567
|
R(i), o = !1;
|
|
3563
3568
|
},
|
|
3564
3569
|
d(s) {
|
|
3565
|
-
s &&
|
|
3570
|
+
s && k(n), i.d(s);
|
|
3566
3571
|
}
|
|
3567
3572
|
};
|
|
3568
3573
|
}
|
|
3569
|
-
function
|
|
3574
|
+
function Ht(e) {
|
|
3570
3575
|
let t, n;
|
|
3571
3576
|
return t = new Ko({
|
|
3572
3577
|
props: {
|
|
@@ -3578,12 +3583,12 @@ function jt(e) {
|
|
|
3578
3583
|
/*getEditor*/
|
|
3579
3584
|
e[23](
|
|
3580
3585
|
/*editable*/
|
|
3581
|
-
e[
|
|
3586
|
+
e[35].target.selector
|
|
3582
3587
|
)
|
|
3583
3588
|
),
|
|
3584
3589
|
annotation: (
|
|
3585
3590
|
/*editable*/
|
|
3586
|
-
e[
|
|
3591
|
+
e[35]
|
|
3587
3592
|
),
|
|
3588
3593
|
style: (
|
|
3589
3594
|
/*style*/
|
|
@@ -3603,18 +3608,18 @@ function jt(e) {
|
|
|
3603
3608
|
/*onChangeSelected*/
|
|
3604
3609
|
e[21](
|
|
3605
3610
|
/*editable*/
|
|
3606
|
-
e[
|
|
3611
|
+
e[35]
|
|
3607
3612
|
)
|
|
3608
3613
|
) && e[21](
|
|
3609
3614
|
/*editable*/
|
|
3610
|
-
e[
|
|
3615
|
+
e[35]
|
|
3611
3616
|
).apply(this, arguments);
|
|
3612
3617
|
}), {
|
|
3613
3618
|
c() {
|
|
3614
3619
|
te(t.$$.fragment);
|
|
3615
3620
|
},
|
|
3616
3621
|
m(o, i) {
|
|
3617
|
-
|
|
3622
|
+
x(t, o, i), n = !0;
|
|
3618
3623
|
},
|
|
3619
3624
|
p(o, i) {
|
|
3620
3625
|
e = o;
|
|
@@ -3625,10 +3630,10 @@ function jt(e) {
|
|
|
3625
3630
|
128 && (s.editor = /*getEditor*/
|
|
3626
3631
|
e[23](
|
|
3627
3632
|
/*editable*/
|
|
3628
|
-
e[
|
|
3633
|
+
e[35].target.selector
|
|
3629
3634
|
)), i[0] & /*editableAnnotations*/
|
|
3630
3635
|
128 && (s.annotation = /*editable*/
|
|
3631
|
-
e[
|
|
3636
|
+
e[35]), i[0] & /*style*/
|
|
3632
3637
|
2 && (s.style = /*style*/
|
|
3633
3638
|
e[1]), i[0] & /*transform*/
|
|
3634
3639
|
2048 && (s.transform = /*transform*/
|
|
@@ -3637,20 +3642,20 @@ function jt(e) {
|
|
|
3637
3642
|
e[16]), t.$set(s);
|
|
3638
3643
|
},
|
|
3639
3644
|
i(o) {
|
|
3640
|
-
n || (
|
|
3645
|
+
n || (B(t.$$.fragment, o), n = !0);
|
|
3641
3646
|
},
|
|
3642
3647
|
o(o) {
|
|
3643
3648
|
R(t.$$.fragment, o), n = !1;
|
|
3644
3649
|
},
|
|
3645
3650
|
d(o) {
|
|
3646
|
-
|
|
3651
|
+
$(t, o);
|
|
3647
3652
|
}
|
|
3648
3653
|
};
|
|
3649
3654
|
}
|
|
3650
|
-
function
|
|
3655
|
+
function Ft(e) {
|
|
3651
3656
|
let t, n, o = (
|
|
3652
3657
|
/*editor*/
|
|
3653
|
-
e[
|
|
3658
|
+
e[36] && zt(e)
|
|
3654
3659
|
);
|
|
3655
3660
|
return {
|
|
3656
3661
|
c() {
|
|
@@ -3661,59 +3666,62 @@ function zt(e) {
|
|
|
3661
3666
|
},
|
|
3662
3667
|
p(i, s) {
|
|
3663
3668
|
/*editor*/
|
|
3664
|
-
i[
|
|
3665
|
-
128 &&
|
|
3669
|
+
i[36] ? o ? (o.p(i, s), s[0] & /*editableAnnotations*/
|
|
3670
|
+
128 && B(o, 1)) : (o = zt(i), o.c(), B(o, 1), o.m(t.parentNode, t)) : o && (se(), R(o, 1, 1, () => {
|
|
3666
3671
|
o = null;
|
|
3667
3672
|
}), re());
|
|
3668
3673
|
},
|
|
3669
3674
|
i(i) {
|
|
3670
|
-
n || (
|
|
3675
|
+
n || (B(o), n = !0);
|
|
3671
3676
|
},
|
|
3672
3677
|
o(i) {
|
|
3673
3678
|
R(o), n = !1;
|
|
3674
3679
|
},
|
|
3675
3680
|
d(i) {
|
|
3676
|
-
i &&
|
|
3681
|
+
i && k(t), o && o.d(i);
|
|
3677
3682
|
}
|
|
3678
3683
|
};
|
|
3679
3684
|
}
|
|
3680
3685
|
function Ti(e) {
|
|
3681
|
-
let t, n, o, i, s, r, l =
|
|
3686
|
+
let t, n, o, i, s, r, l = Te(
|
|
3682
3687
|
/*$store*/
|
|
3683
|
-
e[15]
|
|
3688
|
+
e[15].filter(
|
|
3689
|
+
/*func*/
|
|
3690
|
+
e[30]
|
|
3691
|
+
)
|
|
3684
3692
|
), a = [];
|
|
3685
|
-
for (let
|
|
3686
|
-
a[
|
|
3687
|
-
const c = (
|
|
3688
|
-
a[
|
|
3693
|
+
for (let f = 0; f < l.length; f += 1)
|
|
3694
|
+
a[f] = Vt(Ct(e, l, f));
|
|
3695
|
+
const c = (f) => R(a[f], 1, 1, () => {
|
|
3696
|
+
a[f] = null;
|
|
3689
3697
|
});
|
|
3690
|
-
let
|
|
3698
|
+
let u = (
|
|
3691
3699
|
/*drawingEl*/
|
|
3692
|
-
e[5] &&
|
|
3700
|
+
e[5] && Gt(e)
|
|
3693
3701
|
);
|
|
3694
3702
|
return {
|
|
3695
3703
|
c() {
|
|
3696
3704
|
t = C("svg"), n = C("g");
|
|
3697
|
-
for (let
|
|
3698
|
-
a[
|
|
3699
|
-
o = C("g"),
|
|
3705
|
+
for (let f = 0; f < a.length; f += 1)
|
|
3706
|
+
a[f].c();
|
|
3707
|
+
o = C("g"), u && u.c(), d(o, "class", "drawing"), d(t, "class", "a9s-annotationlayer"), me(
|
|
3700
3708
|
t,
|
|
3701
3709
|
"drawing",
|
|
3702
3710
|
/*tool*/
|
|
3703
3711
|
e[13]
|
|
3704
|
-
),
|
|
3705
|
-
e[3]),
|
|
3712
|
+
), me(t, "hidden", !/*visible*/
|
|
3713
|
+
e[3]), me(
|
|
3706
3714
|
t,
|
|
3707
3715
|
"hover",
|
|
3708
3716
|
/*$hover*/
|
|
3709
3717
|
e[14]
|
|
3710
3718
|
);
|
|
3711
3719
|
},
|
|
3712
|
-
m(
|
|
3713
|
-
I(
|
|
3714
|
-
for (let
|
|
3715
|
-
a[
|
|
3716
|
-
ue(t, o),
|
|
3720
|
+
m(f, g) {
|
|
3721
|
+
I(f, t, g), ue(t, n);
|
|
3722
|
+
for (let h = 0; h < a.length; h += 1)
|
|
3723
|
+
a[h] && a[h].m(n, null);
|
|
3724
|
+
ue(t, o), u && u.m(o, null), e[31](o), e[32](t), i = !0, s || (r = [
|
|
3717
3725
|
F(t, "pointerup", function() {
|
|
3718
3726
|
q(
|
|
3719
3727
|
/*onPointerUp*/
|
|
@@ -3734,127 +3742,130 @@ function Ti(e) {
|
|
|
3734
3742
|
)
|
|
3735
3743
|
], s = !0);
|
|
3736
3744
|
},
|
|
3737
|
-
p(
|
|
3738
|
-
if (e =
|
|
3745
|
+
p(f, g) {
|
|
3746
|
+
if (e = f, g[0] & /*$store, style, isEditable*/
|
|
3739
3747
|
33026) {
|
|
3740
|
-
l =
|
|
3748
|
+
l = Te(
|
|
3741
3749
|
/*$store*/
|
|
3742
|
-
e[15]
|
|
3750
|
+
e[15].filter(
|
|
3751
|
+
/*func*/
|
|
3752
|
+
e[30]
|
|
3753
|
+
)
|
|
3743
3754
|
);
|
|
3744
|
-
let
|
|
3745
|
-
for (
|
|
3746
|
-
const m =
|
|
3747
|
-
a[
|
|
3755
|
+
let h;
|
|
3756
|
+
for (h = 0; h < l.length; h += 1) {
|
|
3757
|
+
const m = Ct(e, l, h);
|
|
3758
|
+
a[h] ? (a[h].p(m, g), B(a[h], 1)) : (a[h] = Vt(m), a[h].c(), B(a[h], 1), a[h].m(n, null));
|
|
3748
3759
|
}
|
|
3749
|
-
for (se(),
|
|
3750
|
-
c(
|
|
3760
|
+
for (se(), h = l.length; h < a.length; h += 1)
|
|
3761
|
+
c(h);
|
|
3751
3762
|
re();
|
|
3752
3763
|
}
|
|
3753
3764
|
/*drawingEl*/
|
|
3754
|
-
e[5] ?
|
|
3755
|
-
32 &&
|
|
3756
|
-
|
|
3757
|
-
}), re()), (!i ||
|
|
3758
|
-
8192) &&
|
|
3765
|
+
e[5] ? u ? (u.p(e, g), g[0] & /*drawingEl*/
|
|
3766
|
+
32 && B(u, 1)) : (u = Gt(e), u.c(), B(u, 1), u.m(o, null)) : u && (se(), R(u, 1, 1, () => {
|
|
3767
|
+
u = null;
|
|
3768
|
+
}), re()), (!i || g[0] & /*tool*/
|
|
3769
|
+
8192) && me(
|
|
3759
3770
|
t,
|
|
3760
3771
|
"drawing",
|
|
3761
3772
|
/*tool*/
|
|
3762
3773
|
e[13]
|
|
3763
|
-
), (!i ||
|
|
3764
|
-
8) &&
|
|
3765
|
-
e[3]), (!i ||
|
|
3766
|
-
16384) &&
|
|
3774
|
+
), (!i || g[0] & /*visible*/
|
|
3775
|
+
8) && me(t, "hidden", !/*visible*/
|
|
3776
|
+
e[3]), (!i || g[0] & /*$hover*/
|
|
3777
|
+
16384) && me(
|
|
3767
3778
|
t,
|
|
3768
3779
|
"hover",
|
|
3769
3780
|
/*$hover*/
|
|
3770
3781
|
e[14]
|
|
3771
3782
|
);
|
|
3772
3783
|
},
|
|
3773
|
-
i(
|
|
3784
|
+
i(f) {
|
|
3774
3785
|
if (!i) {
|
|
3775
|
-
for (let
|
|
3776
|
-
|
|
3777
|
-
|
|
3786
|
+
for (let g = 0; g < l.length; g += 1)
|
|
3787
|
+
B(a[g]);
|
|
3788
|
+
B(u), i = !0;
|
|
3778
3789
|
}
|
|
3779
3790
|
},
|
|
3780
|
-
o(
|
|
3781
|
-
a = a.filter(
|
|
3782
|
-
for (let
|
|
3783
|
-
R(a[
|
|
3784
|
-
R(
|
|
3791
|
+
o(f) {
|
|
3792
|
+
a = a.filter(Boolean);
|
|
3793
|
+
for (let g = 0; g < a.length; g += 1)
|
|
3794
|
+
R(a[g]);
|
|
3795
|
+
R(u), i = !1;
|
|
3785
3796
|
},
|
|
3786
|
-
d(
|
|
3787
|
-
|
|
3797
|
+
d(f) {
|
|
3798
|
+
f && k(t), mt(a, f), u && u.d(), e[31](null), e[32](null), s = !1, de(r);
|
|
3788
3799
|
}
|
|
3789
3800
|
};
|
|
3790
3801
|
}
|
|
3791
3802
|
function Mi(e, t, n) {
|
|
3792
|
-
let o, i, s, r, l, a, c,
|
|
3803
|
+
let o, i, s, r, l, a, c, u, f, g, h, m = H, y = () => (m(), m = Qt(E, (L) => n(16, h = L)), E);
|
|
3793
3804
|
e.$$.on_destroy.push(() => m());
|
|
3794
|
-
let { drawingEnabled:
|
|
3795
|
-
Re(() =>
|
|
3796
|
-
const { hover: A, selection: S, store:
|
|
3797
|
-
|
|
3805
|
+
let { drawingEnabled: T } = t, { image: p } = t, { preferredDrawingMode: w } = t, { state: _ } = t, { style: b = void 0 } = t, { toolName: Y = cn()[0] } = t, { user: U } = t, { visible: V = !0 } = t, G, P, E;
|
|
3806
|
+
Re(() => y(n(6, E = Po(p, P))));
|
|
3807
|
+
const { hover: A, selection: S, store: v } = _;
|
|
3808
|
+
et(e, A, (L) => n(14, u = L)), et(e, S, (L) => n(29, f = L)), et(e, v, (L) => n(15, g = L));
|
|
3798
3809
|
let N, X;
|
|
3799
3810
|
const K = (L) => {
|
|
3800
|
-
N &&
|
|
3801
|
-
const
|
|
3802
|
-
|
|
3803
|
-
const { updated:
|
|
3804
|
-
n(7, X =
|
|
3805
|
-
},
|
|
3811
|
+
N && v.unobserve(N);
|
|
3812
|
+
const D = L.filter(({ editable: j }) => j).map(({ id: j }) => j);
|
|
3813
|
+
D.length > 0 ? (n(7, X = D.map((j) => v.getAnnotation(j)).filter((j) => j && Ze(j))), N = (j) => {
|
|
3814
|
+
const { updated: ee } = j.changes;
|
|
3815
|
+
n(7, X = ee == null ? void 0 : ee.map((O) => O.newValue));
|
|
3816
|
+
}, v.observe(N, { annotations: D })) : n(7, X = void 0);
|
|
3806
3817
|
}, ge = (L) => {
|
|
3807
|
-
const
|
|
3808
|
-
id:
|
|
3818
|
+
const D = nn(), j = {
|
|
3819
|
+
id: D,
|
|
3809
3820
|
bodies: [],
|
|
3810
3821
|
target: {
|
|
3811
|
-
annotation:
|
|
3822
|
+
annotation: D,
|
|
3812
3823
|
selector: L.detail,
|
|
3813
3824
|
creator: U,
|
|
3814
3825
|
created: /* @__PURE__ */ new Date()
|
|
3815
3826
|
}
|
|
3816
3827
|
};
|
|
3817
|
-
|
|
3818
|
-
}, ae = (L) => (
|
|
3819
|
-
var
|
|
3820
|
-
const { target:
|
|
3821
|
-
|
|
3822
|
-
...
|
|
3823
|
-
selector:
|
|
3824
|
-
created:
|
|
3825
|
-
updated:
|
|
3826
|
-
updatedBy:
|
|
3828
|
+
v.addAnnotation(j), S.setSelected(j.id);
|
|
3829
|
+
}, ae = (L) => (D) => {
|
|
3830
|
+
var M;
|
|
3831
|
+
const { target: j } = L, ee = 10 * 60 * 1e3, O = ((M = j.creator) == null ? void 0 : M.id) !== U.id || !j.created || (/* @__PURE__ */ new Date()).getTime() - j.created.getTime() > ee;
|
|
3832
|
+
v.updateTarget({
|
|
3833
|
+
...j,
|
|
3834
|
+
selector: D.detail,
|
|
3835
|
+
created: O ? j.created : /* @__PURE__ */ new Date(),
|
|
3836
|
+
updated: O ? /* @__PURE__ */ new Date() : void 0,
|
|
3837
|
+
updatedBy: O ? U : void 0
|
|
3827
3838
|
});
|
|
3828
|
-
},
|
|
3829
|
-
const { x:
|
|
3830
|
-
|
|
3831
|
-
}, ce = (L) => jo(L);
|
|
3832
|
-
function
|
|
3833
|
-
|
|
3839
|
+
}, Le = (L) => {
|
|
3840
|
+
const { x: D, y: j } = un(L, P), ee = v.getAt(D, j);
|
|
3841
|
+
ee ? u !== ee.id && A.set(ee.id) : A.set(void 0);
|
|
3842
|
+
}, ce = (L) => jo(L), ke = (L) => Ze(L);
|
|
3843
|
+
function fe(L) {
|
|
3844
|
+
Je[L ? "unshift" : "push"](() => {
|
|
3834
3845
|
G = L, n(5, G);
|
|
3835
3846
|
});
|
|
3836
3847
|
}
|
|
3837
|
-
function
|
|
3838
|
-
|
|
3839
|
-
|
|
3848
|
+
function Ie(L) {
|
|
3849
|
+
Je[L ? "unshift" : "push"](() => {
|
|
3850
|
+
P = L, n(4, P);
|
|
3840
3851
|
});
|
|
3841
3852
|
}
|
|
3842
3853
|
return e.$$set = (L) => {
|
|
3843
|
-
"drawingEnabled" in L && n(0,
|
|
3854
|
+
"drawingEnabled" in L && n(0, T = L.drawingEnabled), "image" in L && n(24, p = L.image), "preferredDrawingMode" in L && n(25, w = L.preferredDrawingMode), "state" in L && n(26, _ = L.state), "style" in L && n(1, b = L.style), "toolName" in L && n(2, Y = L.toolName), "user" in L && n(27, U = L.user), "visible" in L && n(3, V = L.visible);
|
|
3844
3855
|
}, e.$$.update = () => {
|
|
3845
3856
|
e.$$.dirty[0] & /*toolName*/
|
|
3846
|
-
4 && n(13, { tool: o, opts: i } =
|
|
3857
|
+
4 && n(13, { tool: o, opts: i } = fn(Y) || { tool: void 0, opts: void 0 }, o, (n(28, i), n(2, Y))), e.$$.dirty[0] & /*opts, preferredDrawingMode*/
|
|
3847
3858
|
301989888 && n(12, s = (i == null ? void 0 : i.drawingMode) || w), e.$$.dirty[0] & /*svgEl*/
|
|
3848
|
-
16 && n(11, r = yi(
|
|
3849
|
-
16 && n(10, { onPointerDown: l, onPointerUp: a } = wi(
|
|
3850
|
-
536870912 && n(8, c = (L) =>
|
|
3851
|
-
536870912 && K(
|
|
3859
|
+
16 && n(11, r = yi(P)), e.$$.dirty[0] & /*svgEl*/
|
|
3860
|
+
16 && n(10, { onPointerDown: l, onPointerUp: a } = wi(P, v), l, (n(9, a), n(4, P))), e.$$.dirty[0] & /*$selection*/
|
|
3861
|
+
536870912 && n(8, c = (L) => f.selected.find((D) => D.id === L.id && D.editable)), e.$$.dirty[0] & /*$selection*/
|
|
3862
|
+
536870912 && K(f.selected);
|
|
3852
3863
|
}, [
|
|
3853
|
-
|
|
3864
|
+
T,
|
|
3854
3865
|
b,
|
|
3855
|
-
B,
|
|
3856
|
-
V,
|
|
3857
3866
|
Y,
|
|
3867
|
+
V,
|
|
3868
|
+
P,
|
|
3858
3869
|
G,
|
|
3859
3870
|
E,
|
|
3860
3871
|
X,
|
|
@@ -3864,24 +3875,25 @@ function Mi(e, t, n) {
|
|
|
3864
3875
|
r,
|
|
3865
3876
|
s,
|
|
3866
3877
|
o,
|
|
3867
|
-
|
|
3868
|
-
d,
|
|
3878
|
+
u,
|
|
3869
3879
|
g,
|
|
3880
|
+
h,
|
|
3870
3881
|
A,
|
|
3871
3882
|
S,
|
|
3872
|
-
|
|
3883
|
+
v,
|
|
3873
3884
|
ge,
|
|
3874
3885
|
ae,
|
|
3875
|
-
|
|
3886
|
+
Le,
|
|
3876
3887
|
ce,
|
|
3877
3888
|
p,
|
|
3878
3889
|
w,
|
|
3879
|
-
|
|
3890
|
+
_,
|
|
3880
3891
|
U,
|
|
3881
3892
|
i,
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
fe
|
|
3893
|
+
f,
|
|
3894
|
+
ke,
|
|
3895
|
+
fe,
|
|
3896
|
+
Ie
|
|
3885
3897
|
];
|
|
3886
3898
|
}
|
|
3887
3899
|
class Li extends oe {
|
|
@@ -3907,29 +3919,29 @@ class Li extends oe {
|
|
|
3907
3919
|
);
|
|
3908
3920
|
}
|
|
3909
3921
|
}
|
|
3910
|
-
function
|
|
3922
|
+
function dn(e, t, n = 0, o = e.length - 1, i = ki) {
|
|
3911
3923
|
for (; o > n; ) {
|
|
3912
3924
|
if (o - n > 600) {
|
|
3913
|
-
const a = o - n + 1, c = t - n + 1,
|
|
3914
|
-
|
|
3925
|
+
const a = o - n + 1, c = t - n + 1, u = Math.log(a), f = 0.5 * Math.exp(2 * u / 3), g = 0.5 * Math.sqrt(u * f * (a - f) / a) * (c - a / 2 < 0 ? -1 : 1), h = Math.max(n, Math.floor(t - c * f / a + g)), m = Math.min(o, Math.floor(t + (a - c) * f / a + g));
|
|
3926
|
+
dn(e, t, h, m, i);
|
|
3915
3927
|
}
|
|
3916
3928
|
const s = e[t];
|
|
3917
3929
|
let r = n, l = o;
|
|
3918
|
-
for (
|
|
3919
|
-
for (
|
|
3930
|
+
for (Oe(e, n, t), i(e[o], s) > 0 && Oe(e, n, o); r < l; ) {
|
|
3931
|
+
for (Oe(e, r, l), r++, l--; i(e[r], s) < 0; ) r++;
|
|
3920
3932
|
for (; i(e[l], s) > 0; ) l--;
|
|
3921
3933
|
}
|
|
3922
|
-
i(e[n], s) === 0 ?
|
|
3934
|
+
i(e[n], s) === 0 ? Oe(e, n, l) : (l++, Oe(e, l, o)), l <= t && (n = l + 1), t <= l && (o = l - 1);
|
|
3923
3935
|
}
|
|
3924
3936
|
}
|
|
3925
|
-
function
|
|
3937
|
+
function Oe(e, t, n) {
|
|
3926
3938
|
const o = e[t];
|
|
3927
3939
|
e[t] = e[n], e[n] = o;
|
|
3928
3940
|
}
|
|
3929
3941
|
function ki(e, t) {
|
|
3930
3942
|
return e < t ? -1 : e > t ? 1 : 0;
|
|
3931
3943
|
}
|
|
3932
|
-
class
|
|
3944
|
+
class Ii {
|
|
3933
3945
|
constructor(t = 9) {
|
|
3934
3946
|
this._maxEntries = Math.max(4, t), this._minEntries = Math.max(2, Math.ceil(this._maxEntries * 0.4)), this.clear();
|
|
3935
3947
|
}
|
|
@@ -3944,7 +3956,7 @@ class Oi {
|
|
|
3944
3956
|
for (; n; ) {
|
|
3945
3957
|
for (let r = 0; r < n.children.length; r++) {
|
|
3946
3958
|
const l = n.children[r], a = n.leaf ? i(l) : l;
|
|
3947
|
-
Fe(t, a) && (n.leaf ? o.push(l) :
|
|
3959
|
+
Fe(t, a) && (n.leaf ? o.push(l) : ft(t, a) ? this._all(l, o) : s.push(l));
|
|
3948
3960
|
}
|
|
3949
3961
|
n = s.pop();
|
|
3950
3962
|
}
|
|
@@ -3958,7 +3970,7 @@ class Oi {
|
|
|
3958
3970
|
for (let i = 0; i < n.children.length; i++) {
|
|
3959
3971
|
const s = n.children[i], r = n.leaf ? this.toBBox(s) : s;
|
|
3960
3972
|
if (Fe(t, r)) {
|
|
3961
|
-
if (n.leaf ||
|
|
3973
|
+
if (n.leaf || ft(t, r)) return !0;
|
|
3962
3974
|
o.push(s);
|
|
3963
3975
|
}
|
|
3964
3976
|
}
|
|
@@ -3991,7 +4003,7 @@ class Oi {
|
|
|
3991
4003
|
return t && this._insert(t, this.data.height - 1), this;
|
|
3992
4004
|
}
|
|
3993
4005
|
clear() {
|
|
3994
|
-
return this.data =
|
|
4006
|
+
return this.data = Se([]), this;
|
|
3995
4007
|
}
|
|
3996
4008
|
remove(t, n) {
|
|
3997
4009
|
if (!t) return this;
|
|
@@ -4000,11 +4012,11 @@ class Oi {
|
|
|
4000
4012
|
let l, a, c;
|
|
4001
4013
|
for (; o || s.length; ) {
|
|
4002
4014
|
if (o || (o = s.pop(), a = s[s.length - 1], l = r.pop(), c = !0), o.leaf) {
|
|
4003
|
-
const
|
|
4004
|
-
if (
|
|
4005
|
-
return o.children.splice(
|
|
4015
|
+
const u = Oi(t, o.children, n);
|
|
4016
|
+
if (u !== -1)
|
|
4017
|
+
return o.children.splice(u, 1), s.push(o), this._condense(s), this;
|
|
4006
4018
|
}
|
|
4007
|
-
!c && !o.leaf &&
|
|
4019
|
+
!c && !o.leaf && ft(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;
|
|
4008
4020
|
}
|
|
4009
4021
|
return this;
|
|
4010
4022
|
}
|
|
@@ -4033,26 +4045,26 @@ class Oi {
|
|
|
4033
4045
|
const s = o - n + 1;
|
|
4034
4046
|
let r = this._maxEntries, l;
|
|
4035
4047
|
if (s <= r)
|
|
4036
|
-
return l =
|
|
4037
|
-
i || (i = Math.ceil(Math.log(s) / Math.log(r)), r = Math.ceil(s / Math.pow(r, i - 1))), l =
|
|
4048
|
+
return l = Se(t.slice(n, o + 1)), Ee(l, this.toBBox), l;
|
|
4049
|
+
i || (i = Math.ceil(Math.log(s) / Math.log(r)), r = Math.ceil(s / Math.pow(r, i - 1))), l = Se([]), l.leaf = !1, l.height = i;
|
|
4038
4050
|
const a = Math.ceil(s / r), c = a * Math.ceil(Math.sqrt(r));
|
|
4039
|
-
|
|
4040
|
-
for (let
|
|
4041
|
-
const
|
|
4042
|
-
|
|
4043
|
-
for (let
|
|
4044
|
-
const
|
|
4045
|
-
l.children.push(this._build(t,
|
|
4051
|
+
Wt(t, n, o, c, this.compareMinX);
|
|
4052
|
+
for (let u = n; u <= o; u += c) {
|
|
4053
|
+
const f = Math.min(u + c - 1, o);
|
|
4054
|
+
Wt(t, u, f, a, this.compareMinY);
|
|
4055
|
+
for (let g = u; g <= f; g += a) {
|
|
4056
|
+
const h = Math.min(g + a - 1, f);
|
|
4057
|
+
l.children.push(this._build(t, g, h, i - 1));
|
|
4046
4058
|
}
|
|
4047
4059
|
}
|
|
4048
|
-
return
|
|
4060
|
+
return Ee(l, this.toBBox), l;
|
|
4049
4061
|
}
|
|
4050
4062
|
_chooseSubtree(t, n, o, i) {
|
|
4051
4063
|
for (; i.push(n), !(n.leaf || i.length - 1 === o); ) {
|
|
4052
4064
|
let s = 1 / 0, r = 1 / 0, l;
|
|
4053
4065
|
for (let a = 0; a < n.children.length; a++) {
|
|
4054
|
-
const c = n.children[a],
|
|
4055
|
-
|
|
4066
|
+
const c = n.children[a], u = ct(c), f = Yi(t, c) - u;
|
|
4067
|
+
f < r ? (r = f, s = u < s ? u : s, l = c) : f === r && u < s && (s = u, l = c);
|
|
4056
4068
|
}
|
|
4057
4069
|
n = l || n.children[0];
|
|
4058
4070
|
}
|
|
@@ -4068,17 +4080,17 @@ class Oi {
|
|
|
4068
4080
|
_split(t, n) {
|
|
4069
4081
|
const o = t[n], i = o.children.length, s = this._minEntries;
|
|
4070
4082
|
this._chooseSplitAxis(o, s, i);
|
|
4071
|
-
const r = this._chooseSplitIndex(o, s, i), l =
|
|
4072
|
-
l.height = o.height, l.leaf = o.leaf,
|
|
4083
|
+
const r = this._chooseSplitIndex(o, s, i), l = Se(o.children.splice(r, o.children.length - r));
|
|
4084
|
+
l.height = o.height, l.leaf = o.leaf, Ee(o, this.toBBox), Ee(l, this.toBBox), n ? t[n - 1].children.push(l) : this._splitRoot(o, l);
|
|
4073
4085
|
}
|
|
4074
4086
|
_splitRoot(t, n) {
|
|
4075
|
-
this.data =
|
|
4087
|
+
this.data = Se([t, n]), this.data.height = t.height + 1, this.data.leaf = !1, Ee(this.data, this.toBBox);
|
|
4076
4088
|
}
|
|
4077
4089
|
_chooseSplitIndex(t, n, o) {
|
|
4078
4090
|
let i, s = 1 / 0, r = 1 / 0;
|
|
4079
4091
|
for (let l = n; l <= o - n; l++) {
|
|
4080
|
-
const a = Pe(t, 0, l, this.toBBox), c = Pe(t, l, o, this.toBBox),
|
|
4081
|
-
|
|
4092
|
+
const a = Pe(t, 0, l, this.toBBox), c = Pe(t, l, o, this.toBBox), u = Di(a, c), f = ct(a) + ct(c);
|
|
4093
|
+
u < s ? (s = u, i = l, r = f < r ? f : r) : u === s && f < r && (r = f, i = l);
|
|
4082
4094
|
}
|
|
4083
4095
|
return i || o - n;
|
|
4084
4096
|
}
|
|
@@ -4093,12 +4105,12 @@ class Oi {
|
|
|
4093
4105
|
const s = this.toBBox, r = Pe(t, 0, n, s), l = Pe(t, o - n, o, s);
|
|
4094
4106
|
let a = He(r) + He(l);
|
|
4095
4107
|
for (let c = n; c < o - n; c++) {
|
|
4096
|
-
const
|
|
4097
|
-
Ye(r, t.leaf ? s(
|
|
4108
|
+
const u = t.children[c];
|
|
4109
|
+
Ye(r, t.leaf ? s(u) : u), a += He(r);
|
|
4098
4110
|
}
|
|
4099
4111
|
for (let c = o - n - 1; c >= n; c--) {
|
|
4100
|
-
const
|
|
4101
|
-
Ye(l, t.leaf ? s(
|
|
4112
|
+
const u = t.children[c];
|
|
4113
|
+
Ye(l, t.leaf ? s(u) : u), a += He(l);
|
|
4102
4114
|
}
|
|
4103
4115
|
return a;
|
|
4104
4116
|
}
|
|
@@ -4108,20 +4120,20 @@ class Oi {
|
|
|
4108
4120
|
}
|
|
4109
4121
|
_condense(t) {
|
|
4110
4122
|
for (let n = t.length - 1, o; n >= 0; n--)
|
|
4111
|
-
t[n].children.length === 0 ? n > 0 ? (o = t[n - 1].children, o.splice(o.indexOf(t[n]), 1)) : this.clear() :
|
|
4123
|
+
t[n].children.length === 0 ? n > 0 ? (o = t[n - 1].children, o.splice(o.indexOf(t[n]), 1)) : this.clear() : Ee(t[n], this.toBBox);
|
|
4112
4124
|
}
|
|
4113
4125
|
}
|
|
4114
|
-
function
|
|
4126
|
+
function Oi(e, t, n) {
|
|
4115
4127
|
if (!n) return t.indexOf(e);
|
|
4116
4128
|
for (let o = 0; o < t.length; o++)
|
|
4117
4129
|
if (n(e, t[o])) return o;
|
|
4118
4130
|
return -1;
|
|
4119
4131
|
}
|
|
4120
|
-
function
|
|
4132
|
+
function Ee(e, t) {
|
|
4121
4133
|
Pe(e, 0, e.children.length, t, e);
|
|
4122
4134
|
}
|
|
4123
4135
|
function Pe(e, t, n, o, i) {
|
|
4124
|
-
i || (i =
|
|
4136
|
+
i || (i = Se(null)), i.minX = 1 / 0, i.minY = 1 / 0, i.maxX = -1 / 0, i.maxY = -1 / 0;
|
|
4125
4137
|
for (let s = t; s < n; s++) {
|
|
4126
4138
|
const r = e.children[s];
|
|
4127
4139
|
Ye(i, e.leaf ? o(r) : r);
|
|
@@ -4137,7 +4149,7 @@ function Bi(e, t) {
|
|
|
4137
4149
|
function Pi(e, t) {
|
|
4138
4150
|
return e.minY - t.minY;
|
|
4139
4151
|
}
|
|
4140
|
-
function
|
|
4152
|
+
function ct(e) {
|
|
4141
4153
|
return (e.maxX - e.minX) * (e.maxY - e.minY);
|
|
4142
4154
|
}
|
|
4143
4155
|
function He(e) {
|
|
@@ -4150,13 +4162,13 @@ function Di(e, t) {
|
|
|
4150
4162
|
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);
|
|
4151
4163
|
return Math.max(0, i - n) * Math.max(0, s - o);
|
|
4152
4164
|
}
|
|
4153
|
-
function
|
|
4165
|
+
function ft(e, t) {
|
|
4154
4166
|
return e.minX <= t.minX && e.minY <= t.minY && t.maxX <= e.maxX && t.maxY <= e.maxY;
|
|
4155
4167
|
}
|
|
4156
4168
|
function Fe(e, t) {
|
|
4157
4169
|
return t.minX <= e.maxX && t.minY <= e.maxY && t.maxX >= e.minX && t.maxY >= e.minY;
|
|
4158
4170
|
}
|
|
4159
|
-
function
|
|
4171
|
+
function Se(e) {
|
|
4160
4172
|
return {
|
|
4161
4173
|
children: e,
|
|
4162
4174
|
height: 1,
|
|
@@ -4167,76 +4179,75 @@ function ve(e) {
|
|
|
4167
4179
|
maxY: -1 / 0
|
|
4168
4180
|
};
|
|
4169
4181
|
}
|
|
4170
|
-
function
|
|
4182
|
+
function Wt(e, t, n, o, i) {
|
|
4171
4183
|
const s = [t, n];
|
|
4172
4184
|
for (; s.length; ) {
|
|
4173
4185
|
if (n = s.pop(), t = s.pop(), n - t <= o) continue;
|
|
4174
4186
|
const r = t + Math.ceil((n - t) / o / 2) * o;
|
|
4175
|
-
|
|
4187
|
+
dn(e, r, t, n, i), s.push(t, r, r, n);
|
|
4176
4188
|
}
|
|
4177
4189
|
}
|
|
4178
4190
|
const Xi = () => {
|
|
4179
|
-
const e = new
|
|
4191
|
+
const e = new Ii(), t = /* @__PURE__ */ new Map(), n = () => [...t.values()], o = () => {
|
|
4180
4192
|
e.clear(), t.clear();
|
|
4181
|
-
}, i = (
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4193
|
+
}, i = (f) => {
|
|
4194
|
+
if (!qe(f)) return;
|
|
4195
|
+
const { minX: g, minY: h, maxX: m, maxY: y } = f.selector.geometry.bounds, T = { minX: g, minY: h, maxX: m, maxY: y, target: f };
|
|
4196
|
+
e.insert(T), t.set(f.annotation, T);
|
|
4197
|
+
}, s = (f) => {
|
|
4198
|
+
if (!qe(f)) return;
|
|
4199
|
+
const g = t.get(f.annotation);
|
|
4200
|
+
g && e.remove(g), t.delete(f.annotation);
|
|
4187
4201
|
};
|
|
4188
4202
|
return {
|
|
4189
4203
|
all: n,
|
|
4190
4204
|
clear: o,
|
|
4191
|
-
getAt: (
|
|
4205
|
+
getAt: (f, g) => {
|
|
4192
4206
|
const m = e.search({
|
|
4193
|
-
minX:
|
|
4194
|
-
minY:
|
|
4195
|
-
maxX:
|
|
4196
|
-
maxY:
|
|
4197
|
-
}).map((
|
|
4207
|
+
minX: f,
|
|
4208
|
+
minY: g,
|
|
4209
|
+
maxX: f,
|
|
4210
|
+
maxY: g
|
|
4211
|
+
}).map((y) => y.target).filter((y) => y.selector.type === W.RECTANGLE || kn(y.selector, f, g));
|
|
4198
4212
|
if (m.length > 0)
|
|
4199
|
-
return m.sort((
|
|
4200
|
-
},
|
|
4201
|
-
getIntersecting: (
|
|
4202
|
-
minX:
|
|
4203
|
-
minY:
|
|
4204
|
-
maxX:
|
|
4205
|
-
maxY:
|
|
4206
|
-
}).map((
|
|
4213
|
+
return m.sort((y, T) => gt(y.selector) - gt(T.selector)), m[0];
|
|
4214
|
+
},
|
|
4215
|
+
getIntersecting: (f, g, h, m) => e.search({
|
|
4216
|
+
minX: f,
|
|
4217
|
+
minY: g,
|
|
4218
|
+
maxX: f + h,
|
|
4219
|
+
maxY: g + m
|
|
4220
|
+
}).map((y) => y.target),
|
|
4207
4221
|
insert: i,
|
|
4208
4222
|
remove: s,
|
|
4209
|
-
set: (
|
|
4210
|
-
|
|
4211
|
-
const
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
|
|
4215
|
-
return [...m, { minX: w, minY: y, maxX: b, maxY: B, target: _ }];
|
|
4223
|
+
set: (f, g = !0) => {
|
|
4224
|
+
g && o();
|
|
4225
|
+
const h = f.reduce((m, y) => {
|
|
4226
|
+
if (qe(y)) {
|
|
4227
|
+
const { minX: T, minY: p, maxX: w, maxY: _ } = y.selector.geometry.bounds;
|
|
4228
|
+
return [...m, { minX: T, minY: p, maxX: w, maxY: _, target: y }];
|
|
4216
4229
|
} else
|
|
4217
4230
|
return m;
|
|
4218
4231
|
}, []);
|
|
4219
|
-
|
|
4232
|
+
h.forEach((m) => t.set(m.target.annotation, m)), e.load(h);
|
|
4220
4233
|
},
|
|
4221
4234
|
size: () => e.all().length,
|
|
4222
|
-
update: (
|
|
4223
|
-
s(
|
|
4235
|
+
update: (f, g) => {
|
|
4236
|
+
s(f), i(g);
|
|
4224
4237
|
}
|
|
4225
4238
|
};
|
|
4226
4239
|
}, Ri = (e) => {
|
|
4227
|
-
const t = so(), n = Xi(), o = Wn(t);
|
|
4228
|
-
o.setUserSelectAction(e.userSelectAction);
|
|
4229
|
-
const i = Fn(t), s = fo();
|
|
4240
|
+
const t = so(), n = Xi(), o = Wn(t, e.userSelectAction), i = Fn(t), s = fo();
|
|
4230
4241
|
return t.observe(({ changes: a }) => {
|
|
4231
|
-
n.set((a.created || []).map((c) => c.target), !1), (a.deleted || []).forEach((c) => n.remove(c.target)), (a.updated || []).forEach(({ oldValue: c, newValue:
|
|
4242
|
+
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));
|
|
4232
4243
|
}), {
|
|
4233
4244
|
store: {
|
|
4234
4245
|
...t,
|
|
4235
4246
|
getAt: (a, c) => {
|
|
4236
|
-
const
|
|
4237
|
-
return
|
|
4247
|
+
const u = n.getAt(a, c);
|
|
4248
|
+
return u ? t.getAnnotation(u.annotation) : void 0;
|
|
4238
4249
|
},
|
|
4239
|
-
getIntersecting: (a, c,
|
|
4250
|
+
getIntersecting: (a, c, u, f) => n.getIntersecting(a, c, u, f).map((g) => t.getAnnotation(g.annotation))
|
|
4240
4251
|
},
|
|
4241
4252
|
selection: o,
|
|
4242
4253
|
hover: i,
|
|
@@ -4266,13 +4277,13 @@ const Xi = () => {
|
|
|
4266
4277
|
}, Ui = (e) => {
|
|
4267
4278
|
const t = Ni(e), n = t > 0.6 ? "dark" : "light";
|
|
4268
4279
|
return console.log(`[Annotorious] Image brightness: ${t.toFixed(1)}. Setting ${n} theme.`), n;
|
|
4269
|
-
},
|
|
4280
|
+
}, qt = (e, t, n) => t.setAttribute("data-theme", n === "auto" ? Ui(e) : n), Vi = (e, t) => ({
|
|
4270
4281
|
...e,
|
|
4271
4282
|
drawingEnabled: e.drawingEnabled === void 0 ? t.drawingEnabled : e.drawingEnabled,
|
|
4272
4283
|
drawingMode: e.drawingMode || t.drawingMode,
|
|
4273
4284
|
userSelectAction: e.userSelectAction || t.userSelectAction,
|
|
4274
4285
|
theme: e.theme || t.theme
|
|
4275
|
-
}),
|
|
4286
|
+
}), Kt = typeof navigator > "u" ? !1 : navigator.userAgent.indexOf("Mac OS X") !== -1, Gi = (e, t) => {
|
|
4276
4287
|
const n = t || document, o = (r) => {
|
|
4277
4288
|
const l = r;
|
|
4278
4289
|
l.key === "z" && l.ctrlKey ? e.undo() : l.key === "y" && l.ctrlKey && e.redo();
|
|
@@ -4280,9 +4291,9 @@ const Xi = () => {
|
|
|
4280
4291
|
const l = r;
|
|
4281
4292
|
l.key === "z" && l.metaKey && (l.shiftKey ? e.redo() : e.undo());
|
|
4282
4293
|
}, s = () => {
|
|
4283
|
-
|
|
4294
|
+
Kt ? n.removeEventListener("keydown", i) : n.removeEventListener("keydown", o);
|
|
4284
4295
|
};
|
|
4285
|
-
return
|
|
4296
|
+
return Kt ? n.addEventListener("keydown", i) : n.addEventListener("keydown", o), {
|
|
4286
4297
|
destroy: s
|
|
4287
4298
|
};
|
|
4288
4299
|
}, Fi = (e, t = {}) => {
|
|
@@ -4291,7 +4302,7 @@ const Xi = () => {
|
|
|
4291
4302
|
const n = typeof e == "string" ? document.getElementById(e) : e, o = Vi(t, {
|
|
4292
4303
|
drawingEnabled: !0,
|
|
4293
4304
|
drawingMode: "drag",
|
|
4294
|
-
userSelectAction:
|
|
4305
|
+
userSelectAction: on.EDIT,
|
|
4295
4306
|
theme: "light"
|
|
4296
4307
|
}), i = Ci(o), { selection: s, store: r } = i, l = co(r), a = uo(
|
|
4297
4308
|
i,
|
|
@@ -4300,10 +4311,10 @@ const Xi = () => {
|
|
|
4300
4311
|
o.autoSave
|
|
4301
4312
|
), c = document.createElement("DIV");
|
|
4302
4313
|
c.style.position = "relative", c.style.display = "inline-block", n.style.display = "block", n.parentNode.insertBefore(c, n), c.appendChild(n);
|
|
4303
|
-
const
|
|
4304
|
-
let
|
|
4305
|
-
|
|
4306
|
-
const
|
|
4314
|
+
const u = Gi(l);
|
|
4315
|
+
let f = bo();
|
|
4316
|
+
qt(n, c, o.theme);
|
|
4317
|
+
const g = new Li({
|
|
4307
4318
|
target: c,
|
|
4308
4319
|
props: {
|
|
4309
4320
|
drawingEnabled: !!o.drawingEnabled,
|
|
@@ -4311,40 +4322,40 @@ const Xi = () => {
|
|
|
4311
4322
|
preferredDrawingMode: o.drawingMode,
|
|
4312
4323
|
state: i,
|
|
4313
4324
|
style: o.style,
|
|
4314
|
-
user:
|
|
4325
|
+
user: f
|
|
4315
4326
|
}
|
|
4316
4327
|
});
|
|
4317
|
-
|
|
4318
|
-
const { originalEvent: E, annotation: A } =
|
|
4328
|
+
g.$on("click", (P) => {
|
|
4329
|
+
const { originalEvent: E, annotation: A } = P.detail;
|
|
4319
4330
|
A ? s.userSelect(A.id, E) : s.isEmpty() || s.clear();
|
|
4320
4331
|
});
|
|
4321
|
-
const
|
|
4322
|
-
|
|
4323
|
-
},
|
|
4324
|
-
if (!
|
|
4325
|
-
throw `No drawing tool named ${
|
|
4326
|
-
|
|
4327
|
-
},
|
|
4332
|
+
const h = go(i, l, o.adapter), m = () => {
|
|
4333
|
+
g.$destroy(), c.parentNode.insertBefore(n, c), c.parentNode.removeChild(c), u.destroy(), l.destroy();
|
|
4334
|
+
}, y = () => f, T = (P, E, A) => si(P, E, A), p = (P, E) => zo(P, E), w = (P) => {
|
|
4335
|
+
if (!fn(P))
|
|
4336
|
+
throw `No drawing tool named ${P}`;
|
|
4337
|
+
g.$set({ toolName: P });
|
|
4338
|
+
}, _ = (P) => g.$set({ drawingEnabled: P }), b = (P) => {
|
|
4328
4339
|
console.warn("Filter not implemented yet");
|
|
4329
|
-
},
|
|
4330
|
-
|
|
4331
|
-
}, G = (
|
|
4340
|
+
}, Y = (P) => g.$set({ style: P }), U = (P) => qt(n, c, P), V = (P) => {
|
|
4341
|
+
f = P, g.$set({ user: P });
|
|
4342
|
+
}, G = (P) => (
|
|
4332
4343
|
// @ts-ignore
|
|
4333
|
-
|
|
4344
|
+
g.$set({ visible: P })
|
|
4334
4345
|
);
|
|
4335
4346
|
return {
|
|
4336
|
-
...
|
|
4347
|
+
...h,
|
|
4337
4348
|
destroy: m,
|
|
4338
|
-
getUser:
|
|
4339
|
-
listDrawingTools:
|
|
4349
|
+
getUser: y,
|
|
4350
|
+
listDrawingTools: cn,
|
|
4340
4351
|
on: a.on,
|
|
4341
4352
|
off: a.off,
|
|
4342
|
-
registerDrawingTool:
|
|
4353
|
+
registerDrawingTool: T,
|
|
4343
4354
|
registerShapeEditor: p,
|
|
4344
|
-
setDrawingEnabled:
|
|
4355
|
+
setDrawingEnabled: _,
|
|
4345
4356
|
setDrawingTool: w,
|
|
4346
4357
|
setFilter: b,
|
|
4347
|
-
setStyle:
|
|
4358
|
+
setStyle: Y,
|
|
4348
4359
|
setTheme: U,
|
|
4349
4360
|
setUser: V,
|
|
4350
4361
|
setVisible: G,
|
|
@@ -4353,11 +4364,11 @@ const Xi = () => {
|
|
|
4353
4364
|
};
|
|
4354
4365
|
};
|
|
4355
4366
|
export {
|
|
4356
|
-
|
|
4367
|
+
an as Editor,
|
|
4357
4368
|
Ko as EditorMount,
|
|
4358
4369
|
Be as Handle,
|
|
4359
4370
|
Hi as IdentityTransform,
|
|
4360
|
-
|
|
4371
|
+
Io as PolygonEditor,
|
|
4361
4372
|
Go as RectangleEditor,
|
|
4362
4373
|
Bn as RectangleUtil,
|
|
4363
4374
|
$o as RubberbandRectangle,
|
|
@@ -4366,34 +4377,36 @@ export {
|
|
|
4366
4377
|
Qo as ToolMount,
|
|
4367
4378
|
zi as W3CImageFormat,
|
|
4368
4379
|
wi as addEventListeners,
|
|
4369
|
-
|
|
4370
|
-
|
|
4380
|
+
Qe as boundsFromPoints,
|
|
4381
|
+
gt as computeArea,
|
|
4371
4382
|
Fi as createImageAnnotator,
|
|
4372
4383
|
Ri as createImageAnnotatorState,
|
|
4373
4384
|
yi as createSVGTransform,
|
|
4374
4385
|
Ci as createSvelteImageAnnotatorState,
|
|
4375
4386
|
Ui as detectTheme,
|
|
4376
|
-
|
|
4387
|
+
rt as distance,
|
|
4377
4388
|
Po as enableResponsive,
|
|
4378
4389
|
Vi as fillDefaults,
|
|
4379
4390
|
jo as getEditor,
|
|
4380
|
-
|
|
4381
|
-
|
|
4391
|
+
un as getSVGPoint,
|
|
4392
|
+
fn as getTool,
|
|
4382
4393
|
Gi as initKeyboardCommands,
|
|
4383
4394
|
kn as intersects,
|
|
4384
|
-
|
|
4395
|
+
Ze as isImageAnnotation,
|
|
4396
|
+
qe as isImageAnnotationTarget,
|
|
4397
|
+
Kt as isMac,
|
|
4385
4398
|
Yo as isTouch,
|
|
4386
|
-
|
|
4399
|
+
cn as listDrawingTools,
|
|
4387
4400
|
Pn as parseFragmentSelector,
|
|
4388
4401
|
Nn as parseSVGSelector,
|
|
4389
4402
|
vo as parseW3CImageAnnotation,
|
|
4390
4403
|
zo as registerEditor,
|
|
4391
|
-
|
|
4404
|
+
yt as registerShapeUtil,
|
|
4392
4405
|
si as registerTool,
|
|
4393
4406
|
Ni as sampleBrightness,
|
|
4394
4407
|
Yn as serializeFragmentSelector,
|
|
4395
4408
|
Un as serializeSVGSelector,
|
|
4396
4409
|
To as serializeW3CImageAnnotation,
|
|
4397
|
-
|
|
4410
|
+
qt as setTheme
|
|
4398
4411
|
};
|
|
4399
4412
|
//# sourceMappingURL=annotorious.es.js.map
|