@annotorious/annotorious 3.0.0-rc.21 → 3.0.0-rc.23
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 +7 -10
- package/dist/Annotorious.d.ts.map +1 -1
- package/dist/AnnotoriousOpts.d.ts +3 -2
- package/dist/annotation/SVGAnnotationLayerPointerEvent.d.ts +3 -2
- package/dist/annotation/editors/editorsRegistry.d.ts +3 -2
- package/dist/annotation/tools/DrawingToolConfig.d.ts +2 -1
- package/dist/annotation/tools/drawingToolsRegistry.d.ts +3 -2
- package/dist/annotation/utils/responsive.d.ts +1 -1
- package/dist/annotation/utils/styling.d.ts +4 -3
- package/dist/annotation/utils/styling.d.ts.map +1 -1
- package/dist/annotorious.css +1 -1
- package/dist/annotorious.es.js +1082 -1079
- package/dist/annotorious.es.js.map +1 -1
- package/dist/annotorious.js +1 -1
- package/dist/annotorious.js.map +1 -1
- package/dist/keyboardCommands.d.ts +2 -1
- package/dist/model/core/ImageAnnotation.d.ts +3 -2
- package/dist/model/core/Shape.d.ts +2 -1
- package/dist/model/core/ellipse/Ellipse.d.ts +2 -1
- package/dist/model/core/polygon/Polygon.d.ts +2 -1
- package/dist/model/core/rectangle/Rectangle.d.ts +2 -1
- package/dist/model/core/rectangle/rectangleUtils.d.ts +3 -2
- package/dist/model/core/shapeUtils.d.ts +2 -1
- package/dist/model/w3c/W3CImageAnnotation.d.ts +4 -3
- package/dist/model/w3c/W3CImageFormatAdapter.d.ts +4 -3
- package/dist/model/w3c/fragment/FragmentSelector.d.ts +2 -1
- package/dist/model/w3c/svg/SVGSelector.d.ts +2 -1
- package/dist/state/ImageAnnotationStore.d.ts +3 -2
- package/dist/state/ImageAnnotatorState.d.ts +5 -4
- package/dist/state/spatialTree.d.ts +2 -1
- package/dist/themes/smart/setTheme.d.ts +2 -1
- package/package.json +11 -11
- package/src/Annotorious.css +4 -0
- package/src/Annotorious.ts +8 -2
- package/src/annotation/SVGAnnotationLayer.svelte +4 -2
- package/src/annotation/editors/EditorMount.svelte +2 -2
- package/src/annotation/shapes/Ellipse.svelte +2 -2
- package/src/annotation/shapes/Polygon.svelte +2 -2
- package/src/annotation/shapes/Rectangle.svelte +2 -2
- package/src/annotation/utils/styling.ts +5 -2
package/dist/annotorious.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var nn = Object.defineProperty;
|
|
2
2
|
var on = (e, t, n) => t in e ? nn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var Ke = (e, t, n) => (on(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
4
|
-
function
|
|
4
|
+
function G() {
|
|
5
5
|
}
|
|
6
6
|
function nt(e, t) {
|
|
7
7
|
for (const n in t)
|
|
@@ -17,13 +17,13 @@ function Nt(e) {
|
|
|
17
17
|
function dt() {
|
|
18
18
|
return /* @__PURE__ */ Object.create(null);
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function le(e) {
|
|
21
21
|
e.forEach(Nt);
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function j(e) {
|
|
24
24
|
return typeof e == "function";
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function K(e, t) {
|
|
27
27
|
return e != e ? t == t : e !== t || e && typeof e == "object" || typeof e == "function";
|
|
28
28
|
}
|
|
29
29
|
function sn(e) {
|
|
@@ -33,7 +33,7 @@ function Vt(e, ...t) {
|
|
|
33
33
|
if (e == null) {
|
|
34
34
|
for (const o of t)
|
|
35
35
|
o(void 0);
|
|
36
|
-
return
|
|
36
|
+
return G;
|
|
37
37
|
}
|
|
38
38
|
const n = e.subscribe(...t);
|
|
39
39
|
return n.unsubscribe ? () => n.unsubscribe() : n;
|
|
@@ -86,63 +86,63 @@ function gt(e) {
|
|
|
86
86
|
n[0] !== "$" && (t[n] = e[n]);
|
|
87
87
|
return t;
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function ze(e) {
|
|
90
90
|
return e ?? "";
|
|
91
91
|
}
|
|
92
92
|
const fn = typeof window < "u" ? window : typeof globalThis < "u" ? globalThis : (
|
|
93
93
|
// @ts-ignore Node typings have this
|
|
94
94
|
global
|
|
95
95
|
);
|
|
96
|
-
function
|
|
96
|
+
function ie(e, t) {
|
|
97
97
|
e.appendChild(t);
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function B(e, t, n) {
|
|
100
100
|
e.insertBefore(t, n || null);
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function k(e) {
|
|
103
103
|
e.parentNode && e.parentNode.removeChild(e);
|
|
104
104
|
}
|
|
105
105
|
function rt(e, t) {
|
|
106
106
|
for (let n = 0; n < e.length; n += 1)
|
|
107
107
|
e[n] && e[n].d(t);
|
|
108
108
|
}
|
|
109
|
-
function
|
|
109
|
+
function X(e) {
|
|
110
110
|
return document.createElementNS("http://www.w3.org/2000/svg", e);
|
|
111
111
|
}
|
|
112
112
|
function zt(e) {
|
|
113
113
|
return document.createTextNode(e);
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function ne() {
|
|
116
116
|
return zt(" ");
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function ae() {
|
|
119
119
|
return zt("");
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function H(e, t, n, o) {
|
|
122
122
|
return e.addEventListener(t, n, o), () => e.removeEventListener(t, n, o);
|
|
123
123
|
}
|
|
124
|
-
function
|
|
124
|
+
function h(e, t, n) {
|
|
125
125
|
n == null ? e.removeAttribute(t) : e.getAttribute(t) !== n && e.setAttribute(t, n);
|
|
126
126
|
}
|
|
127
127
|
function un(e) {
|
|
128
128
|
return Array.from(e.childNodes);
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function Ee(e, t, n) {
|
|
131
131
|
e.classList.toggle(t, !!n);
|
|
132
132
|
}
|
|
133
133
|
function dn(e, t, { bubbles: n = !1, cancelable: o = !1 } = {}) {
|
|
134
134
|
return new CustomEvent(e, { detail: t, bubbles: n, cancelable: o });
|
|
135
135
|
}
|
|
136
|
-
let
|
|
137
|
-
function
|
|
138
|
-
|
|
136
|
+
let Pe;
|
|
137
|
+
function Ie(e) {
|
|
138
|
+
Pe = e;
|
|
139
139
|
}
|
|
140
140
|
function Ht() {
|
|
141
|
-
if (!
|
|
141
|
+
if (!Pe)
|
|
142
142
|
throw new Error("Function called outside component initialization");
|
|
143
|
-
return
|
|
143
|
+
return Pe;
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function Ye(e) {
|
|
146
146
|
Ht().$$.on_mount.push(e);
|
|
147
147
|
}
|
|
148
148
|
function Te() {
|
|
@@ -163,11 +163,11 @@ function Te() {
|
|
|
163
163
|
return !0;
|
|
164
164
|
};
|
|
165
165
|
}
|
|
166
|
-
function
|
|
166
|
+
function fe(e, t) {
|
|
167
167
|
const n = e.$$.callbacks[t.type];
|
|
168
168
|
n && n.slice().forEach((o) => o.call(this, t));
|
|
169
169
|
}
|
|
170
|
-
const
|
|
170
|
+
const we = [], He = [];
|
|
171
171
|
let Ae = [];
|
|
172
172
|
const mt = [], hn = /* @__PURE__ */ Promise.resolve();
|
|
173
173
|
let ot = !1;
|
|
@@ -178,35 +178,35 @@ function it(e) {
|
|
|
178
178
|
Ae.push(e);
|
|
179
179
|
}
|
|
180
180
|
const We = /* @__PURE__ */ new Set();
|
|
181
|
-
let
|
|
181
|
+
let me = 0;
|
|
182
182
|
function Ft() {
|
|
183
|
-
if (
|
|
183
|
+
if (me !== 0)
|
|
184
184
|
return;
|
|
185
|
-
const e =
|
|
185
|
+
const e = Pe;
|
|
186
186
|
do {
|
|
187
187
|
try {
|
|
188
|
-
for (;
|
|
189
|
-
const t =
|
|
190
|
-
|
|
188
|
+
for (; me < we.length; ) {
|
|
189
|
+
const t = we[me];
|
|
190
|
+
me++, Ie(t), mn(t.$$);
|
|
191
191
|
}
|
|
192
192
|
} catch (t) {
|
|
193
|
-
throw
|
|
193
|
+
throw we.length = 0, me = 0, t;
|
|
194
194
|
}
|
|
195
|
-
for (
|
|
195
|
+
for (Ie(null), we.length = 0, me = 0; He.length; )
|
|
196
196
|
He.pop()();
|
|
197
197
|
for (let t = 0; t < Ae.length; t += 1) {
|
|
198
198
|
const n = Ae[t];
|
|
199
199
|
We.has(n) || (We.add(n), n());
|
|
200
200
|
}
|
|
201
201
|
Ae.length = 0;
|
|
202
|
-
} while (
|
|
202
|
+
} while (we.length);
|
|
203
203
|
for (; mt.length; )
|
|
204
204
|
mt.pop()();
|
|
205
|
-
ot = !1, We.clear(),
|
|
205
|
+
ot = !1, We.clear(), Ie(e);
|
|
206
206
|
}
|
|
207
207
|
function mn(e) {
|
|
208
208
|
if (e.fragment !== null) {
|
|
209
|
-
e.update(),
|
|
209
|
+
e.update(), le(e.before_update);
|
|
210
210
|
const t = e.dirty;
|
|
211
211
|
e.dirty = [-1], e.fragment && e.fragment.p(e.ctx, t), e.after_update.forEach(it);
|
|
212
212
|
}
|
|
@@ -215,28 +215,28 @@ function pn(e) {
|
|
|
215
215
|
const t = [], n = [];
|
|
216
216
|
Ae.forEach((o) => e.indexOf(o) === -1 ? t.push(o) : n.push(o)), n.forEach((o) => o()), Ae = t;
|
|
217
217
|
}
|
|
218
|
-
const
|
|
219
|
-
let
|
|
220
|
-
function
|
|
221
|
-
|
|
218
|
+
const Ge = /* @__PURE__ */ new Set();
|
|
219
|
+
let ue;
|
|
220
|
+
function se() {
|
|
221
|
+
ue = {
|
|
222
222
|
r: 0,
|
|
223
223
|
c: [],
|
|
224
|
-
p:
|
|
224
|
+
p: ue
|
|
225
225
|
// parent group
|
|
226
226
|
};
|
|
227
227
|
}
|
|
228
|
-
function
|
|
229
|
-
|
|
228
|
+
function re() {
|
|
229
|
+
ue.r || le(ue.c), ue = ue.p;
|
|
230
230
|
}
|
|
231
231
|
function P(e, t) {
|
|
232
|
-
e && e.i && (
|
|
232
|
+
e && e.i && (Ge.delete(e), e.i(t));
|
|
233
233
|
}
|
|
234
234
|
function D(e, t, n, o) {
|
|
235
235
|
if (e && e.o) {
|
|
236
|
-
if (
|
|
236
|
+
if (Ge.has(e))
|
|
237
237
|
return;
|
|
238
|
-
|
|
239
|
-
|
|
238
|
+
Ge.add(e), ue.c.push(() => {
|
|
239
|
+
Ge.delete(e), o && (n && e.d(1), o());
|
|
240
240
|
}), e.o(t);
|
|
241
241
|
} else
|
|
242
242
|
o && o();
|
|
@@ -250,26 +250,26 @@ function $(e) {
|
|
|
250
250
|
function Q(e, t, n) {
|
|
251
251
|
const { fragment: o, after_update: i } = e.$$;
|
|
252
252
|
o && o.m(t, n), it(() => {
|
|
253
|
-
const s = e.$$.on_mount.map(Nt).filter(
|
|
254
|
-
e.$$.on_destroy ? e.$$.on_destroy.push(...s) :
|
|
253
|
+
const s = e.$$.on_mount.map(Nt).filter(j);
|
|
254
|
+
e.$$.on_destroy ? e.$$.on_destroy.push(...s) : le(s), e.$$.on_mount = [];
|
|
255
255
|
}), i.forEach(it);
|
|
256
256
|
}
|
|
257
257
|
function x(e, t) {
|
|
258
258
|
const n = e.$$;
|
|
259
|
-
n.fragment !== null && (pn(n.after_update),
|
|
259
|
+
n.fragment !== null && (pn(n.after_update), le(n.on_destroy), n.fragment && n.fragment.d(t), n.on_destroy = n.fragment = null, n.ctx = []);
|
|
260
260
|
}
|
|
261
261
|
function yn(e, t) {
|
|
262
|
-
e.$$.dirty[0] === -1 && (
|
|
262
|
+
e.$$.dirty[0] === -1 && (we.push(e), gn(), e.$$.dirty.fill(0)), e.$$.dirty[t / 31 | 0] |= 1 << t % 31;
|
|
263
263
|
}
|
|
264
264
|
function ee(e, t, n, o, i, s, r = null, l = [-1]) {
|
|
265
|
-
const a =
|
|
266
|
-
|
|
265
|
+
const a = Pe;
|
|
266
|
+
Ie(e);
|
|
267
267
|
const c = e.$$ = {
|
|
268
268
|
fragment: null,
|
|
269
269
|
ctx: [],
|
|
270
270
|
// state
|
|
271
271
|
props: s,
|
|
272
|
-
update:
|
|
272
|
+
update: G,
|
|
273
273
|
not_equal: i,
|
|
274
274
|
bound: dt(),
|
|
275
275
|
// lifecycle
|
|
@@ -287,18 +287,18 @@ function ee(e, t, n, o, i, s, r = null, l = [-1]) {
|
|
|
287
287
|
};
|
|
288
288
|
r && r(c.root);
|
|
289
289
|
let u = !1;
|
|
290
|
-
if (c.ctx = n ? n(e, t.props || {}, (f,
|
|
291
|
-
const m = g.length ? g[0] :
|
|
292
|
-
return c.ctx && i(c.ctx[f], c.ctx[f] = m) && (!c.skip_bound && c.bound[f] && c.bound[f](m), u && yn(e, f)),
|
|
293
|
-
}) : [], c.update(), u = !0,
|
|
290
|
+
if (c.ctx = n ? n(e, t.props || {}, (f, d, ...g) => {
|
|
291
|
+
const m = g.length ? g[0] : d;
|
|
292
|
+
return c.ctx && i(c.ctx[f], c.ctx[f] = m) && (!c.skip_bound && c.bound[f] && c.bound[f](m), u && yn(e, f)), d;
|
|
293
|
+
}) : [], c.update(), u = !0, le(c.before_update), c.fragment = o ? o(c.ctx) : !1, t.target) {
|
|
294
294
|
if (t.hydrate) {
|
|
295
295
|
const f = un(t.target);
|
|
296
|
-
c.fragment && c.fragment.l(f), f.forEach(
|
|
296
|
+
c.fragment && c.fragment.l(f), f.forEach(k);
|
|
297
297
|
} else
|
|
298
298
|
c.fragment && c.fragment.c();
|
|
299
299
|
t.intro && P(e.$$.fragment), Q(e, t.target, t.anchor), Ft();
|
|
300
300
|
}
|
|
301
|
-
|
|
301
|
+
Ie(a);
|
|
302
302
|
}
|
|
303
303
|
class te {
|
|
304
304
|
constructor() {
|
|
@@ -321,7 +321,7 @@ class te {
|
|
|
321
321
|
}
|
|
322
322
|
/** @returns {void} */
|
|
323
323
|
$destroy() {
|
|
324
|
-
x(this, 1), this.$destroy =
|
|
324
|
+
x(this, 1), this.$destroy = G;
|
|
325
325
|
}
|
|
326
326
|
/**
|
|
327
327
|
* @template {Extract<keyof Events, string>} K
|
|
@@ -330,8 +330,8 @@ class te {
|
|
|
330
330
|
* @returns {() => void}
|
|
331
331
|
*/
|
|
332
332
|
$on(t, n) {
|
|
333
|
-
if (!
|
|
334
|
-
return
|
|
333
|
+
if (!j(n))
|
|
334
|
+
return G;
|
|
335
335
|
const o = this.$$.callbacks[t] || (this.$$.callbacks[t] = []);
|
|
336
336
|
return o.push(n), () => {
|
|
337
337
|
const i = o.indexOf(n);
|
|
@@ -348,7 +348,7 @@ class te {
|
|
|
348
348
|
}
|
|
349
349
|
const _n = "4";
|
|
350
350
|
typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(_n);
|
|
351
|
-
var
|
|
351
|
+
var F = /* @__PURE__ */ ((e) => (e.ELLIPSE = "ELLIPSE", e.POLYGON = "POLYGON", e.RECTANGLE = "RECTANGLE", e))(F || {});
|
|
352
352
|
const lt = {}, at = (e, t) => lt[e] = t, st = (e) => lt[e.type].area(e), wn = (e, t, n) => lt[e.type].intersects(e, t, n), Fe = (e) => {
|
|
353
353
|
let t = 1 / 0, n = 1 / 0, o = -1 / 0, i = -1 / 0;
|
|
354
354
|
return e.forEach(([s, r]) => {
|
|
@@ -357,11 +357,11 @@ const lt = {}, at = (e, t) => lt[e] = t, st = (e) => lt[e.type].area(e), wn = (e
|
|
|
357
357
|
}, bn = {
|
|
358
358
|
area: (e) => Math.PI * e.geometry.rx * e.geometry.ry,
|
|
359
359
|
intersects: (e, t, n) => {
|
|
360
|
-
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,
|
|
361
|
-
return
|
|
360
|
+
const { cx: o, cy: i, rx: s, ry: r } = e.geometry, l = 0, a = Math.cos(l), c = Math.sin(l), u = t - o, f = n - i, d = a * u + c * f, g = c * u - a * f;
|
|
361
|
+
return d * d / (s * s) + g * g / (r * r) <= 1;
|
|
362
362
|
}
|
|
363
363
|
};
|
|
364
|
-
at(
|
|
364
|
+
at(F.ELLIPSE, bn);
|
|
365
365
|
const En = {
|
|
366
366
|
area: (e) => {
|
|
367
367
|
const { points: t } = e.geometry;
|
|
@@ -380,31 +380,31 @@ const En = {
|
|
|
380
380
|
return i;
|
|
381
381
|
}
|
|
382
382
|
};
|
|
383
|
-
at(
|
|
383
|
+
at(F.POLYGON, En);
|
|
384
384
|
const An = {
|
|
385
385
|
area: (e) => e.geometry.w * e.geometry.h,
|
|
386
386
|
intersects: (e, t, n) => t >= e.geometry.x && t <= e.geometry.x + e.geometry.w && n >= e.geometry.y && n <= e.geometry.y + e.geometry.h
|
|
387
387
|
};
|
|
388
|
-
at(
|
|
388
|
+
at(F.RECTANGLE, An);
|
|
389
389
|
const Sn = (e, t = !1) => {
|
|
390
390
|
const n = typeof e == "string" ? e : e.value, o = /^(xywh)=(pixel|percent)?:?(.+?),(.+?),(.+?),(.+)*/g, i = [...n.matchAll(o)][0], [s, r, l, a, c, u, f] = i;
|
|
391
391
|
if (r !== "xywh")
|
|
392
392
|
throw new Error("Unsupported MediaFragment: " + n);
|
|
393
393
|
if (l && l !== "pixel")
|
|
394
394
|
throw new Error(`Unsupported MediaFragment unit: ${l}`);
|
|
395
|
-
const [
|
|
395
|
+
const [d, g, m, y] = [a, c, u, f].map(parseFloat);
|
|
396
396
|
return {
|
|
397
|
-
type:
|
|
397
|
+
type: F.RECTANGLE,
|
|
398
398
|
geometry: {
|
|
399
|
-
x:
|
|
399
|
+
x: d,
|
|
400
400
|
y: g,
|
|
401
401
|
w: m,
|
|
402
|
-
h:
|
|
402
|
+
h: y,
|
|
403
403
|
bounds: {
|
|
404
|
-
minX:
|
|
405
|
-
minY: t ? g -
|
|
406
|
-
maxX:
|
|
407
|
-
maxY: t ? g : g +
|
|
404
|
+
minX: d,
|
|
405
|
+
minY: t ? g - y : g,
|
|
406
|
+
maxX: d + m,
|
|
407
|
+
maxY: t ? g : g + y
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
410
|
};
|
|
@@ -431,7 +431,7 @@ const Sn = (e, t = !1) => {
|
|
|
431
431
|
}, Ln = (e) => {
|
|
432
432
|
const [t, n, o] = e.match(/(<polygon points=["|'])([^("|')]*)/) || [], i = o.split(" ").map((s) => s.split(",").map(parseFloat));
|
|
433
433
|
return {
|
|
434
|
-
type:
|
|
434
|
+
type: F.POLYGON,
|
|
435
435
|
geometry: {
|
|
436
436
|
points: i,
|
|
437
437
|
bounds: Fe(i)
|
|
@@ -445,7 +445,7 @@ const Sn = (e, t = !1) => {
|
|
|
445
445
|
maxY: o + s
|
|
446
446
|
};
|
|
447
447
|
return {
|
|
448
|
-
type:
|
|
448
|
+
type: F.ELLIPSE,
|
|
449
449
|
geometry: {
|
|
450
450
|
cx: n,
|
|
451
451
|
cy: o,
|
|
@@ -463,10 +463,10 @@ const Sn = (e, t = !1) => {
|
|
|
463
463
|
throw "Unsupported SVG shape: " + t;
|
|
464
464
|
}, Bn = (e) => {
|
|
465
465
|
let t;
|
|
466
|
-
if (e.type ===
|
|
466
|
+
if (e.type === F.POLYGON) {
|
|
467
467
|
const n = e.geometry, { points: o } = n;
|
|
468
468
|
t = `<svg><polygon points="${o.map((i) => i.join(",")).join(" ")}" /></svg>`;
|
|
469
|
-
} else if (e.type ===
|
|
469
|
+
} else if (e.type === F.ELLIPSE) {
|
|
470
470
|
const n = e.geometry;
|
|
471
471
|
t = `<svg><ellipse cx="${n.cx}" cy="${n.cy}" rx="${n.rx}" ry="${n.ry}" /></svg>`;
|
|
472
472
|
}
|
|
@@ -474,18 +474,18 @@ const Sn = (e, t = !1) => {
|
|
|
474
474
|
return { type: "SvgSelector", value: t };
|
|
475
475
|
throw `Unsupported shape type: ${e.type}`;
|
|
476
476
|
};
|
|
477
|
-
let
|
|
477
|
+
let Ue;
|
|
478
478
|
const In = new Uint8Array(16);
|
|
479
479
|
function Pn() {
|
|
480
|
-
if (!
|
|
480
|
+
if (!Ue && (Ue = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !Ue))
|
|
481
481
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
482
|
-
return
|
|
482
|
+
return Ue(In);
|
|
483
483
|
}
|
|
484
|
-
const
|
|
484
|
+
const q = [];
|
|
485
485
|
for (let e = 0; e < 256; ++e)
|
|
486
|
-
|
|
486
|
+
q.push((e + 256).toString(16).slice(1));
|
|
487
487
|
function Yn(e, t = 0) {
|
|
488
|
-
return
|
|
488
|
+
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]];
|
|
489
489
|
}
|
|
490
490
|
const Cn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), yt = {
|
|
491
491
|
randomUUID: Cn
|
|
@@ -495,16 +495,10 @@ function qt(e, t, n) {
|
|
|
495
495
|
return yt.randomUUID();
|
|
496
496
|
e = e || {};
|
|
497
497
|
const o = e.random || (e.rng || Pn)();
|
|
498
|
-
|
|
499
|
-
n = n || 0;
|
|
500
|
-
for (let i = 0; i < 16; ++i)
|
|
501
|
-
t[n + i] = o[i];
|
|
502
|
-
return t;
|
|
503
|
-
}
|
|
504
|
-
return Yn(o);
|
|
498
|
+
return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, Yn(o);
|
|
505
499
|
}
|
|
506
500
|
var _t = Object.prototype.hasOwnProperty;
|
|
507
|
-
function
|
|
501
|
+
function de(e, t) {
|
|
508
502
|
var n, o;
|
|
509
503
|
if (e === t)
|
|
510
504
|
return !0;
|
|
@@ -515,14 +509,14 @@ function he(e, t) {
|
|
|
515
509
|
return e.toString() === t.toString();
|
|
516
510
|
if (n === Array) {
|
|
517
511
|
if ((o = e.length) === t.length)
|
|
518
|
-
for (; o-- &&
|
|
512
|
+
for (; o-- && de(e[o], t[o]); )
|
|
519
513
|
;
|
|
520
514
|
return o === -1;
|
|
521
515
|
}
|
|
522
516
|
if (!n || typeof e == "object") {
|
|
523
517
|
o = 0;
|
|
524
518
|
for (n in e)
|
|
525
|
-
if (_t.call(e, n) && ++o && !_t.call(t, n) || !(n in t) || !
|
|
519
|
+
if (_t.call(e, n) && ++o && !_t.call(t, n) || !(n in t) || !de(e[n], t[n]))
|
|
526
520
|
return !1;
|
|
527
521
|
return Object.keys(t).length === o;
|
|
528
522
|
}
|
|
@@ -534,19 +528,19 @@ function Je() {
|
|
|
534
528
|
function Dn(e, t) {
|
|
535
529
|
return e != e ? t == t : e !== t || e && typeof e == "object" || typeof e == "function";
|
|
536
530
|
}
|
|
537
|
-
const
|
|
531
|
+
const pe = [];
|
|
538
532
|
function ct(e, t = Je) {
|
|
539
533
|
let n;
|
|
540
534
|
const o = /* @__PURE__ */ new Set();
|
|
541
535
|
function i(l) {
|
|
542
536
|
if (Dn(e, l) && (e = l, n)) {
|
|
543
|
-
const a = !
|
|
537
|
+
const a = !pe.length;
|
|
544
538
|
for (const c of o)
|
|
545
|
-
c[1](),
|
|
539
|
+
c[1](), pe.push(c, e);
|
|
546
540
|
if (a) {
|
|
547
|
-
for (let c = 0; c <
|
|
548
|
-
|
|
549
|
-
|
|
541
|
+
for (let c = 0; c < pe.length; c += 2)
|
|
542
|
+
pe[c][0](pe[c + 1]);
|
|
543
|
+
pe.length = 0;
|
|
550
544
|
}
|
|
551
545
|
}
|
|
552
546
|
}
|
|
@@ -589,25 +583,25 @@ const Ze = { selected: [] }, Rn = (e, t = "EDIT") => {
|
|
|
589
583
|
}, l = (f) => {
|
|
590
584
|
if (i.selected.length === 0)
|
|
591
585
|
return !1;
|
|
592
|
-
const
|
|
593
|
-
return i.selected.some((g) => g.id ===
|
|
594
|
-
}, a = (f,
|
|
586
|
+
const d = typeof f == "string" ? f : f.id;
|
|
587
|
+
return i.selected.some((g) => g.id === d);
|
|
588
|
+
}, a = (f, d) => {
|
|
595
589
|
const g = e.getAnnotation(f);
|
|
596
590
|
if (g) {
|
|
597
591
|
const m = Un(g, t);
|
|
598
|
-
o(m === "EDIT" ? { selected: [{ id: f, editable: !0 }], pointerEvent:
|
|
592
|
+
o(m === "EDIT" ? { selected: [{ id: f, editable: !0 }], pointerEvent: d } : m === "SELECT" ? { selected: [{ id: f }], pointerEvent: d } : { selected: [], pointerEvent: d });
|
|
599
593
|
} else
|
|
600
594
|
console.warn("Invalid selection: " + f);
|
|
601
|
-
}, c = (f,
|
|
602
|
-
const g = Array.isArray(f) ? f : [f], m = g.map((
|
|
603
|
-
o({ selected: m.map(({ id:
|
|
595
|
+
}, c = (f, d = !0) => {
|
|
596
|
+
const g = Array.isArray(f) ? f : [f], m = g.map((y) => e.getAnnotation(y)).filter(Boolean);
|
|
597
|
+
o({ selected: m.map(({ id: y }) => ({ id: y, editable: d })) }), m.length !== g.length && console.warn("Invalid selection", f);
|
|
604
598
|
}, u = (f) => {
|
|
605
599
|
if (i.selected.length === 0)
|
|
606
600
|
return !1;
|
|
607
|
-
const { selected:
|
|
608
|
-
|
|
601
|
+
const { selected: d } = i;
|
|
602
|
+
d.filter(({ id: g }) => f.includes(g)).length > 0 && o({ selected: d.filter(({ id: g }) => !f.includes(g)) });
|
|
609
603
|
};
|
|
610
|
-
return e.observe(({ changes: f }) => u((f.deleted || []).map((
|
|
604
|
+
return e.observe(({ changes: f }) => u((f.deleted || []).map((d) => d.id))), {
|
|
611
605
|
clear: s,
|
|
612
606
|
clickSelect: a,
|
|
613
607
|
get selected() {
|
|
@@ -633,8 +627,8 @@ const Vn = (e, t) => {
|
|
|
633
627
|
return e.bodies.filter((o) => !n.has(o.id));
|
|
634
628
|
}, zn = (e, t) => t.bodies.map((n) => {
|
|
635
629
|
const o = e.bodies.find((i) => i.id === n.id);
|
|
636
|
-
return { newBody: n, oldBody: o && !
|
|
637
|
-
}).filter(({ oldBody: n }) => n).map(({ oldBody: n, newBody: o }) => ({ oldBody: n, newBody: o })), Hn = (e, t) => !
|
|
630
|
+
return { newBody: n, oldBody: o && !de(o, n) ? o : void 0 };
|
|
631
|
+
}).filter(({ oldBody: n }) => n).map(({ oldBody: n, newBody: o }) => ({ oldBody: n, newBody: o })), Hn = (e, t) => !de(e.target, t.target), Wt = (e, t) => {
|
|
638
632
|
const n = Vn(e, t), o = Gn(e, t), i = zn(e, t);
|
|
639
633
|
return {
|
|
640
634
|
oldValue: e,
|
|
@@ -645,7 +639,7 @@ const Vn = (e, t) => {
|
|
|
645
639
|
targetUpdated: Hn(e, t) ? { oldTarget: e.target, newTarget: t.target } : void 0
|
|
646
640
|
};
|
|
647
641
|
};
|
|
648
|
-
var
|
|
642
|
+
var z = /* @__PURE__ */ ((e) => (e.LOCAL = "LOCAL", e.REMOTE = "REMOTE", e))(z || {});
|
|
649
643
|
const Fn = (e, t) => {
|
|
650
644
|
var n, o;
|
|
651
645
|
const { changes: i, origin: s } = t;
|
|
@@ -670,17 +664,17 @@ const Fn = (e, t) => {
|
|
|
670
664
|
return !0;
|
|
671
665
|
}, jn = (e, t) => {
|
|
672
666
|
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 = [
|
|
673
|
-
...(e.created || []).filter((f) => !s.has(f.id)).map((f) => r.has(f.id) ? t.updated.find(({ oldValue:
|
|
667
|
+
...(e.created || []).filter((f) => !s.has(f.id)).map((f) => r.has(f.id) ? t.updated.find(({ oldValue: d }) => d.id === f.id).newValue : f),
|
|
674
668
|
...t.created || []
|
|
675
669
|
], c = [
|
|
676
670
|
...(e.deleted || []).filter((f) => !i.has(f.id)),
|
|
677
671
|
...(t.deleted || []).filter((f) => !n.has(f.id))
|
|
678
672
|
], u = [
|
|
679
673
|
...(e.updated || []).filter(({ newValue: f }) => !s.has(f.id)).map((f) => {
|
|
680
|
-
const { oldValue:
|
|
674
|
+
const { oldValue: d, newValue: g } = f;
|
|
681
675
|
if (r.has(g.id)) {
|
|
682
|
-
const m = t.updated.find((
|
|
683
|
-
return Wt(
|
|
676
|
+
const m = t.updated.find((y) => y.oldValue.id === g.id).newValue;
|
|
677
|
+
return Wt(d, m);
|
|
684
678
|
} else
|
|
685
679
|
return f;
|
|
686
680
|
}),
|
|
@@ -688,188 +682,188 @@ const Fn = (e, t) => {
|
|
|
688
682
|
];
|
|
689
683
|
return { created: a, deleted: c, updated: u };
|
|
690
684
|
}, qn = (e) => e.id !== void 0, Kn = () => {
|
|
691
|
-
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = [], o = (
|
|
692
|
-
const
|
|
693
|
-
|
|
694
|
-
}, s = (
|
|
695
|
-
const
|
|
696
|
-
origin:
|
|
685
|
+
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = [], o = (_, b = {}) => n.push({ onChange: _, options: b }), i = (_) => {
|
|
686
|
+
const b = n.findIndex((T) => T.onChange == _);
|
|
687
|
+
b > -1 && n.splice(b, 1);
|
|
688
|
+
}, s = (_, b) => {
|
|
689
|
+
const T = {
|
|
690
|
+
origin: _,
|
|
697
691
|
changes: {
|
|
698
|
-
created:
|
|
699
|
-
updated:
|
|
700
|
-
deleted:
|
|
692
|
+
created: b.created || [],
|
|
693
|
+
updated: b.updated || [],
|
|
694
|
+
deleted: b.deleted || []
|
|
701
695
|
},
|
|
702
696
|
state: [...e.values()]
|
|
703
697
|
};
|
|
704
698
|
n.forEach((M) => {
|
|
705
|
-
Fn(M,
|
|
699
|
+
Fn(M, T) && M.onChange(T);
|
|
706
700
|
});
|
|
707
|
-
}, r = (
|
|
708
|
-
if (e.get(
|
|
709
|
-
throw Error(`Cannot add annotation ${
|
|
710
|
-
e.set(
|
|
711
|
-
}, l = (
|
|
712
|
-
const
|
|
713
|
-
if (
|
|
714
|
-
const
|
|
715
|
-
return M ===
|
|
701
|
+
}, r = (_, b = z.LOCAL) => {
|
|
702
|
+
if (e.get(_.id))
|
|
703
|
+
throw Error(`Cannot add annotation ${_.id} - exists already`);
|
|
704
|
+
e.set(_.id, _), _.bodies.forEach((T) => t.set(T.id, _.id)), s(b, { created: [_] });
|
|
705
|
+
}, l = (_, b) => {
|
|
706
|
+
const T = typeof _ == "string" ? b : _, M = typeof _ == "string" ? _ : _.id, O = e.get(M);
|
|
707
|
+
if (O) {
|
|
708
|
+
const Y = Wt(O, T);
|
|
709
|
+
return M === T.id ? e.set(M, T) : (e.delete(M), e.set(T.id, T)), O.bodies.forEach((Z) => t.delete(Z.id)), T.bodies.forEach((Z) => t.set(Z.id, T.id)), Y;
|
|
716
710
|
} else
|
|
717
711
|
console.warn(`Cannot update annotation ${M} - does not exist`);
|
|
718
|
-
}, a = (
|
|
719
|
-
const M = qn(
|
|
720
|
-
|
|
721
|
-
}, c = (
|
|
722
|
-
const
|
|
723
|
-
const
|
|
724
|
-
return
|
|
712
|
+
}, a = (_, b = z.LOCAL, T = z.LOCAL) => {
|
|
713
|
+
const M = qn(b) ? T : b, O = l(_, b);
|
|
714
|
+
O && s(M, { updated: [O] });
|
|
715
|
+
}, c = (_, b = z.LOCAL) => {
|
|
716
|
+
const T = _.reduce((M, O) => {
|
|
717
|
+
const Y = l(O);
|
|
718
|
+
return Y ? [...M, Y] : M;
|
|
725
719
|
}, []);
|
|
726
|
-
|
|
727
|
-
}, u = (
|
|
728
|
-
const
|
|
729
|
-
if (
|
|
720
|
+
T.length > 0 && s(b, { updated: T });
|
|
721
|
+
}, u = (_, b = z.LOCAL) => {
|
|
722
|
+
const T = e.get(_.annotation);
|
|
723
|
+
if (T) {
|
|
730
724
|
const M = {
|
|
731
|
-
...
|
|
732
|
-
bodies: [...
|
|
725
|
+
...T,
|
|
726
|
+
bodies: [...T.bodies, _]
|
|
733
727
|
};
|
|
734
|
-
e.set(
|
|
735
|
-
oldValue:
|
|
728
|
+
e.set(T.id, M), t.set(_.id, M.id), s(b, { updated: [{
|
|
729
|
+
oldValue: T,
|
|
736
730
|
newValue: M,
|
|
737
|
-
bodiesCreated: [
|
|
731
|
+
bodiesCreated: [_]
|
|
738
732
|
}] });
|
|
739
733
|
} else
|
|
740
|
-
console.warn(`Attempt to add body to missing annotation: ${
|
|
741
|
-
}, f = () => [...e.values()],
|
|
742
|
-
const
|
|
743
|
-
e.clear(), t.clear(), s(
|
|
744
|
-
}, g = (
|
|
745
|
-
if (
|
|
734
|
+
console.warn(`Attempt to add body to missing annotation: ${_.annotation}`);
|
|
735
|
+
}, f = () => [...e.values()], d = (_ = z.LOCAL) => {
|
|
736
|
+
const b = [...e.values()];
|
|
737
|
+
e.clear(), t.clear(), s(_, { deleted: b });
|
|
738
|
+
}, g = (_, b = !0, T = z.LOCAL) => {
|
|
739
|
+
if (b) {
|
|
746
740
|
const M = [...e.values()];
|
|
747
|
-
e.clear(), t.clear(),
|
|
748
|
-
e.set(
|
|
749
|
-
}), s(
|
|
741
|
+
e.clear(), t.clear(), _.forEach((O) => {
|
|
742
|
+
e.set(O.id, O), O.bodies.forEach((Y) => t.set(Y.id, O.id));
|
|
743
|
+
}), s(T, { created: _, deleted: M });
|
|
750
744
|
} else {
|
|
751
|
-
const M =
|
|
752
|
-
const Z = e.get(
|
|
753
|
-
return Z ? [...
|
|
745
|
+
const M = _.reduce((O, Y) => {
|
|
746
|
+
const Z = e.get(Y.id);
|
|
747
|
+
return Z ? [...O, Z] : O;
|
|
754
748
|
}, []);
|
|
755
749
|
if (M.length > 0)
|
|
756
|
-
throw Error(`Bulk insert would overwrite the following annotations: ${M.map((
|
|
757
|
-
|
|
758
|
-
e.set(
|
|
759
|
-
}), s(
|
|
750
|
+
throw Error(`Bulk insert would overwrite the following annotations: ${M.map((O) => O.id).join(", ")}`);
|
|
751
|
+
_.forEach((O) => {
|
|
752
|
+
e.set(O.id, O), O.bodies.forEach((Y) => t.set(Y.id, O.id));
|
|
753
|
+
}), s(T, { created: _ });
|
|
760
754
|
}
|
|
761
|
-
}, m = (
|
|
762
|
-
const
|
|
763
|
-
if (
|
|
764
|
-
return e.delete(
|
|
765
|
-
console.warn(`Attempt to delete missing annotation: ${
|
|
766
|
-
},
|
|
767
|
-
const
|
|
768
|
-
|
|
769
|
-
},
|
|
770
|
-
const
|
|
771
|
-
const
|
|
772
|
-
return
|
|
755
|
+
}, m = (_) => {
|
|
756
|
+
const b = typeof _ == "string" ? _ : _.id, T = e.get(b);
|
|
757
|
+
if (T)
|
|
758
|
+
return e.delete(b), T.bodies.forEach((M) => t.delete(M.id)), T;
|
|
759
|
+
console.warn(`Attempt to delete missing annotation: ${b}`);
|
|
760
|
+
}, y = (_, b = z.LOCAL) => {
|
|
761
|
+
const T = m(_);
|
|
762
|
+
T && s(b, { deleted: [T] });
|
|
763
|
+
}, E = (_, b = z.LOCAL) => {
|
|
764
|
+
const T = _.reduce((M, O) => {
|
|
765
|
+
const Y = m(O);
|
|
766
|
+
return Y ? [...M, Y] : M;
|
|
773
767
|
}, []);
|
|
774
|
-
|
|
775
|
-
},
|
|
776
|
-
const
|
|
777
|
-
if (
|
|
778
|
-
const M =
|
|
768
|
+
T.length > 0 && s(b, { deleted: T });
|
|
769
|
+
}, p = (_, b = z.LOCAL) => {
|
|
770
|
+
const T = e.get(_.annotation);
|
|
771
|
+
if (T) {
|
|
772
|
+
const M = T.bodies.find((O) => O.id === _.id);
|
|
779
773
|
if (M) {
|
|
780
774
|
t.delete(M.id);
|
|
781
|
-
const
|
|
782
|
-
...
|
|
783
|
-
bodies:
|
|
775
|
+
const O = {
|
|
776
|
+
...T,
|
|
777
|
+
bodies: T.bodies.filter((Y) => Y.id !== _.id)
|
|
784
778
|
};
|
|
785
|
-
e.set(
|
|
786
|
-
oldValue:
|
|
787
|
-
newValue:
|
|
779
|
+
e.set(T.id, O), s(b, { updated: [{
|
|
780
|
+
oldValue: T,
|
|
781
|
+
newValue: O,
|
|
788
782
|
bodiesDeleted: [M]
|
|
789
783
|
}] });
|
|
790
784
|
} else
|
|
791
|
-
console.warn(`Attempt to delete missing body ${
|
|
785
|
+
console.warn(`Attempt to delete missing body ${_.id} from annotation ${_.annotation}`);
|
|
792
786
|
} else
|
|
793
|
-
console.warn(`Attempt to delete body from missing annotation ${
|
|
794
|
-
},
|
|
795
|
-
const
|
|
796
|
-
return
|
|
797
|
-
}, w = (
|
|
798
|
-
const
|
|
799
|
-
if (
|
|
800
|
-
const
|
|
801
|
-
if (
|
|
802
|
-
return
|
|
803
|
-
console.error(`Store integrity error: body ${
|
|
787
|
+
console.warn(`Attempt to delete body from missing annotation ${_.annotation}`);
|
|
788
|
+
}, S = (_) => {
|
|
789
|
+
const b = e.get(_);
|
|
790
|
+
return b ? { ...b } : void 0;
|
|
791
|
+
}, w = (_) => {
|
|
792
|
+
const b = t.get(_);
|
|
793
|
+
if (b) {
|
|
794
|
+
const T = S(b).bodies.find((M) => M.id === _);
|
|
795
|
+
if (T)
|
|
796
|
+
return T;
|
|
797
|
+
console.error(`Store integrity error: body ${_} in index, but not in annotation`);
|
|
804
798
|
} else
|
|
805
|
-
console.warn(`Attempt to retrieve missing body: ${
|
|
806
|
-
},
|
|
807
|
-
if (
|
|
799
|
+
console.warn(`Attempt to retrieve missing body: ${_}`);
|
|
800
|
+
}, A = (_, b) => {
|
|
801
|
+
if (_.annotation !== b.annotation)
|
|
808
802
|
throw "Annotation integrity violation: annotation ID must be the same when updating bodies";
|
|
809
|
-
const
|
|
810
|
-
if (
|
|
811
|
-
const M =
|
|
812
|
-
...
|
|
813
|
-
bodies:
|
|
803
|
+
const T = e.get(_.annotation);
|
|
804
|
+
if (T) {
|
|
805
|
+
const M = T.bodies.find((Y) => Y.id === _.id), O = {
|
|
806
|
+
...T,
|
|
807
|
+
bodies: T.bodies.map((Y) => Y.id === M.id ? b : Y)
|
|
814
808
|
};
|
|
815
|
-
return e.set(
|
|
816
|
-
oldValue:
|
|
817
|
-
newValue:
|
|
818
|
-
bodiesUpdated: [{ oldBody: M, newBody:
|
|
809
|
+
return e.set(T.id, O), M.id !== b.id && (t.delete(M.id), t.set(b.id, O.id)), {
|
|
810
|
+
oldValue: T,
|
|
811
|
+
newValue: O,
|
|
812
|
+
bodiesUpdated: [{ oldBody: M, newBody: b }]
|
|
819
813
|
};
|
|
820
814
|
} else
|
|
821
|
-
console.warn(`Attempt to add body to missing annotation ${
|
|
822
|
-
},
|
|
823
|
-
const M =
|
|
824
|
-
M && s(
|
|
825
|
-
},
|
|
826
|
-
const
|
|
827
|
-
s(
|
|
828
|
-
},
|
|
829
|
-
const
|
|
830
|
-
if (
|
|
831
|
-
const
|
|
832
|
-
...
|
|
815
|
+
console.warn(`Attempt to add body to missing annotation ${_.annotation}`);
|
|
816
|
+
}, I = (_, b, T = z.LOCAL) => {
|
|
817
|
+
const M = A(_, b);
|
|
818
|
+
M && s(T, { updated: [M] });
|
|
819
|
+
}, N = (_, b = z.LOCAL) => {
|
|
820
|
+
const T = _.map((M) => A({ id: M.id, annotation: M.annotation }, M)).filter(Boolean);
|
|
821
|
+
s(b, { updated: T });
|
|
822
|
+
}, U = (_) => {
|
|
823
|
+
const b = e.get(_.annotation);
|
|
824
|
+
if (b) {
|
|
825
|
+
const T = {
|
|
826
|
+
...b,
|
|
833
827
|
target: {
|
|
834
|
-
...
|
|
835
|
-
...
|
|
828
|
+
...b.target,
|
|
829
|
+
..._
|
|
836
830
|
}
|
|
837
831
|
};
|
|
838
|
-
return e.set(
|
|
839
|
-
oldValue:
|
|
840
|
-
newValue:
|
|
832
|
+
return e.set(b.id, T), {
|
|
833
|
+
oldValue: b,
|
|
834
|
+
newValue: T,
|
|
841
835
|
targetUpdated: {
|
|
842
|
-
oldTarget:
|
|
843
|
-
newTarget:
|
|
836
|
+
oldTarget: b.target,
|
|
837
|
+
newTarget: _
|
|
844
838
|
}
|
|
845
839
|
};
|
|
846
840
|
} else
|
|
847
|
-
console.warn(`Attempt to update target on missing annotation: ${
|
|
841
|
+
console.warn(`Attempt to update target on missing annotation: ${_.annotation}`);
|
|
848
842
|
};
|
|
849
843
|
return {
|
|
850
844
|
addAnnotation: r,
|
|
851
845
|
addBody: u,
|
|
852
846
|
all: f,
|
|
853
847
|
bulkAddAnnotation: g,
|
|
854
|
-
bulkDeleteAnnotation:
|
|
848
|
+
bulkDeleteAnnotation: E,
|
|
855
849
|
bulkUpdateAnnotation: c,
|
|
856
|
-
bulkUpdateBodies:
|
|
857
|
-
bulkUpdateTargets: (
|
|
858
|
-
const
|
|
859
|
-
|
|
860
|
-
},
|
|
861
|
-
clear:
|
|
862
|
-
deleteAnnotation:
|
|
863
|
-
deleteBody:
|
|
864
|
-
getAnnotation:
|
|
850
|
+
bulkUpdateBodies: N,
|
|
851
|
+
bulkUpdateTargets: (_, b = z.LOCAL) => {
|
|
852
|
+
const T = _.map((M) => U(M)).filter(Boolean);
|
|
853
|
+
T.length > 0 && s(b, { updated: T });
|
|
854
|
+
},
|
|
855
|
+
clear: d,
|
|
856
|
+
deleteAnnotation: y,
|
|
857
|
+
deleteBody: p,
|
|
858
|
+
getAnnotation: S,
|
|
865
859
|
getBody: w,
|
|
866
860
|
observe: o,
|
|
867
861
|
unobserve: i,
|
|
868
862
|
updateAnnotation: a,
|
|
869
|
-
updateBody:
|
|
870
|
-
updateTarget: (
|
|
871
|
-
const
|
|
872
|
-
|
|
863
|
+
updateBody: I,
|
|
864
|
+
updateTarget: (_, b = z.LOCAL) => {
|
|
865
|
+
const T = U(_);
|
|
866
|
+
T && s(b, { updated: [T] });
|
|
873
867
|
}
|
|
874
868
|
};
|
|
875
869
|
}, Wn = (e) => ({
|
|
@@ -898,19 +892,19 @@ const Zn = 250, Qn = (e) => {
|
|
|
898
892
|
let o = -1, i = !1, s = 0;
|
|
899
893
|
const r = (g) => {
|
|
900
894
|
if (!i) {
|
|
901
|
-
const { changes: m } = g,
|
|
902
|
-
if (
|
|
895
|
+
const { changes: m } = g, y = performance.now();
|
|
896
|
+
if (y - s > Zn)
|
|
903
897
|
n.splice(o + 1), n.push(m), o = n.length - 1;
|
|
904
898
|
else {
|
|
905
|
-
const
|
|
906
|
-
n[
|
|
899
|
+
const E = n.length - 1;
|
|
900
|
+
n[E] = jn(n[E], m);
|
|
907
901
|
}
|
|
908
|
-
s =
|
|
902
|
+
s = y;
|
|
909
903
|
}
|
|
910
904
|
i = !1;
|
|
911
905
|
};
|
|
912
|
-
e.observe(r, { origin:
|
|
913
|
-
const l = (g) => g && g.length > 0 && e.bulkDeleteAnnotation(g), a = (g) => g && g.length > 0 && e.bulkAddAnnotation(g, !1), c = (g) => g && g.length > 0 && e.bulkUpdateAnnotation(g.map(({ oldValue: m }) => m)), u = (g) => g && g.length > 0 && e.bulkUpdateAnnotation(g.map(({ newValue: m }) => m)), f = (g) => g && g.length > 0 && e.bulkAddAnnotation(g, !1),
|
|
906
|
+
e.observe(r, { origin: z.LOCAL });
|
|
907
|
+
const l = (g) => g && g.length > 0 && e.bulkDeleteAnnotation(g), a = (g) => g && g.length > 0 && e.bulkAddAnnotation(g, !1), c = (g) => g && g.length > 0 && e.bulkUpdateAnnotation(g.map(({ oldValue: m }) => m)), u = (g) => g && g.length > 0 && e.bulkUpdateAnnotation(g.map(({ newValue: m }) => m)), f = (g) => g && g.length > 0 && e.bulkAddAnnotation(g, !1), d = (g) => g && g.length > 0 && e.bulkDeleteAnnotation(g);
|
|
914
908
|
return {
|
|
915
909
|
canRedo: () => n.length - 1 > o,
|
|
916
910
|
canUndo: () => o > -1,
|
|
@@ -919,15 +913,15 @@ const Zn = 250, Qn = (e) => {
|
|
|
919
913
|
redo: () => {
|
|
920
914
|
if (n.length - 1 > o) {
|
|
921
915
|
i = !0;
|
|
922
|
-
const { created: g, updated: m, deleted:
|
|
923
|
-
a(g), u(m),
|
|
916
|
+
const { created: g, updated: m, deleted: y } = n[o + 1];
|
|
917
|
+
a(g), u(m), d(y), t.emit("redo", n[o + 1]), o += 1;
|
|
924
918
|
}
|
|
925
919
|
},
|
|
926
920
|
undo: () => {
|
|
927
921
|
if (o > -1) {
|
|
928
922
|
i = !0;
|
|
929
|
-
const { created: g, updated: m, deleted:
|
|
930
|
-
l(g), c(m), f(
|
|
923
|
+
const { created: g, updated: m, deleted: y } = n[o];
|
|
924
|
+
l(g), c(m), f(y), t.emit("undo", n[o]), o -= 1;
|
|
931
925
|
}
|
|
932
926
|
}
|
|
933
927
|
};
|
|
@@ -940,75 +934,75 @@ const Zn = 250, Qn = (e) => {
|
|
|
940
934
|
}, $n = (e, t, n, o) => {
|
|
941
935
|
const { store: i, selection: s, hover: r, viewport: l } = e, a = /* @__PURE__ */ new Map();
|
|
942
936
|
let c = [], u, f;
|
|
943
|
-
const
|
|
944
|
-
a.has(
|
|
945
|
-
}, g = (
|
|
946
|
-
const w = a.get(
|
|
947
|
-
w && w.indexOf(
|
|
948
|
-
}, m = (
|
|
949
|
-
a.has(
|
|
950
|
-
a.get(
|
|
937
|
+
const d = (p, S) => {
|
|
938
|
+
a.has(p) ? a.get(p).push(S) : a.set(p, [S]);
|
|
939
|
+
}, g = (p, S) => {
|
|
940
|
+
const w = a.get(p);
|
|
941
|
+
w && w.indexOf(S) > 0 && w.splice(w.indexOf(S), 1);
|
|
942
|
+
}, m = (p, S, w) => {
|
|
943
|
+
a.has(p) && setTimeout(() => {
|
|
944
|
+
a.get(p).forEach((A) => {
|
|
951
945
|
if (n) {
|
|
952
|
-
const
|
|
953
|
-
|
|
946
|
+
const I = Array.isArray(S) ? S.map((U) => n.serialize(U)) : n.serialize(S), N = w ? w instanceof PointerEvent ? w : n.serialize(w) : void 0;
|
|
947
|
+
A(I, N);
|
|
954
948
|
} else
|
|
955
|
-
|
|
949
|
+
A(S, w);
|
|
956
950
|
});
|
|
957
951
|
}, 1);
|
|
958
|
-
},
|
|
959
|
-
const { selected:
|
|
960
|
-
|
|
961
|
-
const
|
|
962
|
-
(!
|
|
963
|
-
}), c = c.map((w) =>
|
|
952
|
+
}, y = () => {
|
|
953
|
+
const { selected: p } = s, S = (p || []).map(({ id: w }) => i.getAnnotation(w));
|
|
954
|
+
S.forEach((w) => {
|
|
955
|
+
const A = c.find((I) => I.id === w.id);
|
|
956
|
+
(!A || !de(A, w)) && m("updateAnnotation", w, A);
|
|
957
|
+
}), c = c.map((w) => S.find(({ id: I }) => I === w.id) || w);
|
|
964
958
|
};
|
|
965
|
-
s.subscribe(({ selected:
|
|
966
|
-
if (!(c.length === 0 &&
|
|
967
|
-
if (c.length === 0 &&
|
|
968
|
-
c =
|
|
969
|
-
else if (c.length > 0 &&
|
|
970
|
-
c.forEach((
|
|
971
|
-
const w = i.getAnnotation(
|
|
972
|
-
w && !
|
|
959
|
+
s.subscribe(({ selected: p }) => {
|
|
960
|
+
if (!(c.length === 0 && p.length === 0)) {
|
|
961
|
+
if (c.length === 0 && p.length > 0)
|
|
962
|
+
c = p.map(({ id: S }) => i.getAnnotation(S));
|
|
963
|
+
else if (c.length > 0 && p.length === 0)
|
|
964
|
+
c.forEach((S) => {
|
|
965
|
+
const w = i.getAnnotation(S.id);
|
|
966
|
+
w && !de(w, S) && m("updateAnnotation", w, S);
|
|
973
967
|
}), c = [];
|
|
974
968
|
else {
|
|
975
|
-
const
|
|
976
|
-
c.filter((
|
|
977
|
-
const
|
|
978
|
-
|
|
969
|
+
const S = new Set(c.map((A) => A.id)), w = new Set(p.map(({ id: A }) => A));
|
|
970
|
+
c.filter((A) => !w.has(A.id)).forEach((A) => {
|
|
971
|
+
const I = i.getAnnotation(A.id);
|
|
972
|
+
I && !de(I, A) && m("updateAnnotation", I, A);
|
|
979
973
|
}), c = [
|
|
980
974
|
// Remove annotations that were deselected
|
|
981
|
-
...c.filter((
|
|
975
|
+
...c.filter((A) => w.has(A.id)),
|
|
982
976
|
// Add editable annotations that were selected
|
|
983
|
-
...
|
|
977
|
+
...p.filter(({ id: A }) => !S.has(A)).map(({ id: A }) => i.getAnnotation(A))
|
|
984
978
|
];
|
|
985
979
|
}
|
|
986
980
|
m("selectionChanged", c);
|
|
987
981
|
}
|
|
988
|
-
}), r.subscribe((
|
|
989
|
-
!u &&
|
|
990
|
-
}), l == null || l.subscribe((
|
|
991
|
-
o && (f && clearTimeout(f), f = setTimeout(
|
|
992
|
-
const { created:
|
|
993
|
-
(
|
|
994
|
-
...
|
|
995
|
-
...
|
|
996
|
-
...
|
|
997
|
-
].length > 0).forEach(({ oldValue:
|
|
998
|
-
const
|
|
999
|
-
c = c.map((
|
|
982
|
+
}), r.subscribe((p) => {
|
|
983
|
+
!u && p ? m("mouseEnterAnnotation", i.getAnnotation(p)) : u && !p ? m("mouseLeaveAnnotation", i.getAnnotation(u)) : u && p && (m("mouseLeaveAnnotation", i.getAnnotation(u)), m("mouseEnterAnnotation", i.getAnnotation(p))), u = p;
|
|
984
|
+
}), l == null || l.subscribe((p) => m("viewportIntersect", p.map((S) => i.getAnnotation(S)))), i.observe((p) => {
|
|
985
|
+
o && (f && clearTimeout(f), f = setTimeout(y, 1e3));
|
|
986
|
+
const { created: S, deleted: w } = p.changes;
|
|
987
|
+
(S || []).forEach((A) => m("createAnnotation", A)), (w || []).forEach((A) => m("deleteAnnotation", A)), (p.changes.updated || []).filter((A) => [
|
|
988
|
+
...A.bodiesCreated || [],
|
|
989
|
+
...A.bodiesDeleted || [],
|
|
990
|
+
...A.bodiesUpdated || []
|
|
991
|
+
].length > 0).forEach(({ oldValue: A, newValue: I }) => {
|
|
992
|
+
const N = c.find((U) => U.id === A.id) || A;
|
|
993
|
+
c = c.map((U) => U.id === A.id ? I : U), m("updateAnnotation", I, N);
|
|
1000
994
|
});
|
|
1001
|
-
}, { origin:
|
|
995
|
+
}, { origin: z.LOCAL }), i.observe((p) => {
|
|
1002
996
|
if (c) {
|
|
1003
|
-
const
|
|
1004
|
-
w.length > 0 && (c = c.map((
|
|
997
|
+
const S = new Set(c.map((A) => A.id)), w = (p.changes.updated || []).filter(({ newValue: A }) => S.has(A.id)).map(({ newValue: A }) => A);
|
|
998
|
+
w.length > 0 && (c = c.map((A) => w.find((N) => N.id === A.id) || A));
|
|
1005
999
|
}
|
|
1006
|
-
}, { origin:
|
|
1007
|
-
const
|
|
1008
|
-
const { updated: w } =
|
|
1009
|
-
|
|
1000
|
+
}, { origin: z.REMOTE });
|
|
1001
|
+
const E = (p) => (S) => {
|
|
1002
|
+
const { updated: w } = S;
|
|
1003
|
+
p ? (w || []).forEach((A) => m("updateAnnotation", A.oldValue, A.newValue)) : (w || []).forEach((A) => m("updateAnnotation", A.newValue, A.oldValue));
|
|
1010
1004
|
};
|
|
1011
|
-
return t.on("undo",
|
|
1005
|
+
return t.on("undo", E(!0)), t.on("redo", E(!1)), { on: d, off: g, emit: m };
|
|
1012
1006
|
}, eo = (e) => (t) => t.reduce((n, o) => {
|
|
1013
1007
|
const { parsed: i, error: s } = e.parse(o);
|
|
1014
1008
|
return s ? {
|
|
@@ -1021,44 +1015,44 @@ const Zn = 250, Qn = (e) => {
|
|
|
1021
1015
|
...n
|
|
1022
1016
|
};
|
|
1023
1017
|
}, { parsed: [], failed: [] }), to = (e, t, n) => {
|
|
1024
|
-
const { store: o, selection: i } = e, s = (
|
|
1018
|
+
const { store: o, selection: i } = e, s = (E) => {
|
|
1025
1019
|
if (n) {
|
|
1026
|
-
const { parsed:
|
|
1027
|
-
|
|
1020
|
+
const { parsed: p, error: S } = n.parse(E);
|
|
1021
|
+
p ? o.addAnnotation(p, z.REMOTE) : console.error(S);
|
|
1028
1022
|
} else
|
|
1029
|
-
o.addAnnotation(
|
|
1030
|
-
}, r = () => i.clear(), l = () => o.clear(), a = (
|
|
1031
|
-
const
|
|
1032
|
-
return n &&
|
|
1023
|
+
o.addAnnotation(E, z.REMOTE);
|
|
1024
|
+
}, r = () => i.clear(), l = () => o.clear(), a = (E) => {
|
|
1025
|
+
const p = o.getAnnotation(E);
|
|
1026
|
+
return n && p ? n.serialize(p) : p;
|
|
1033
1027
|
}, c = () => n ? o.all().map(n.serialize) : o.all(), u = () => {
|
|
1034
|
-
var
|
|
1035
|
-
const
|
|
1036
|
-
return n ?
|
|
1037
|
-
}, f = (
|
|
1038
|
-
if (typeof
|
|
1039
|
-
const
|
|
1040
|
-
if (o.deleteAnnotation(
|
|
1041
|
-
return n ? n.serialize(
|
|
1028
|
+
var E;
|
|
1029
|
+
const p = (((E = i.selected) == null ? void 0 : E.map((S) => S.id)) || []).map((S) => o.getAnnotation(S)).filter(Boolean);
|
|
1030
|
+
return n ? p.map(n.serialize) : p;
|
|
1031
|
+
}, f = (E, p = !0) => fetch(E).then((S) => S.json()).then((S) => (g(S, p), S)), d = (E) => {
|
|
1032
|
+
if (typeof E == "string") {
|
|
1033
|
+
const p = o.getAnnotation(E);
|
|
1034
|
+
if (o.deleteAnnotation(E), p)
|
|
1035
|
+
return n ? n.serialize(p) : p;
|
|
1042
1036
|
} else {
|
|
1043
|
-
const
|
|
1044
|
-
if (
|
|
1045
|
-
return o.deleteAnnotation(
|
|
1037
|
+
const p = n ? n.parse(E).parsed : E;
|
|
1038
|
+
if (p)
|
|
1039
|
+
return o.deleteAnnotation(p), E;
|
|
1046
1040
|
}
|
|
1047
|
-
}, g = (
|
|
1041
|
+
}, g = (E, p = !0) => {
|
|
1048
1042
|
if (n) {
|
|
1049
|
-
const { parsed:
|
|
1050
|
-
w.length > 0 && console.warn(`Discarded ${w.length} invalid annotations`, w), o.bulkAddAnnotation(
|
|
1043
|
+
const { parsed: S, failed: w } = eo(n)(E);
|
|
1044
|
+
w.length > 0 && console.warn(`Discarded ${w.length} invalid annotations`, w), o.bulkAddAnnotation(S, p, z.REMOTE);
|
|
1051
1045
|
} else
|
|
1052
|
-
o.bulkAddAnnotation(
|
|
1053
|
-
}, m = (
|
|
1054
|
-
|
|
1055
|
-
},
|
|
1046
|
+
o.bulkAddAnnotation(E, p, z.REMOTE);
|
|
1047
|
+
}, m = (E) => {
|
|
1048
|
+
E ? i.setSelected(E) : i.clear();
|
|
1049
|
+
}, y = (E) => {
|
|
1056
1050
|
if (n) {
|
|
1057
|
-
const
|
|
1058
|
-
return o.updateAnnotation(
|
|
1051
|
+
const p = n.parse(E).parsed, S = n.serialize(o.getAnnotation(p.id));
|
|
1052
|
+
return o.updateAnnotation(p), S;
|
|
1059
1053
|
} else {
|
|
1060
|
-
const
|
|
1061
|
-
return o.updateAnnotation(
|
|
1054
|
+
const p = o.getAnnotation(E.id);
|
|
1055
|
+
return o.updateAnnotation(E), p;
|
|
1062
1056
|
}
|
|
1063
1057
|
};
|
|
1064
1058
|
return {
|
|
@@ -1072,11 +1066,11 @@ const Zn = 250, Qn = (e) => {
|
|
|
1072
1066
|
getSelected: u,
|
|
1073
1067
|
loadAnnotations: f,
|
|
1074
1068
|
redo: t.redo,
|
|
1075
|
-
removeAnnotation:
|
|
1069
|
+
removeAnnotation: d,
|
|
1076
1070
|
setAnnotations: g,
|
|
1077
1071
|
setSelected: m,
|
|
1078
1072
|
undo: t.undo,
|
|
1079
|
-
updateAnnotation:
|
|
1073
|
+
updateAnnotation: y
|
|
1080
1074
|
};
|
|
1081
1075
|
}, no = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
1082
1076
|
let oo = (e) => crypto.getRandomValues(new Uint8Array(e)), io = (e, t, n) => {
|
|
@@ -1156,7 +1150,7 @@ const Yi = (e, t = !1) => ({ parse: (i) => uo(i, t), serialize: (i) => ho(i, e)
|
|
|
1156
1150
|
updatedBy: r,
|
|
1157
1151
|
// Excluded from serialization
|
|
1158
1152
|
...l
|
|
1159
|
-
} = e.target, a = n.type ==
|
|
1153
|
+
} = e.target, a = n.type == F.RECTANGLE ? Tn(n.geometry) : Bn(n), c = {
|
|
1160
1154
|
...e,
|
|
1161
1155
|
"@context": "http://www.w3.org/ns/anno.jsonld",
|
|
1162
1156
|
id: e.id,
|
|
@@ -1179,7 +1173,7 @@ function wt(e, t, n) {
|
|
|
1179
1173
|
}
|
|
1180
1174
|
function bt(e) {
|
|
1181
1175
|
let t, n;
|
|
1182
|
-
return t = new
|
|
1176
|
+
return t = new ke({
|
|
1183
1177
|
props: {
|
|
1184
1178
|
x: (
|
|
1185
1179
|
/*point*/
|
|
@@ -1195,7 +1189,7 @@ function bt(e) {
|
|
|
1195
1189
|
)
|
|
1196
1190
|
}
|
|
1197
1191
|
}), t.$on("pointerdown", function() {
|
|
1198
|
-
|
|
1192
|
+
j(
|
|
1199
1193
|
/*grab*/
|
|
1200
1194
|
e[9](`HANDLE-${/*idx*/
|
|
1201
1195
|
e[12]}`)
|
|
@@ -1231,93 +1225,93 @@ function bt(e) {
|
|
|
1231
1225
|
};
|
|
1232
1226
|
}
|
|
1233
1227
|
function go(e) {
|
|
1234
|
-
let t, n, o, i, s, r, l, a, c, u, f,
|
|
1228
|
+
let t, n, o, i, s, r, l, a, c, u, f, d = Se(
|
|
1235
1229
|
/*geom*/
|
|
1236
1230
|
e[4].points
|
|
1237
1231
|
), g = [];
|
|
1238
|
-
for (let
|
|
1239
|
-
g[
|
|
1240
|
-
const m = (
|
|
1241
|
-
g[
|
|
1232
|
+
for (let y = 0; y < d.length; y += 1)
|
|
1233
|
+
g[y] = bt(wt(e, d, y));
|
|
1234
|
+
const m = (y) => D(g[y], 1, 1, () => {
|
|
1235
|
+
g[y] = null;
|
|
1242
1236
|
});
|
|
1243
1237
|
return {
|
|
1244
1238
|
c() {
|
|
1245
|
-
t =
|
|
1246
|
-
for (let
|
|
1247
|
-
g[
|
|
1248
|
-
a =
|
|
1249
|
-
e[1] ? "display:none;" : void 0),
|
|
1250
|
-
e[4].points.map(Et).join(" ")),
|
|
1239
|
+
t = X("polygon"), i = ne(), s = X("polygon"), l = ne();
|
|
1240
|
+
for (let y = 0; y < g.length; y += 1)
|
|
1241
|
+
g[y].c();
|
|
1242
|
+
a = ae(), h(t, "class", "a9s-outer"), h(t, "style", n = /*computedStyle*/
|
|
1243
|
+
e[1] ? "display:none;" : void 0), h(t, "points", o = /*geom*/
|
|
1244
|
+
e[4].points.map(Et).join(" ")), h(s, "class", "a9s-inner a9s-shape-handle"), h(
|
|
1251
1245
|
s,
|
|
1252
1246
|
"style",
|
|
1253
1247
|
/*computedStyle*/
|
|
1254
1248
|
e[1]
|
|
1255
|
-
),
|
|
1249
|
+
), h(s, "points", r = /*geom*/
|
|
1256
1250
|
e[4].points.map(At).join(" "));
|
|
1257
1251
|
},
|
|
1258
|
-
m(
|
|
1259
|
-
|
|
1260
|
-
for (let
|
|
1261
|
-
g[
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1252
|
+
m(y, E) {
|
|
1253
|
+
B(y, t, E), B(y, i, E), B(y, s, E), B(y, l, E);
|
|
1254
|
+
for (let p = 0; p < g.length; p += 1)
|
|
1255
|
+
g[p] && g[p].m(y, E);
|
|
1256
|
+
B(y, a, E), c = !0, u || (f = [
|
|
1257
|
+
H(t, "pointerdown", function() {
|
|
1258
|
+
j(
|
|
1265
1259
|
/*grab*/
|
|
1266
1260
|
e[9]("SHAPE")
|
|
1267
1261
|
) && e[9]("SHAPE").apply(this, arguments);
|
|
1268
1262
|
}),
|
|
1269
|
-
|
|
1270
|
-
|
|
1263
|
+
H(s, "pointerdown", function() {
|
|
1264
|
+
j(
|
|
1271
1265
|
/*grab*/
|
|
1272
1266
|
e[9]("SHAPE")
|
|
1273
1267
|
) && e[9]("SHAPE").apply(this, arguments);
|
|
1274
1268
|
})
|
|
1275
1269
|
], u = !0);
|
|
1276
1270
|
},
|
|
1277
|
-
p(
|
|
1278
|
-
if (e =
|
|
1271
|
+
p(y, E) {
|
|
1272
|
+
if (e = y, (!c || E & /*computedStyle*/
|
|
1279
1273
|
2 && n !== (n = /*computedStyle*/
|
|
1280
|
-
e[1] ? "display:none;" : void 0)) &&
|
|
1274
|
+
e[1] ? "display:none;" : void 0)) && h(t, "style", n), (!c || E & /*geom*/
|
|
1281
1275
|
16 && o !== (o = /*geom*/
|
|
1282
|
-
e[4].points.map(Et).join(" "))) &&
|
|
1283
|
-
2) &&
|
|
1276
|
+
e[4].points.map(Et).join(" "))) && h(t, "points", o), (!c || E & /*computedStyle*/
|
|
1277
|
+
2) && h(
|
|
1284
1278
|
s,
|
|
1285
1279
|
"style",
|
|
1286
1280
|
/*computedStyle*/
|
|
1287
1281
|
e[1]
|
|
1288
|
-
), (!c ||
|
|
1282
|
+
), (!c || E & /*geom*/
|
|
1289
1283
|
16 && r !== (r = /*geom*/
|
|
1290
|
-
e[4].points.map(At).join(" "))) &&
|
|
1284
|
+
e[4].points.map(At).join(" "))) && h(s, "points", r), E & /*geom, viewportScale, grab*/
|
|
1291
1285
|
536) {
|
|
1292
|
-
|
|
1286
|
+
d = Se(
|
|
1293
1287
|
/*geom*/
|
|
1294
1288
|
e[4].points
|
|
1295
1289
|
);
|
|
1296
|
-
let
|
|
1297
|
-
for (
|
|
1298
|
-
const
|
|
1299
|
-
g[
|
|
1290
|
+
let p;
|
|
1291
|
+
for (p = 0; p < d.length; p += 1) {
|
|
1292
|
+
const S = wt(e, d, p);
|
|
1293
|
+
g[p] ? (g[p].p(S, E), P(g[p], 1)) : (g[p] = bt(S), g[p].c(), P(g[p], 1), g[p].m(a.parentNode, a));
|
|
1300
1294
|
}
|
|
1301
|
-
for (
|
|
1302
|
-
m(
|
|
1303
|
-
|
|
1295
|
+
for (se(), p = d.length; p < g.length; p += 1)
|
|
1296
|
+
m(p);
|
|
1297
|
+
re();
|
|
1304
1298
|
}
|
|
1305
1299
|
},
|
|
1306
|
-
i(
|
|
1300
|
+
i(y) {
|
|
1307
1301
|
if (!c) {
|
|
1308
|
-
for (let
|
|
1309
|
-
P(g[
|
|
1302
|
+
for (let E = 0; E < d.length; E += 1)
|
|
1303
|
+
P(g[E]);
|
|
1310
1304
|
c = !0;
|
|
1311
1305
|
}
|
|
1312
1306
|
},
|
|
1313
|
-
o(
|
|
1307
|
+
o(y) {
|
|
1314
1308
|
g = g.filter(Boolean);
|
|
1315
|
-
for (let
|
|
1316
|
-
D(g[
|
|
1309
|
+
for (let E = 0; E < g.length; E += 1)
|
|
1310
|
+
D(g[E]);
|
|
1317
1311
|
c = !1;
|
|
1318
1312
|
},
|
|
1319
|
-
d(
|
|
1320
|
-
|
|
1313
|
+
d(y) {
|
|
1314
|
+
y && (k(t), k(i), k(s), k(l), k(a)), rt(g, y), u = !1, le(f);
|
|
1321
1315
|
}
|
|
1322
1316
|
};
|
|
1323
1317
|
}
|
|
@@ -1388,24 +1382,24 @@ function mo(e) {
|
|
|
1388
1382
|
const Et = (e) => e.join(","), At = (e) => e.join(",");
|
|
1389
1383
|
function po(e, t, n) {
|
|
1390
1384
|
let o, { shape: i } = t, { computedStyle: s } = t, { transform: r } = t, { viewportScale: l = 1 } = t;
|
|
1391
|
-
const a = (
|
|
1392
|
-
let
|
|
1393
|
-
const
|
|
1394
|
-
g === "SHAPE" ?
|
|
1395
|
-
const
|
|
1396
|
-
return { ...
|
|
1385
|
+
const a = (d, g, m) => {
|
|
1386
|
+
let y;
|
|
1387
|
+
const E = d.geometry;
|
|
1388
|
+
g === "SHAPE" ? y = E.points.map(([S, w]) => [S + m[0], w + m[1]]) : y = E.points.map(([S, w], A) => g === `HANDLE-${A}` ? [S + m[0], w + m[1]] : [S, w]);
|
|
1389
|
+
const p = Fe(y);
|
|
1390
|
+
return { ...d, geometry: { points: y, bounds: p } };
|
|
1397
1391
|
};
|
|
1398
|
-
function c(
|
|
1399
|
-
|
|
1392
|
+
function c(d) {
|
|
1393
|
+
fe.call(this, e, d);
|
|
1400
1394
|
}
|
|
1401
|
-
function u(
|
|
1402
|
-
|
|
1395
|
+
function u(d) {
|
|
1396
|
+
fe.call(this, e, d);
|
|
1403
1397
|
}
|
|
1404
|
-
function f(
|
|
1405
|
-
|
|
1398
|
+
function f(d) {
|
|
1399
|
+
fe.call(this, e, d);
|
|
1406
1400
|
}
|
|
1407
|
-
return e.$$set = (
|
|
1408
|
-
"shape" in
|
|
1401
|
+
return e.$$set = (d) => {
|
|
1402
|
+
"shape" in d && n(0, i = d.shape), "computedStyle" in d && n(1, s = d.computedStyle), "transform" in d && n(2, r = d.transform), "viewportScale" in d && n(3, l = d.viewportScale);
|
|
1409
1403
|
}, e.$$.update = () => {
|
|
1410
1404
|
e.$$.dirty & /*shape*/
|
|
1411
1405
|
1 && n(4, o = i.geometry);
|
|
@@ -1423,7 +1417,7 @@ function po(e, t, n) {
|
|
|
1423
1417
|
}
|
|
1424
1418
|
class yo extends te {
|
|
1425
1419
|
constructor(t) {
|
|
1426
|
-
super(), ee(this, t, po, mo,
|
|
1420
|
+
super(), ee(this, t, po, mo, K, {
|
|
1427
1421
|
shape: 0,
|
|
1428
1422
|
computedStyle: 1,
|
|
1429
1423
|
transform: 2,
|
|
@@ -1434,28 +1428,28 @@ class yo extends te {
|
|
|
1434
1428
|
const Qe = (e, t) => {
|
|
1435
1429
|
const n = Math.abs(t[0] - e[0]), o = Math.abs(t[1] - e[1]);
|
|
1436
1430
|
return Math.sqrt(Math.pow(n, 2) + Math.pow(o, 2));
|
|
1437
|
-
},
|
|
1438
|
-
function _o(e, t =
|
|
1431
|
+
}, ye = [];
|
|
1432
|
+
function _o(e, t = G) {
|
|
1439
1433
|
let n;
|
|
1440
1434
|
const o = /* @__PURE__ */ new Set();
|
|
1441
1435
|
function i(l) {
|
|
1442
|
-
if (
|
|
1443
|
-
const a = !
|
|
1436
|
+
if (K(e, l) && (e = l, n)) {
|
|
1437
|
+
const a = !ye.length;
|
|
1444
1438
|
for (const c of o)
|
|
1445
|
-
c[1](),
|
|
1439
|
+
c[1](), ye.push(c, e);
|
|
1446
1440
|
if (a) {
|
|
1447
|
-
for (let c = 0; c <
|
|
1448
|
-
|
|
1449
|
-
|
|
1441
|
+
for (let c = 0; c < ye.length; c += 2)
|
|
1442
|
+
ye[c][0](ye[c + 1]);
|
|
1443
|
+
ye.length = 0;
|
|
1450
1444
|
}
|
|
1451
1445
|
}
|
|
1452
1446
|
}
|
|
1453
1447
|
function s(l) {
|
|
1454
1448
|
i(l(e));
|
|
1455
1449
|
}
|
|
1456
|
-
function r(l, a =
|
|
1450
|
+
function r(l, a = G) {
|
|
1457
1451
|
const c = [l, a];
|
|
1458
|
-
return o.add(c), o.size === 1 && (n = t(i, s) ||
|
|
1452
|
+
return o.add(c), o.size === 1 && (n = t(i, s) || G), l(e), () => {
|
|
1459
1453
|
o.delete(c), o.size === 0 && n && (n(), n = null);
|
|
1460
1454
|
};
|
|
1461
1455
|
}
|
|
@@ -1489,17 +1483,17 @@ function Ao(e) {
|
|
|
1489
1483
|
let t, n, o, i, s, r;
|
|
1490
1484
|
return {
|
|
1491
1485
|
c() {
|
|
1492
|
-
t =
|
|
1493
|
-
e[8].class || ""}`.trim()) + " svelte-1sgkh33"),
|
|
1486
|
+
t = X("rect"), h(t, "class", n = ze(`a9s-handle ${/*$$props*/
|
|
1487
|
+
e[8].class || ""}`.trim()) + " svelte-1sgkh33"), h(t, "x", o = /*x*/
|
|
1494
1488
|
e[0] - /*handleSize*/
|
|
1495
|
-
e[5] / 2),
|
|
1489
|
+
e[5] / 2), h(t, "y", i = /*y*/
|
|
1496
1490
|
e[1] - /*handleSize*/
|
|
1497
|
-
e[5] / 2),
|
|
1491
|
+
e[5] / 2), h(
|
|
1498
1492
|
t,
|
|
1499
1493
|
"width",
|
|
1500
1494
|
/*handleSize*/
|
|
1501
1495
|
e[5]
|
|
1502
|
-
),
|
|
1496
|
+
), h(
|
|
1503
1497
|
t,
|
|
1504
1498
|
"height",
|
|
1505
1499
|
/*handleSize*/
|
|
@@ -1507,7 +1501,7 @@ function Ao(e) {
|
|
|
1507
1501
|
);
|
|
1508
1502
|
},
|
|
1509
1503
|
m(l, a) {
|
|
1510
|
-
|
|
1504
|
+
B(l, t, a), s || (r = H(
|
|
1511
1505
|
t,
|
|
1512
1506
|
"pointerdown",
|
|
1513
1507
|
/*pointerdown_handler_2*/
|
|
@@ -1516,21 +1510,21 @@ function Ao(e) {
|
|
|
1516
1510
|
},
|
|
1517
1511
|
p(l, a) {
|
|
1518
1512
|
a & /*$$props*/
|
|
1519
|
-
256 && n !== (n =
|
|
1520
|
-
l[8].class || ""}`.trim()) + " svelte-1sgkh33") &&
|
|
1513
|
+
256 && n !== (n = ze(`a9s-handle ${/*$$props*/
|
|
1514
|
+
l[8].class || ""}`.trim()) + " svelte-1sgkh33") && h(t, "class", n), a & /*x, handleSize*/
|
|
1521
1515
|
33 && o !== (o = /*x*/
|
|
1522
1516
|
l[0] - /*handleSize*/
|
|
1523
|
-
l[5] / 2) &&
|
|
1517
|
+
l[5] / 2) && h(t, "x", o), a & /*y, handleSize*/
|
|
1524
1518
|
34 && i !== (i = /*y*/
|
|
1525
1519
|
l[1] - /*handleSize*/
|
|
1526
|
-
l[5] / 2) &&
|
|
1527
|
-
32 &&
|
|
1520
|
+
l[5] / 2) && h(t, "y", i), a & /*handleSize*/
|
|
1521
|
+
32 && h(
|
|
1528
1522
|
t,
|
|
1529
1523
|
"width",
|
|
1530
1524
|
/*handleSize*/
|
|
1531
1525
|
l[5]
|
|
1532
1526
|
), a & /*handleSize*/
|
|
1533
|
-
32 &&
|
|
1527
|
+
32 && h(
|
|
1534
1528
|
t,
|
|
1535
1529
|
"height",
|
|
1536
1530
|
/*handleSize*/
|
|
@@ -1538,7 +1532,7 @@ function Ao(e) {
|
|
|
1538
1532
|
);
|
|
1539
1533
|
},
|
|
1540
1534
|
d(l) {
|
|
1541
|
-
l &&
|
|
1535
|
+
l && k(t), s = !1, r();
|
|
1542
1536
|
}
|
|
1543
1537
|
};
|
|
1544
1538
|
}
|
|
@@ -1546,73 +1540,73 @@ function So(e) {
|
|
|
1546
1540
|
let t, n, o, i, s, r, l, a, c;
|
|
1547
1541
|
return {
|
|
1548
1542
|
c() {
|
|
1549
|
-
t =
|
|
1543
|
+
t = X("g"), n = X("circle"), i = X("rect"), h(
|
|
1550
1544
|
n,
|
|
1551
1545
|
"cx",
|
|
1552
1546
|
/*x*/
|
|
1553
1547
|
e[0]
|
|
1554
|
-
),
|
|
1548
|
+
), h(
|
|
1555
1549
|
n,
|
|
1556
1550
|
"cy",
|
|
1557
1551
|
/*y*/
|
|
1558
1552
|
e[1]
|
|
1559
|
-
),
|
|
1553
|
+
), h(n, "r", o = /*radius*/
|
|
1560
1554
|
e[3] / /*scale*/
|
|
1561
|
-
e[2]),
|
|
1555
|
+
e[2]), h(n, "class", "a9s-touch-halo svelte-1sgkh33"), Ee(
|
|
1562
1556
|
n,
|
|
1563
1557
|
"touched",
|
|
1564
1558
|
/*touched*/
|
|
1565
1559
|
e[4]
|
|
1566
|
-
),
|
|
1567
|
-
e[8].class || ""}`.trim()) + " svelte-1sgkh33"),
|
|
1560
|
+
), h(i, "class", s = ze(`a9s-handle ${/*$$props*/
|
|
1561
|
+
e[8].class || ""}`.trim()) + " svelte-1sgkh33"), h(i, "x", r = /*x*/
|
|
1568
1562
|
e[0] - /*handleSize*/
|
|
1569
|
-
e[5] / 2),
|
|
1563
|
+
e[5] / 2), h(i, "y", l = /*y*/
|
|
1570
1564
|
e[1] - /*handleSize*/
|
|
1571
|
-
e[5] / 2),
|
|
1565
|
+
e[5] / 2), h(
|
|
1572
1566
|
i,
|
|
1573
1567
|
"width",
|
|
1574
1568
|
/*handleSize*/
|
|
1575
1569
|
e[5]
|
|
1576
|
-
),
|
|
1570
|
+
), h(
|
|
1577
1571
|
i,
|
|
1578
1572
|
"height",
|
|
1579
1573
|
/*handleSize*/
|
|
1580
1574
|
e[5]
|
|
1581
|
-
),
|
|
1575
|
+
), h(t, "class", "a9s-touch-handle");
|
|
1582
1576
|
},
|
|
1583
1577
|
m(u, f) {
|
|
1584
|
-
|
|
1585
|
-
|
|
1578
|
+
B(u, t, f), ie(t, n), ie(t, i), a || (c = [
|
|
1579
|
+
H(
|
|
1586
1580
|
n,
|
|
1587
1581
|
"pointerdown",
|
|
1588
1582
|
/*pointerdown_handler*/
|
|
1589
1583
|
e[10]
|
|
1590
1584
|
),
|
|
1591
|
-
|
|
1585
|
+
H(
|
|
1592
1586
|
n,
|
|
1593
1587
|
"pointerdown",
|
|
1594
1588
|
/*onPointerDown*/
|
|
1595
1589
|
e[6]
|
|
1596
1590
|
),
|
|
1597
|
-
|
|
1591
|
+
H(
|
|
1598
1592
|
n,
|
|
1599
1593
|
"pointerup",
|
|
1600
1594
|
/*onPointerUp*/
|
|
1601
1595
|
e[7]
|
|
1602
1596
|
),
|
|
1603
|
-
|
|
1597
|
+
H(
|
|
1604
1598
|
i,
|
|
1605
1599
|
"pointerdown",
|
|
1606
1600
|
/*pointerdown_handler_1*/
|
|
1607
1601
|
e[9]
|
|
1608
1602
|
),
|
|
1609
|
-
|
|
1603
|
+
H(
|
|
1610
1604
|
i,
|
|
1611
1605
|
"pointerdown",
|
|
1612
1606
|
/*onPointerDown*/
|
|
1613
1607
|
e[6]
|
|
1614
1608
|
),
|
|
1615
|
-
|
|
1609
|
+
H(
|
|
1616
1610
|
i,
|
|
1617
1611
|
"pointerup",
|
|
1618
1612
|
/*onPointerUp*/
|
|
@@ -1622,13 +1616,13 @@ function So(e) {
|
|
|
1622
1616
|
},
|
|
1623
1617
|
p(u, f) {
|
|
1624
1618
|
f & /*x*/
|
|
1625
|
-
1 &&
|
|
1619
|
+
1 && h(
|
|
1626
1620
|
n,
|
|
1627
1621
|
"cx",
|
|
1628
1622
|
/*x*/
|
|
1629
1623
|
u[0]
|
|
1630
1624
|
), f & /*y*/
|
|
1631
|
-
2 &&
|
|
1625
|
+
2 && h(
|
|
1632
1626
|
n,
|
|
1633
1627
|
"cy",
|
|
1634
1628
|
/*y*/
|
|
@@ -1636,28 +1630,28 @@ function So(e) {
|
|
|
1636
1630
|
), f & /*radius, scale*/
|
|
1637
1631
|
12 && o !== (o = /*radius*/
|
|
1638
1632
|
u[3] / /*scale*/
|
|
1639
|
-
u[2]) &&
|
|
1640
|
-
16 &&
|
|
1633
|
+
u[2]) && h(n, "r", o), f & /*touched*/
|
|
1634
|
+
16 && Ee(
|
|
1641
1635
|
n,
|
|
1642
1636
|
"touched",
|
|
1643
1637
|
/*touched*/
|
|
1644
1638
|
u[4]
|
|
1645
1639
|
), f & /*$$props*/
|
|
1646
|
-
256 && s !== (s =
|
|
1647
|
-
u[8].class || ""}`.trim()) + " svelte-1sgkh33") &&
|
|
1640
|
+
256 && s !== (s = ze(`a9s-handle ${/*$$props*/
|
|
1641
|
+
u[8].class || ""}`.trim()) + " svelte-1sgkh33") && h(i, "class", s), f & /*x, handleSize*/
|
|
1648
1642
|
33 && r !== (r = /*x*/
|
|
1649
1643
|
u[0] - /*handleSize*/
|
|
1650
|
-
u[5] / 2) &&
|
|
1644
|
+
u[5] / 2) && h(i, "x", r), f & /*y, handleSize*/
|
|
1651
1645
|
34 && l !== (l = /*y*/
|
|
1652
1646
|
u[1] - /*handleSize*/
|
|
1653
|
-
u[5] / 2) &&
|
|
1654
|
-
32 &&
|
|
1647
|
+
u[5] / 2) && h(i, "y", l), f & /*handleSize*/
|
|
1648
|
+
32 && h(
|
|
1655
1649
|
i,
|
|
1656
1650
|
"width",
|
|
1657
1651
|
/*handleSize*/
|
|
1658
1652
|
u[5]
|
|
1659
1653
|
), f & /*handleSize*/
|
|
1660
|
-
32 &&
|
|
1654
|
+
32 && h(
|
|
1661
1655
|
i,
|
|
1662
1656
|
"height",
|
|
1663
1657
|
/*handleSize*/
|
|
@@ -1665,7 +1659,7 @@ function So(e) {
|
|
|
1665
1659
|
);
|
|
1666
1660
|
},
|
|
1667
1661
|
d(u) {
|
|
1668
|
-
u &&
|
|
1662
|
+
u && k(t), a = !1, le(c);
|
|
1669
1663
|
}
|
|
1670
1664
|
};
|
|
1671
1665
|
}
|
|
@@ -1677,18 +1671,18 @@ function To(e) {
|
|
|
1677
1671
|
let i = n()(e);
|
|
1678
1672
|
return {
|
|
1679
1673
|
c() {
|
|
1680
|
-
i.c(), t =
|
|
1674
|
+
i.c(), t = ae();
|
|
1681
1675
|
},
|
|
1682
1676
|
m(s, r) {
|
|
1683
|
-
i.m(s, r),
|
|
1677
|
+
i.m(s, r), B(s, t, r);
|
|
1684
1678
|
},
|
|
1685
1679
|
p(s, [r]) {
|
|
1686
1680
|
i.p(s, r);
|
|
1687
1681
|
},
|
|
1688
|
-
i:
|
|
1689
|
-
o:
|
|
1682
|
+
i: G,
|
|
1683
|
+
o: G,
|
|
1690
1684
|
d(s) {
|
|
1691
|
-
s &&
|
|
1685
|
+
s && k(t), i.d(s);
|
|
1692
1686
|
}
|
|
1693
1687
|
};
|
|
1694
1688
|
}
|
|
@@ -1698,13 +1692,13 @@ function Mo(e, t, n) {
|
|
|
1698
1692
|
m.pointerType === "touch" && n(4, a = !0);
|
|
1699
1693
|
}, u = () => n(4, a = !1);
|
|
1700
1694
|
function f(m) {
|
|
1701
|
-
|
|
1695
|
+
fe.call(this, e, m);
|
|
1702
1696
|
}
|
|
1703
|
-
function
|
|
1704
|
-
|
|
1697
|
+
function d(m) {
|
|
1698
|
+
fe.call(this, e, m);
|
|
1705
1699
|
}
|
|
1706
1700
|
function g(m) {
|
|
1707
|
-
|
|
1701
|
+
fe.call(this, e, m);
|
|
1708
1702
|
}
|
|
1709
1703
|
return e.$$set = (m) => {
|
|
1710
1704
|
n(8, t = nt(nt({}, t), gt(m))), "x" in m && n(0, i = m.x), "y" in m && n(1, s = m.y), "scale" in m && n(2, r = m.scale), "radius" in m && n(3, l = m.radius);
|
|
@@ -1722,18 +1716,18 @@ function Mo(e, t, n) {
|
|
|
1722
1716
|
u,
|
|
1723
1717
|
t,
|
|
1724
1718
|
f,
|
|
1725
|
-
|
|
1719
|
+
d,
|
|
1726
1720
|
g
|
|
1727
1721
|
];
|
|
1728
1722
|
}
|
|
1729
|
-
class
|
|
1723
|
+
class ke extends te {
|
|
1730
1724
|
constructor(t) {
|
|
1731
|
-
super(), ee(this, t, Mo, To,
|
|
1725
|
+
super(), ee(this, t, Mo, To, K, { x: 0, y: 1, scale: 2, radius: 3 });
|
|
1732
1726
|
}
|
|
1733
1727
|
}
|
|
1734
1728
|
function vo(e) {
|
|
1735
|
-
let t, n, o, i, s, r, l, a, c, u, f,
|
|
1736
|
-
return
|
|
1729
|
+
let t, n, o, i, s, r, l, a, c, u, f, d, g, m, y, E, p, S, w, A, I, N, U, _, b, T, M, O, Y, Z, he, ge, Me, oe, ve, L, W, V, ce, J, R, qe, ut;
|
|
1730
|
+
return oe = new ke({
|
|
1737
1731
|
props: {
|
|
1738
1732
|
class: "a9s-corner-handle-topleft",
|
|
1739
1733
|
x: (
|
|
@@ -1749,12 +1743,12 @@ function vo(e) {
|
|
|
1749
1743
|
e[3]
|
|
1750
1744
|
)
|
|
1751
1745
|
}
|
|
1752
|
-
}),
|
|
1753
|
-
|
|
1746
|
+
}), oe.$on("pointerdown", function() {
|
|
1747
|
+
j(
|
|
1754
1748
|
/*grab*/
|
|
1755
1749
|
e[9]("TOP_LEFT")
|
|
1756
1750
|
) && e[9]("TOP_LEFT").apply(this, arguments);
|
|
1757
|
-
}),
|
|
1751
|
+
}), L = new ke({
|
|
1758
1752
|
props: {
|
|
1759
1753
|
class: "a9s-corner-handle-topright",
|
|
1760
1754
|
x: (
|
|
@@ -1771,12 +1765,12 @@ function vo(e) {
|
|
|
1771
1765
|
e[3]
|
|
1772
1766
|
)
|
|
1773
1767
|
}
|
|
1774
|
-
}),
|
|
1775
|
-
|
|
1768
|
+
}), L.$on("pointerdown", function() {
|
|
1769
|
+
j(
|
|
1776
1770
|
/*grab*/
|
|
1777
1771
|
e[9]("TOP_RIGHT")
|
|
1778
1772
|
) && e[9]("TOP_RIGHT").apply(this, arguments);
|
|
1779
|
-
}),
|
|
1773
|
+
}), V = new ke({
|
|
1780
1774
|
props: {
|
|
1781
1775
|
class: "a9s-corner-handle-bottomright",
|
|
1782
1776
|
x: (
|
|
@@ -1794,12 +1788,12 @@ function vo(e) {
|
|
|
1794
1788
|
e[3]
|
|
1795
1789
|
)
|
|
1796
1790
|
}
|
|
1797
|
-
}),
|
|
1798
|
-
|
|
1791
|
+
}), V.$on("pointerdown", function() {
|
|
1792
|
+
j(
|
|
1799
1793
|
/*grab*/
|
|
1800
1794
|
e[9]("BOTTOM_RIGHT")
|
|
1801
1795
|
) && e[9]("BOTTOM_RIGHT").apply(this, arguments);
|
|
1802
|
-
}),
|
|
1796
|
+
}), J = new ke({
|
|
1803
1797
|
props: {
|
|
1804
1798
|
class: "a9s-corner-handle-bottomleft",
|
|
1805
1799
|
x: (
|
|
@@ -1816,180 +1810,180 @@ function vo(e) {
|
|
|
1816
1810
|
e[3]
|
|
1817
1811
|
)
|
|
1818
1812
|
}
|
|
1819
|
-
}),
|
|
1820
|
-
|
|
1813
|
+
}), J.$on("pointerdown", function() {
|
|
1814
|
+
j(
|
|
1821
1815
|
/*grab*/
|
|
1822
1816
|
e[9]("BOTTOM_LEFT")
|
|
1823
1817
|
) && e[9]("BOTTOM_LEFT").apply(this, arguments);
|
|
1824
1818
|
}), {
|
|
1825
1819
|
c() {
|
|
1826
|
-
t =
|
|
1827
|
-
e[1] ? "display:none;" : void 0),
|
|
1828
|
-
e[4].x),
|
|
1829
|
-
e[4].y),
|
|
1830
|
-
e[4].w),
|
|
1831
|
-
e[4].h),
|
|
1820
|
+
t = X("rect"), l = ne(), a = X("rect"), g = ne(), m = X("rect"), S = ne(), w = X("rect"), U = ne(), _ = X("rect"), O = ne(), Y = X("rect"), Me = ne(), $(oe.$$.fragment), ve = ne(), $(L.$$.fragment), W = ne(), $(V.$$.fragment), ce = ne(), $(J.$$.fragment), h(t, "class", "a9s-outer"), h(t, "style", n = /*computedStyle*/
|
|
1821
|
+
e[1] ? "display:none;" : void 0), h(t, "x", o = /*geom*/
|
|
1822
|
+
e[4].x), h(t, "y", i = /*geom*/
|
|
1823
|
+
e[4].y), h(t, "width", s = /*geom*/
|
|
1824
|
+
e[4].w), h(t, "height", r = /*geom*/
|
|
1825
|
+
e[4].h), h(a, "class", "a9s-inner a9s-shape-handle"), h(
|
|
1832
1826
|
a,
|
|
1833
1827
|
"style",
|
|
1834
1828
|
/*computedStyle*/
|
|
1835
1829
|
e[1]
|
|
1836
|
-
),
|
|
1837
|
-
e[4].x),
|
|
1838
|
-
e[4].y),
|
|
1839
|
-
e[4].w),
|
|
1840
|
-
e[4].h),
|
|
1841
|
-
e[4].x),
|
|
1842
|
-
e[4].y),
|
|
1843
|
-
e[4].w),
|
|
1830
|
+
), h(a, "x", c = /*geom*/
|
|
1831
|
+
e[4].x), h(a, "y", u = /*geom*/
|
|
1832
|
+
e[4].y), h(a, "width", f = /*geom*/
|
|
1833
|
+
e[4].w), h(a, "height", d = /*geom*/
|
|
1834
|
+
e[4].h), h(m, "class", "a9s-edge-handle a9s-edge-handle-top"), h(m, "x", y = /*geom*/
|
|
1835
|
+
e[4].x), h(m, "y", E = /*geom*/
|
|
1836
|
+
e[4].y), h(m, "height", 1), h(m, "width", p = /*geom*/
|
|
1837
|
+
e[4].w), h(w, "class", "a9s-edge-handle a9s-edge-handle-right"), h(w, "x", A = /*geom*/
|
|
1844
1838
|
e[4].x + /*geom*/
|
|
1845
|
-
e[4].w),
|
|
1846
|
-
e[4].y),
|
|
1847
|
-
e[4].h),
|
|
1848
|
-
e[4].x),
|
|
1839
|
+
e[4].w), h(w, "y", I = /*geom*/
|
|
1840
|
+
e[4].y), h(w, "height", N = /*geom*/
|
|
1841
|
+
e[4].h), h(w, "width", 1), h(_, "class", "a9s-edge-handle a9s-edge-handle-bottom"), h(_, "x", b = /*geom*/
|
|
1842
|
+
e[4].x), h(_, "y", T = /*geom*/
|
|
1849
1843
|
e[4].y + /*geom*/
|
|
1850
|
-
e[4].h),
|
|
1851
|
-
e[4].w),
|
|
1852
|
-
e[4].x),
|
|
1853
|
-
e[4].y),
|
|
1854
|
-
e[4].h),
|
|
1855
|
-
},
|
|
1856
|
-
m(
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1844
|
+
e[4].h), h(_, "height", 1), h(_, "width", M = /*geom*/
|
|
1845
|
+
e[4].w), h(Y, "class", "a9s-edge-handle a9s-edge-handle-left"), h(Y, "x", Z = /*geom*/
|
|
1846
|
+
e[4].x), h(Y, "y", he = /*geom*/
|
|
1847
|
+
e[4].y), h(Y, "height", ge = /*geom*/
|
|
1848
|
+
e[4].h), h(Y, "width", 1);
|
|
1849
|
+
},
|
|
1850
|
+
m(C, v) {
|
|
1851
|
+
B(C, t, v), B(C, l, v), B(C, a, v), B(C, g, v), B(C, m, v), B(C, S, v), B(C, w, v), B(C, U, v), B(C, _, v), B(C, O, v), B(C, Y, v), B(C, Me, v), Q(oe, C, v), B(C, ve, v), Q(L, C, v), B(C, W, v), Q(V, C, v), B(C, ce, v), Q(J, C, v), R = !0, qe || (ut = [
|
|
1852
|
+
H(t, "pointerdown", function() {
|
|
1853
|
+
j(
|
|
1860
1854
|
/*grab*/
|
|
1861
1855
|
e[9]("SHAPE")
|
|
1862
1856
|
) && e[9]("SHAPE").apply(this, arguments);
|
|
1863
1857
|
}),
|
|
1864
|
-
|
|
1865
|
-
|
|
1858
|
+
H(a, "pointerdown", function() {
|
|
1859
|
+
j(
|
|
1866
1860
|
/*grab*/
|
|
1867
1861
|
e[9]("SHAPE")
|
|
1868
1862
|
) && e[9]("SHAPE").apply(this, arguments);
|
|
1869
1863
|
}),
|
|
1870
|
-
|
|
1871
|
-
|
|
1864
|
+
H(m, "pointerdown", function() {
|
|
1865
|
+
j(
|
|
1872
1866
|
/*grab*/
|
|
1873
1867
|
e[9]("TOP")
|
|
1874
1868
|
) && e[9]("TOP").apply(this, arguments);
|
|
1875
1869
|
}),
|
|
1876
|
-
|
|
1877
|
-
|
|
1870
|
+
H(w, "pointerdown", function() {
|
|
1871
|
+
j(
|
|
1878
1872
|
/*grab*/
|
|
1879
1873
|
e[9]("RIGHT")
|
|
1880
1874
|
) && e[9]("RIGHT").apply(this, arguments);
|
|
1881
1875
|
}),
|
|
1882
|
-
|
|
1883
|
-
|
|
1876
|
+
H(_, "pointerdown", function() {
|
|
1877
|
+
j(
|
|
1884
1878
|
/*grab*/
|
|
1885
1879
|
e[9]("BOTTOM")
|
|
1886
1880
|
) && e[9]("BOTTOM").apply(this, arguments);
|
|
1887
1881
|
}),
|
|
1888
|
-
|
|
1889
|
-
|
|
1882
|
+
H(Y, "pointerdown", function() {
|
|
1883
|
+
j(
|
|
1890
1884
|
/*grab*/
|
|
1891
1885
|
e[9]("LEFT")
|
|
1892
1886
|
) && e[9]("LEFT").apply(this, arguments);
|
|
1893
1887
|
})
|
|
1894
1888
|
], qe = !0);
|
|
1895
1889
|
},
|
|
1896
|
-
p(
|
|
1897
|
-
e =
|
|
1890
|
+
p(C, v) {
|
|
1891
|
+
e = C, (!R || v & /*computedStyle*/
|
|
1898
1892
|
2 && n !== (n = /*computedStyle*/
|
|
1899
|
-
e[1] ? "display:none;" : void 0)) &&
|
|
1893
|
+
e[1] ? "display:none;" : void 0)) && h(t, "style", n), (!R || v & /*geom*/
|
|
1900
1894
|
16 && o !== (o = /*geom*/
|
|
1901
|
-
e[4].x)) &&
|
|
1895
|
+
e[4].x)) && h(t, "x", o), (!R || v & /*geom*/
|
|
1902
1896
|
16 && i !== (i = /*geom*/
|
|
1903
|
-
e[4].y)) &&
|
|
1897
|
+
e[4].y)) && h(t, "y", i), (!R || v & /*geom*/
|
|
1904
1898
|
16 && s !== (s = /*geom*/
|
|
1905
|
-
e[4].w)) &&
|
|
1899
|
+
e[4].w)) && h(t, "width", s), (!R || v & /*geom*/
|
|
1906
1900
|
16 && r !== (r = /*geom*/
|
|
1907
|
-
e[4].h)) &&
|
|
1908
|
-
2) &&
|
|
1901
|
+
e[4].h)) && h(t, "height", r), (!R || v & /*computedStyle*/
|
|
1902
|
+
2) && h(
|
|
1909
1903
|
a,
|
|
1910
1904
|
"style",
|
|
1911
1905
|
/*computedStyle*/
|
|
1912
1906
|
e[1]
|
|
1913
|
-
), (!
|
|
1907
|
+
), (!R || v & /*geom*/
|
|
1914
1908
|
16 && c !== (c = /*geom*/
|
|
1915
|
-
e[4].x)) &&
|
|
1909
|
+
e[4].x)) && h(a, "x", c), (!R || v & /*geom*/
|
|
1916
1910
|
16 && u !== (u = /*geom*/
|
|
1917
|
-
e[4].y)) &&
|
|
1911
|
+
e[4].y)) && h(a, "y", u), (!R || v & /*geom*/
|
|
1918
1912
|
16 && f !== (f = /*geom*/
|
|
1919
|
-
e[4].w)) &&
|
|
1920
|
-
16 &&
|
|
1921
|
-
e[4].h)) &&
|
|
1922
|
-
16 && _ !== (_ = /*geom*/
|
|
1923
|
-
e[4].x)) && d(m, "x", _), (!N || v & /*geom*/
|
|
1924
|
-
16 && b !== (b = /*geom*/
|
|
1925
|
-
e[4].y)) && d(m, "y", b), (!N || v & /*geom*/
|
|
1913
|
+
e[4].w)) && h(a, "width", f), (!R || v & /*geom*/
|
|
1914
|
+
16 && d !== (d = /*geom*/
|
|
1915
|
+
e[4].h)) && h(a, "height", d), (!R || v & /*geom*/
|
|
1926
1916
|
16 && y !== (y = /*geom*/
|
|
1927
|
-
e[4].
|
|
1917
|
+
e[4].x)) && h(m, "x", y), (!R || v & /*geom*/
|
|
1928
1918
|
16 && E !== (E = /*geom*/
|
|
1919
|
+
e[4].y)) && h(m, "y", E), (!R || v & /*geom*/
|
|
1920
|
+
16 && p !== (p = /*geom*/
|
|
1921
|
+
e[4].w)) && h(m, "width", p), (!R || v & /*geom*/
|
|
1922
|
+
16 && A !== (A = /*geom*/
|
|
1929
1923
|
e[4].x + /*geom*/
|
|
1930
|
-
e[4].w)) &&
|
|
1931
|
-
16 &&
|
|
1932
|
-
e[4].y)) &&
|
|
1933
|
-
16 &&
|
|
1934
|
-
e[4].h)) &&
|
|
1924
|
+
e[4].w)) && h(w, "x", A), (!R || v & /*geom*/
|
|
1925
|
+
16 && I !== (I = /*geom*/
|
|
1926
|
+
e[4].y)) && h(w, "y", I), (!R || v & /*geom*/
|
|
1927
|
+
16 && N !== (N = /*geom*/
|
|
1928
|
+
e[4].h)) && h(w, "height", N), (!R || v & /*geom*/
|
|
1929
|
+
16 && b !== (b = /*geom*/
|
|
1930
|
+
e[4].x)) && h(_, "x", b), (!R || v & /*geom*/
|
|
1935
1931
|
16 && T !== (T = /*geom*/
|
|
1936
|
-
e[4].x)) && d(p, "x", T), (!N || v & /*geom*/
|
|
1937
|
-
16 && S !== (S = /*geom*/
|
|
1938
1932
|
e[4].y + /*geom*/
|
|
1939
|
-
e[4].h)) &&
|
|
1933
|
+
e[4].h)) && h(_, "y", T), (!R || v & /*geom*/
|
|
1940
1934
|
16 && M !== (M = /*geom*/
|
|
1941
|
-
e[4].w)) &&
|
|
1935
|
+
e[4].w)) && h(_, "width", M), (!R || v & /*geom*/
|
|
1942
1936
|
16 && Z !== (Z = /*geom*/
|
|
1943
|
-
e[4].x)) &&
|
|
1937
|
+
e[4].x)) && h(Y, "x", Z), (!R || v & /*geom*/
|
|
1938
|
+
16 && he !== (he = /*geom*/
|
|
1939
|
+
e[4].y)) && h(Y, "y", he), (!R || v & /*geom*/
|
|
1944
1940
|
16 && ge !== (ge = /*geom*/
|
|
1945
|
-
e[4].
|
|
1946
|
-
16 && me !== (me = /*geom*/
|
|
1947
|
-
e[4].h)) && d(C, "height", me);
|
|
1948
|
-
const Ye = {};
|
|
1949
|
-
v & /*geom*/
|
|
1950
|
-
16 && (Ye.x = /*geom*/
|
|
1951
|
-
e[4].x), v & /*geom*/
|
|
1952
|
-
16 && (Ye.y = /*geom*/
|
|
1953
|
-
e[4].y), v & /*viewportScale*/
|
|
1954
|
-
8 && (Ye.scale = /*viewportScale*/
|
|
1955
|
-
e[3]), ie.$set(Ye);
|
|
1941
|
+
e[4].h)) && h(Y, "height", ge);
|
|
1956
1942
|
const Ce = {};
|
|
1957
1943
|
v & /*geom*/
|
|
1958
1944
|
16 && (Ce.x = /*geom*/
|
|
1959
|
-
e[4].x
|
|
1960
|
-
e[4].w), v & /*geom*/
|
|
1945
|
+
e[4].x), v & /*geom*/
|
|
1961
1946
|
16 && (Ce.y = /*geom*/
|
|
1962
1947
|
e[4].y), v & /*viewportScale*/
|
|
1963
1948
|
8 && (Ce.scale = /*viewportScale*/
|
|
1964
|
-
e[3]),
|
|
1949
|
+
e[3]), oe.$set(Ce);
|
|
1965
1950
|
const De = {};
|
|
1966
1951
|
v & /*geom*/
|
|
1967
1952
|
16 && (De.x = /*geom*/
|
|
1968
1953
|
e[4].x + /*geom*/
|
|
1969
1954
|
e[4].w), v & /*geom*/
|
|
1970
1955
|
16 && (De.y = /*geom*/
|
|
1971
|
-
e[4].y
|
|
1972
|
-
e[4].h), v & /*viewportScale*/
|
|
1956
|
+
e[4].y), v & /*viewportScale*/
|
|
1973
1957
|
8 && (De.scale = /*viewportScale*/
|
|
1974
|
-
e[3]),
|
|
1958
|
+
e[3]), L.$set(De);
|
|
1975
1959
|
const Xe = {};
|
|
1976
1960
|
v & /*geom*/
|
|
1977
1961
|
16 && (Xe.x = /*geom*/
|
|
1978
|
-
e[4].x
|
|
1962
|
+
e[4].x + /*geom*/
|
|
1963
|
+
e[4].w), v & /*geom*/
|
|
1979
1964
|
16 && (Xe.y = /*geom*/
|
|
1980
1965
|
e[4].y + /*geom*/
|
|
1981
1966
|
e[4].h), v & /*viewportScale*/
|
|
1982
1967
|
8 && (Xe.scale = /*viewportScale*/
|
|
1983
|
-
e[3]),
|
|
1968
|
+
e[3]), V.$set(Xe);
|
|
1969
|
+
const Re = {};
|
|
1970
|
+
v & /*geom*/
|
|
1971
|
+
16 && (Re.x = /*geom*/
|
|
1972
|
+
e[4].x), v & /*geom*/
|
|
1973
|
+
16 && (Re.y = /*geom*/
|
|
1974
|
+
e[4].y + /*geom*/
|
|
1975
|
+
e[4].h), v & /*viewportScale*/
|
|
1976
|
+
8 && (Re.scale = /*viewportScale*/
|
|
1977
|
+
e[3]), J.$set(Re);
|
|
1984
1978
|
},
|
|
1985
|
-
i(
|
|
1986
|
-
|
|
1979
|
+
i(C) {
|
|
1980
|
+
R || (P(oe.$$.fragment, C), P(L.$$.fragment, C), P(V.$$.fragment, C), P(J.$$.fragment, C), R = !0);
|
|
1987
1981
|
},
|
|
1988
|
-
o(
|
|
1989
|
-
D(
|
|
1982
|
+
o(C) {
|
|
1983
|
+
D(oe.$$.fragment, C), D(L.$$.fragment, C), D(V.$$.fragment, C), D(J.$$.fragment, C), R = !1;
|
|
1990
1984
|
},
|
|
1991
|
-
d(
|
|
1992
|
-
|
|
1985
|
+
d(C) {
|
|
1986
|
+
C && (k(t), k(l), k(a), k(g), k(m), k(S), k(w), k(U), k(_), k(O), k(Y), k(Me), k(ve), k(W), k(ce)), x(oe, C), x(L, C), x(V, C), x(J, C), qe = !1, le(ut);
|
|
1993
1987
|
}
|
|
1994
1988
|
};
|
|
1995
1989
|
}
|
|
@@ -2059,24 +2053,24 @@ function Lo(e) {
|
|
|
2059
2053
|
}
|
|
2060
2054
|
function ko(e, t, n) {
|
|
2061
2055
|
let o, { shape: i } = t, { computedStyle: s } = t, { transform: r } = t, { viewportScale: l = 1 } = t;
|
|
2062
|
-
const a = (
|
|
2063
|
-
const
|
|
2064
|
-
let [
|
|
2065
|
-
const [
|
|
2056
|
+
const a = (d, g, m) => {
|
|
2057
|
+
const y = d.geometry.bounds;
|
|
2058
|
+
let [E, p] = [y.minX, y.minY], [S, w] = [y.maxX, y.maxY];
|
|
2059
|
+
const [A, I] = m;
|
|
2066
2060
|
if (g === "SHAPE")
|
|
2067
|
-
|
|
2061
|
+
E += A, S += A, p += I, w += I;
|
|
2068
2062
|
else {
|
|
2069
2063
|
switch (g) {
|
|
2070
2064
|
case "TOP":
|
|
2071
2065
|
case "TOP_LEFT":
|
|
2072
2066
|
case "TOP_RIGHT": {
|
|
2073
|
-
|
|
2067
|
+
p += I;
|
|
2074
2068
|
break;
|
|
2075
2069
|
}
|
|
2076
2070
|
case "BOTTOM":
|
|
2077
2071
|
case "BOTTOM_LEFT":
|
|
2078
2072
|
case "BOTTOM_RIGHT": {
|
|
2079
|
-
w +=
|
|
2073
|
+
w += I;
|
|
2080
2074
|
break;
|
|
2081
2075
|
}
|
|
2082
2076
|
}
|
|
@@ -2084,45 +2078,45 @@ function ko(e, t, n) {
|
|
|
2084
2078
|
case "LEFT":
|
|
2085
2079
|
case "TOP_LEFT":
|
|
2086
2080
|
case "BOTTOM_LEFT": {
|
|
2087
|
-
|
|
2081
|
+
E += A;
|
|
2088
2082
|
break;
|
|
2089
2083
|
}
|
|
2090
2084
|
case "RIGHT":
|
|
2091
2085
|
case "TOP_RIGHT":
|
|
2092
2086
|
case "BOTTOM_RIGHT": {
|
|
2093
|
-
|
|
2087
|
+
S += A;
|
|
2094
2088
|
break;
|
|
2095
2089
|
}
|
|
2096
2090
|
}
|
|
2097
2091
|
}
|
|
2098
|
-
const
|
|
2092
|
+
const N = Math.min(E, S), U = Math.min(p, w), _ = Math.abs(S - E), b = Math.abs(w - p);
|
|
2099
2093
|
return {
|
|
2100
|
-
...
|
|
2094
|
+
...d,
|
|
2101
2095
|
geometry: {
|
|
2102
|
-
x:
|
|
2103
|
-
y:
|
|
2104
|
-
w:
|
|
2105
|
-
h:
|
|
2096
|
+
x: N,
|
|
2097
|
+
y: U,
|
|
2098
|
+
w: _,
|
|
2099
|
+
h: b,
|
|
2106
2100
|
bounds: {
|
|
2107
|
-
minX:
|
|
2108
|
-
minY:
|
|
2109
|
-
maxX:
|
|
2110
|
-
maxY:
|
|
2101
|
+
minX: N,
|
|
2102
|
+
minY: U,
|
|
2103
|
+
maxX: N + _,
|
|
2104
|
+
maxY: U + b
|
|
2111
2105
|
}
|
|
2112
2106
|
}
|
|
2113
2107
|
};
|
|
2114
2108
|
};
|
|
2115
|
-
function c(
|
|
2116
|
-
|
|
2109
|
+
function c(d) {
|
|
2110
|
+
fe.call(this, e, d);
|
|
2117
2111
|
}
|
|
2118
|
-
function u(
|
|
2119
|
-
|
|
2112
|
+
function u(d) {
|
|
2113
|
+
fe.call(this, e, d);
|
|
2120
2114
|
}
|
|
2121
|
-
function f(
|
|
2122
|
-
|
|
2115
|
+
function f(d) {
|
|
2116
|
+
fe.call(this, e, d);
|
|
2123
2117
|
}
|
|
2124
|
-
return e.$$set = (
|
|
2125
|
-
"shape" in
|
|
2118
|
+
return e.$$set = (d) => {
|
|
2119
|
+
"shape" in d && n(0, i = d.shape), "computedStyle" in d && n(1, s = d.computedStyle), "transform" in d && n(2, r = d.transform), "viewportScale" in d && n(3, l = d.viewportScale);
|
|
2126
2120
|
}, e.$$.update = () => {
|
|
2127
2121
|
e.$$.dirty & /*shape*/
|
|
2128
2122
|
1 && n(4, o = i.geometry);
|
|
@@ -2140,7 +2134,7 @@ function ko(e, t, n) {
|
|
|
2140
2134
|
}
|
|
2141
2135
|
class Oo extends te {
|
|
2142
2136
|
constructor(t) {
|
|
2143
|
-
super(), ee(this, t, ko, Lo,
|
|
2137
|
+
super(), ee(this, t, ko, Lo, K, {
|
|
2144
2138
|
shape: 0,
|
|
2145
2139
|
computedStyle: 1,
|
|
2146
2140
|
transform: 2,
|
|
@@ -2149,8 +2143,8 @@ class Oo extends te {
|
|
|
2149
2143
|
}
|
|
2150
2144
|
}
|
|
2151
2145
|
const Zt = /* @__PURE__ */ new Map([
|
|
2152
|
-
[
|
|
2153
|
-
[
|
|
2146
|
+
[F.RECTANGLE, Oo],
|
|
2147
|
+
[F.POLYGON, yo]
|
|
2154
2148
|
]), Bo = (e) => Zt.get(e.type), Io = (e, t) => Zt.set(e, t), Po = (e) => ({}), St = (e) => ({ grab: (
|
|
2155
2149
|
/*onGrab*/
|
|
2156
2150
|
e[0]
|
|
@@ -2169,17 +2163,17 @@ function Yo(e) {
|
|
|
2169
2163
|
);
|
|
2170
2164
|
return {
|
|
2171
2165
|
c() {
|
|
2172
|
-
t =
|
|
2166
|
+
t = X("g"), r && r.c(), h(t, "class", "a9s-annotation selected");
|
|
2173
2167
|
},
|
|
2174
2168
|
m(l, a) {
|
|
2175
|
-
|
|
2176
|
-
|
|
2169
|
+
B(l, t, a), r && r.m(t, null), n = !0, o || (i = [
|
|
2170
|
+
H(
|
|
2177
2171
|
t,
|
|
2178
2172
|
"pointerup",
|
|
2179
2173
|
/*onRelease*/
|
|
2180
2174
|
e[2]
|
|
2181
2175
|
),
|
|
2182
|
-
|
|
2176
|
+
H(
|
|
2183
2177
|
t,
|
|
2184
2178
|
"pointermove",
|
|
2185
2179
|
/*onPointerMove*/
|
|
@@ -2215,7 +2209,7 @@ function Yo(e) {
|
|
|
2215
2209
|
D(r, l), n = !1;
|
|
2216
2210
|
},
|
|
2217
2211
|
d(l) {
|
|
2218
|
-
l &&
|
|
2212
|
+
l && k(t), r && r.d(l), o = !1, le(i);
|
|
2219
2213
|
}
|
|
2220
2214
|
};
|
|
2221
2215
|
}
|
|
@@ -2223,23 +2217,23 @@ function Co(e, t, n) {
|
|
|
2223
2217
|
let { $$slots: o = {}, $$scope: i } = t;
|
|
2224
2218
|
const s = Te();
|
|
2225
2219
|
let { shape: r } = t, { editor: l } = t, { transform: a } = t, c, u, f;
|
|
2226
|
-
const
|
|
2227
|
-
c =
|
|
2228
|
-
}, g = (
|
|
2220
|
+
const d = (y) => (E) => {
|
|
2221
|
+
c = y, u = a.elementToImage(E.offsetX, E.offsetY), f = r, E.target.setPointerCapture(E.pointerId), s("grab", E);
|
|
2222
|
+
}, g = (y) => {
|
|
2229
2223
|
if (c) {
|
|
2230
|
-
const [
|
|
2231
|
-
n(3, r = l(f, c,
|
|
2224
|
+
const [E, p] = a.elementToImage(y.offsetX, y.offsetY), S = [E - u[0], p - u[1]];
|
|
2225
|
+
n(3, r = l(f, c, S)), s("change", r);
|
|
2232
2226
|
}
|
|
2233
|
-
}, m = (
|
|
2234
|
-
|
|
2227
|
+
}, m = (y) => {
|
|
2228
|
+
y.target.releasePointerCapture(y.pointerId), c = void 0, f = r, s("release", y);
|
|
2235
2229
|
};
|
|
2236
|
-
return e.$$set = (
|
|
2237
|
-
"shape" in
|
|
2238
|
-
}, [
|
|
2230
|
+
return e.$$set = (y) => {
|
|
2231
|
+
"shape" in y && n(3, r = y.shape), "editor" in y && n(4, l = y.editor), "transform" in y && n(5, a = y.transform), "$$scope" in y && n(6, i = y.$$scope);
|
|
2232
|
+
}, [d, g, m, r, l, a, i, o];
|
|
2239
2233
|
}
|
|
2240
2234
|
class Qt extends te {
|
|
2241
2235
|
constructor(t) {
|
|
2242
|
-
super(), ee(this, t, Co, Yo,
|
|
2236
|
+
super(), ee(this, t, Co, Yo, K, { shape: 3, editor: 4, transform: 5 });
|
|
2243
2237
|
}
|
|
2244
2238
|
}
|
|
2245
2239
|
const je = (e, t) => {
|
|
@@ -2254,7 +2248,7 @@ function Do(e, t, n) {
|
|
|
2254
2248
|
let o;
|
|
2255
2249
|
const i = Te();
|
|
2256
2250
|
let { annotation: s } = t, { editor: r } = t, { style: l } = t, { target: a } = t, { transform: c } = t, { viewportScale: u } = t, f;
|
|
2257
|
-
return
|
|
2251
|
+
return Ye(() => (n(6, f = new r({
|
|
2258
2252
|
target: a,
|
|
2259
2253
|
props: {
|
|
2260
2254
|
shape: s.target.selector,
|
|
@@ -2262,12 +2256,12 @@ function Do(e, t, n) {
|
|
|
2262
2256
|
transform: c,
|
|
2263
2257
|
viewportScale: u
|
|
2264
2258
|
}
|
|
2265
|
-
})), f.$on("change", (
|
|
2266
|
-
f.$$set({ shape:
|
|
2267
|
-
}), f.$on("grab", (
|
|
2259
|
+
})), f.$on("change", (d) => {
|
|
2260
|
+
f.$$set({ shape: d.detail }), i("change", d.detail);
|
|
2261
|
+
}), f.$on("grab", (d) => i("grab", d.detail)), f.$on("release", (d) => i("release", d.detail)), () => {
|
|
2268
2262
|
f.$destroy();
|
|
2269
|
-
})), e.$$set = (
|
|
2270
|
-
"annotation" in
|
|
2263
|
+
})), e.$$set = (d) => {
|
|
2264
|
+
"annotation" in d && n(0, s = d.annotation), "editor" in d && n(1, r = d.editor), "style" in d && n(2, l = d.style), "target" in d && n(3, a = d.target), "transform" in d && n(4, c = d.transform), "viewportScale" in d && n(5, u = d.viewportScale);
|
|
2271
2265
|
}, e.$$.update = () => {
|
|
2272
2266
|
e.$$.dirty & /*annotation, style*/
|
|
2273
2267
|
5 && (o = je(s, l)), e.$$.dirty & /*annotation, editorComponent*/
|
|
@@ -2278,7 +2272,7 @@ function Do(e, t, n) {
|
|
|
2278
2272
|
}
|
|
2279
2273
|
class Xo extends te {
|
|
2280
2274
|
constructor(t) {
|
|
2281
|
-
super(), ee(this, t, Do, null,
|
|
2275
|
+
super(), ee(this, t, Do, null, K, {
|
|
2282
2276
|
annotation: 0,
|
|
2283
2277
|
editor: 1,
|
|
2284
2278
|
style: 2,
|
|
@@ -2291,14 +2285,14 @@ class Xo extends te {
|
|
|
2291
2285
|
function Ro(e, t, n) {
|
|
2292
2286
|
const o = Te();
|
|
2293
2287
|
let { drawingMode: i } = t, { target: s } = t, { tool: r } = t, { transform: l } = t, { viewportScale: a } = t, c;
|
|
2294
|
-
return
|
|
2295
|
-
const u = s.closest("svg"), f = [],
|
|
2296
|
-
u == null || u.addEventListener(g, m,
|
|
2288
|
+
return Ye(() => {
|
|
2289
|
+
const u = s.closest("svg"), f = [], d = (g, m, y) => {
|
|
2290
|
+
u == null || u.addEventListener(g, m, y), f.push(() => u == null ? void 0 : u.removeEventListener(g, m, y));
|
|
2297
2291
|
};
|
|
2298
2292
|
return n(5, c = new r({
|
|
2299
2293
|
target: s,
|
|
2300
2294
|
props: {
|
|
2301
|
-
addEventListener:
|
|
2295
|
+
addEventListener: d,
|
|
2302
2296
|
drawingMode: i,
|
|
2303
2297
|
transform: l,
|
|
2304
2298
|
viewportScale: a
|
|
@@ -2316,7 +2310,7 @@ function Ro(e, t, n) {
|
|
|
2316
2310
|
}
|
|
2317
2311
|
class Uo extends te {
|
|
2318
2312
|
constructor(t) {
|
|
2319
|
-
super(), ee(this, t, Ro, null,
|
|
2313
|
+
super(), ee(this, t, Ro, null, K, {
|
|
2320
2314
|
drawingMode: 0,
|
|
2321
2315
|
target: 1,
|
|
2322
2316
|
tool: 2,
|
|
@@ -2329,42 +2323,42 @@ function Tt(e) {
|
|
|
2329
2323
|
let t, n;
|
|
2330
2324
|
return {
|
|
2331
2325
|
c() {
|
|
2332
|
-
t =
|
|
2326
|
+
t = X("rect"), n = X("rect"), h(t, "class", "a9s-outer"), h(
|
|
2333
2327
|
t,
|
|
2334
2328
|
"x",
|
|
2335
2329
|
/*x*/
|
|
2336
2330
|
e[1]
|
|
2337
|
-
),
|
|
2331
|
+
), h(
|
|
2338
2332
|
t,
|
|
2339
2333
|
"y",
|
|
2340
2334
|
/*y*/
|
|
2341
2335
|
e[2]
|
|
2342
|
-
),
|
|
2336
|
+
), h(
|
|
2343
2337
|
t,
|
|
2344
2338
|
"width",
|
|
2345
2339
|
/*w*/
|
|
2346
2340
|
e[3]
|
|
2347
|
-
),
|
|
2341
|
+
), h(
|
|
2348
2342
|
t,
|
|
2349
2343
|
"height",
|
|
2350
2344
|
/*h*/
|
|
2351
2345
|
e[4]
|
|
2352
|
-
),
|
|
2346
|
+
), h(n, "class", "a9s-inner"), h(
|
|
2353
2347
|
n,
|
|
2354
2348
|
"x",
|
|
2355
2349
|
/*x*/
|
|
2356
2350
|
e[1]
|
|
2357
|
-
),
|
|
2351
|
+
), h(
|
|
2358
2352
|
n,
|
|
2359
2353
|
"y",
|
|
2360
2354
|
/*y*/
|
|
2361
2355
|
e[2]
|
|
2362
|
-
),
|
|
2356
|
+
), h(
|
|
2363
2357
|
n,
|
|
2364
2358
|
"width",
|
|
2365
2359
|
/*w*/
|
|
2366
2360
|
e[3]
|
|
2367
|
-
),
|
|
2361
|
+
), h(
|
|
2368
2362
|
n,
|
|
2369
2363
|
"height",
|
|
2370
2364
|
/*h*/
|
|
@@ -2372,53 +2366,53 @@ function Tt(e) {
|
|
|
2372
2366
|
);
|
|
2373
2367
|
},
|
|
2374
2368
|
m(o, i) {
|
|
2375
|
-
|
|
2369
|
+
B(o, t, i), B(o, n, i);
|
|
2376
2370
|
},
|
|
2377
2371
|
p(o, i) {
|
|
2378
2372
|
i & /*x*/
|
|
2379
|
-
2 &&
|
|
2373
|
+
2 && h(
|
|
2380
2374
|
t,
|
|
2381
2375
|
"x",
|
|
2382
2376
|
/*x*/
|
|
2383
2377
|
o[1]
|
|
2384
2378
|
), i & /*y*/
|
|
2385
|
-
4 &&
|
|
2379
|
+
4 && h(
|
|
2386
2380
|
t,
|
|
2387
2381
|
"y",
|
|
2388
2382
|
/*y*/
|
|
2389
2383
|
o[2]
|
|
2390
2384
|
), i & /*w*/
|
|
2391
|
-
8 &&
|
|
2385
|
+
8 && h(
|
|
2392
2386
|
t,
|
|
2393
2387
|
"width",
|
|
2394
2388
|
/*w*/
|
|
2395
2389
|
o[3]
|
|
2396
2390
|
), i & /*h*/
|
|
2397
|
-
16 &&
|
|
2391
|
+
16 && h(
|
|
2398
2392
|
t,
|
|
2399
2393
|
"height",
|
|
2400
2394
|
/*h*/
|
|
2401
2395
|
o[4]
|
|
2402
2396
|
), i & /*x*/
|
|
2403
|
-
2 &&
|
|
2397
|
+
2 && h(
|
|
2404
2398
|
n,
|
|
2405
2399
|
"x",
|
|
2406
2400
|
/*x*/
|
|
2407
2401
|
o[1]
|
|
2408
2402
|
), i & /*y*/
|
|
2409
|
-
4 &&
|
|
2403
|
+
4 && h(
|
|
2410
2404
|
n,
|
|
2411
2405
|
"y",
|
|
2412
2406
|
/*y*/
|
|
2413
2407
|
o[2]
|
|
2414
2408
|
), i & /*w*/
|
|
2415
|
-
8 &&
|
|
2409
|
+
8 && h(
|
|
2416
2410
|
n,
|
|
2417
2411
|
"width",
|
|
2418
2412
|
/*w*/
|
|
2419
2413
|
o[3]
|
|
2420
2414
|
), i & /*h*/
|
|
2421
|
-
16 &&
|
|
2415
|
+
16 && h(
|
|
2422
2416
|
n,
|
|
2423
2417
|
"height",
|
|
2424
2418
|
/*h*/
|
|
@@ -2426,7 +2420,7 @@ function Tt(e) {
|
|
|
2426
2420
|
);
|
|
2427
2421
|
},
|
|
2428
2422
|
d(o) {
|
|
2429
|
-
o && (
|
|
2423
|
+
o && (k(t), k(n));
|
|
2430
2424
|
}
|
|
2431
2425
|
};
|
|
2432
2426
|
}
|
|
@@ -2437,69 +2431,69 @@ function No(e) {
|
|
|
2437
2431
|
);
|
|
2438
2432
|
return {
|
|
2439
2433
|
c() {
|
|
2440
|
-
t =
|
|
2434
|
+
t = X("g"), n && n.c(), h(t, "class", "a9s-annotation a9s-rubberband");
|
|
2441
2435
|
},
|
|
2442
2436
|
m(o, i) {
|
|
2443
|
-
|
|
2437
|
+
B(o, t, i), n && n.m(t, null);
|
|
2444
2438
|
},
|
|
2445
2439
|
p(o, [i]) {
|
|
2446
2440
|
/*origin*/
|
|
2447
2441
|
o[0] ? n ? n.p(o, i) : (n = Tt(o), n.c(), n.m(t, null)) : n && (n.d(1), n = null);
|
|
2448
2442
|
},
|
|
2449
|
-
i:
|
|
2450
|
-
o:
|
|
2443
|
+
i: G,
|
|
2444
|
+
o: G,
|
|
2451
2445
|
d(o) {
|
|
2452
|
-
o &&
|
|
2446
|
+
o && k(t), n && n.d();
|
|
2453
2447
|
}
|
|
2454
2448
|
};
|
|
2455
2449
|
}
|
|
2456
2450
|
function Vo(e, t, n) {
|
|
2457
2451
|
const o = Te();
|
|
2458
|
-
let { addEventListener: i } = t, { drawingMode: s } = t, { transform: r } = t, l, a, c, u, f,
|
|
2459
|
-
const m = (
|
|
2460
|
-
const w =
|
|
2461
|
-
l = performance.now(), s === "drag" && (n(0, a = r.elementToImage(w.offsetX, w.offsetY)), c = a, n(1, u = a[0]), n(2, f = a[1]), n(3,
|
|
2462
|
-
},
|
|
2463
|
-
const w =
|
|
2464
|
-
a && (c = r.elementToImage(w.offsetX, w.offsetY), n(1, u = Math.min(c[0], a[0])), n(2, f = Math.min(c[1], a[1])), n(3,
|
|
2465
|
-
},
|
|
2466
|
-
const w =
|
|
2452
|
+
let { addEventListener: i } = t, { drawingMode: s } = t, { transform: r } = t, l, a, c, u, f, d, g;
|
|
2453
|
+
const m = (S) => {
|
|
2454
|
+
const w = S;
|
|
2455
|
+
l = performance.now(), s === "drag" && (n(0, a = r.elementToImage(w.offsetX, w.offsetY)), c = a, n(1, u = a[0]), n(2, f = a[1]), n(3, d = 1), n(4, g = 1));
|
|
2456
|
+
}, y = (S) => {
|
|
2457
|
+
const w = S;
|
|
2458
|
+
a && (c = r.elementToImage(w.offsetX, w.offsetY), n(1, u = Math.min(c[0], a[0])), n(2, f = Math.min(c[1], a[1])), n(3, d = Math.abs(c[0] - a[0])), n(4, g = Math.abs(c[1] - a[1])));
|
|
2459
|
+
}, E = (S) => {
|
|
2460
|
+
const w = S, A = performance.now() - l;
|
|
2467
2461
|
if (s === "click") {
|
|
2468
|
-
if (
|
|
2462
|
+
if (A > 300)
|
|
2469
2463
|
return;
|
|
2470
|
-
w.stopPropagation(), a ?
|
|
2464
|
+
w.stopPropagation(), a ? p() : (n(0, a = r.elementToImage(w.offsetX, w.offsetY)), c = a, n(1, u = a[0]), n(2, f = a[1]), n(3, d = 1), n(4, g = 1));
|
|
2471
2465
|
} else
|
|
2472
|
-
a && (
|
|
2473
|
-
},
|
|
2474
|
-
if (
|
|
2475
|
-
const
|
|
2476
|
-
type:
|
|
2466
|
+
a && (A > 300 || d * g > 100 ? (w.stopPropagation(), p()) : (n(0, a = void 0), c = void 0));
|
|
2467
|
+
}, p = () => {
|
|
2468
|
+
if (d * g > 15) {
|
|
2469
|
+
const S = {
|
|
2470
|
+
type: F.RECTANGLE,
|
|
2477
2471
|
geometry: {
|
|
2478
2472
|
bounds: {
|
|
2479
2473
|
minX: u,
|
|
2480
2474
|
minY: f,
|
|
2481
|
-
maxX: u +
|
|
2475
|
+
maxX: u + d,
|
|
2482
2476
|
maxY: f + g
|
|
2483
2477
|
},
|
|
2484
2478
|
x: u,
|
|
2485
2479
|
y: f,
|
|
2486
|
-
w:
|
|
2480
|
+
w: d,
|
|
2487
2481
|
h: g
|
|
2488
2482
|
}
|
|
2489
2483
|
};
|
|
2490
|
-
o("create",
|
|
2484
|
+
o("create", S);
|
|
2491
2485
|
}
|
|
2492
2486
|
n(0, a = void 0), c = void 0;
|
|
2493
2487
|
};
|
|
2494
|
-
return
|
|
2495
|
-
i("pointerdown", m), i("pointermove",
|
|
2496
|
-
}), e.$$set = (
|
|
2497
|
-
"addEventListener" in
|
|
2498
|
-
}, [a, u, f,
|
|
2488
|
+
return Ye(() => {
|
|
2489
|
+
i("pointerdown", m), i("pointermove", y), i("pointerup", E, !0);
|
|
2490
|
+
}), e.$$set = (S) => {
|
|
2491
|
+
"addEventListener" in S && n(5, i = S.addEventListener), "drawingMode" in S && n(6, s = S.drawingMode), "transform" in S && n(7, r = S.transform);
|
|
2492
|
+
}, [a, u, f, d, g, i, s, r];
|
|
2499
2493
|
}
|
|
2500
2494
|
class Go extends te {
|
|
2501
2495
|
constructor(t) {
|
|
2502
|
-
super(), ee(this, t, Vo, No,
|
|
2496
|
+
super(), ee(this, t, Vo, No, K, {
|
|
2503
2497
|
addEventListener: 5,
|
|
2504
2498
|
drawingMode: 6,
|
|
2505
2499
|
transform: 7
|
|
@@ -2528,23 +2522,23 @@ function Mt(e) {
|
|
|
2528
2522
|
);
|
|
2529
2523
|
return {
|
|
2530
2524
|
c() {
|
|
2531
|
-
t =
|
|
2532
|
-
e[16]),
|
|
2525
|
+
t = X("polygon"), o = X("polygon"), r && r.c(), s = ae(), h(t, "class", "a9s-outer"), h(t, "points", n = /*coords*/
|
|
2526
|
+
e[16]), h(o, "class", "a9s-inner"), h(o, "points", i = /*coords*/
|
|
2533
2527
|
e[16]);
|
|
2534
2528
|
},
|
|
2535
2529
|
m(l, a) {
|
|
2536
|
-
|
|
2530
|
+
B(l, t, a), B(l, o, a), r && r.m(l, a), B(l, s, a);
|
|
2537
2531
|
},
|
|
2538
2532
|
p(l, a) {
|
|
2539
2533
|
a & /*isClosable, points, cursor*/
|
|
2540
2534
|
7 && n !== (n = /*coords*/
|
|
2541
|
-
l[16]) &&
|
|
2535
|
+
l[16]) && h(t, "points", n), a & /*isClosable, points, cursor*/
|
|
2542
2536
|
7 && i !== (i = /*coords*/
|
|
2543
|
-
l[16]) &&
|
|
2537
|
+
l[16]) && h(o, "points", i), /*isClosable*/
|
|
2544
2538
|
l[2] ? r ? r.p(l, a) : (r = vt(l), r.c(), r.m(s.parentNode, s)) : r && (r.d(1), r = null);
|
|
2545
2539
|
},
|
|
2546
2540
|
d(l) {
|
|
2547
|
-
l && (
|
|
2541
|
+
l && (k(t), k(o), k(s)), r && r.d(l);
|
|
2548
2542
|
}
|
|
2549
2543
|
};
|
|
2550
2544
|
}
|
|
@@ -2552,16 +2546,16 @@ function vt(e) {
|
|
|
2552
2546
|
let t, n, o;
|
|
2553
2547
|
return {
|
|
2554
2548
|
c() {
|
|
2555
|
-
t =
|
|
2549
|
+
t = X("rect"), h(t, "class", "a9s-corner-handle"), h(t, "x", n = /*points*/
|
|
2556
2550
|
e[0][0][0] - /*handleSize*/
|
|
2557
|
-
e[3] / 2),
|
|
2551
|
+
e[3] / 2), h(t, "y", o = /*points*/
|
|
2558
2552
|
e[0][0][1] - /*handleSize*/
|
|
2559
|
-
e[3] / 2),
|
|
2553
|
+
e[3] / 2), h(
|
|
2560
2554
|
t,
|
|
2561
2555
|
"height",
|
|
2562
2556
|
/*handleSize*/
|
|
2563
2557
|
e[3]
|
|
2564
|
-
),
|
|
2558
|
+
), h(
|
|
2565
2559
|
t,
|
|
2566
2560
|
"width",
|
|
2567
2561
|
/*handleSize*/
|
|
@@ -2569,23 +2563,23 @@ function vt(e) {
|
|
|
2569
2563
|
);
|
|
2570
2564
|
},
|
|
2571
2565
|
m(i, s) {
|
|
2572
|
-
|
|
2566
|
+
B(i, t, s);
|
|
2573
2567
|
},
|
|
2574
2568
|
p(i, s) {
|
|
2575
2569
|
s & /*points, handleSize*/
|
|
2576
2570
|
9 && n !== (n = /*points*/
|
|
2577
2571
|
i[0][0][0] - /*handleSize*/
|
|
2578
|
-
i[3] / 2) &&
|
|
2572
|
+
i[3] / 2) && h(t, "x", n), s & /*points, handleSize*/
|
|
2579
2573
|
9 && o !== (o = /*points*/
|
|
2580
2574
|
i[0][0][1] - /*handleSize*/
|
|
2581
|
-
i[3] / 2) &&
|
|
2582
|
-
8 &&
|
|
2575
|
+
i[3] / 2) && h(t, "y", o), s & /*handleSize*/
|
|
2576
|
+
8 && h(
|
|
2583
2577
|
t,
|
|
2584
2578
|
"height",
|
|
2585
2579
|
/*handleSize*/
|
|
2586
2580
|
i[3]
|
|
2587
2581
|
), s & /*handleSize*/
|
|
2588
|
-
8 &&
|
|
2582
|
+
8 && h(
|
|
2589
2583
|
t,
|
|
2590
2584
|
"width",
|
|
2591
2585
|
/*handleSize*/
|
|
@@ -2593,7 +2587,7 @@ function vt(e) {
|
|
|
2593
2587
|
);
|
|
2594
2588
|
},
|
|
2595
2589
|
d(i) {
|
|
2596
|
-
i &&
|
|
2590
|
+
i && k(t);
|
|
2597
2591
|
}
|
|
2598
2592
|
};
|
|
2599
2593
|
}
|
|
@@ -2604,19 +2598,19 @@ function zo(e) {
|
|
|
2604
2598
|
);
|
|
2605
2599
|
return {
|
|
2606
2600
|
c() {
|
|
2607
|
-
t =
|
|
2601
|
+
t = X("g"), n && n.c(), h(t, "class", "a9s-annotation a9s-rubberband");
|
|
2608
2602
|
},
|
|
2609
2603
|
m(o, i) {
|
|
2610
|
-
|
|
2604
|
+
B(o, t, i), n && n.m(t, null);
|
|
2611
2605
|
},
|
|
2612
2606
|
p(o, [i]) {
|
|
2613
2607
|
/*cursor*/
|
|
2614
2608
|
o[1] ? n ? n.p(xe(o), i) : (n = Mt(xe(o)), n.c(), n.m(t, null)) : n && (n.d(1), n = null);
|
|
2615
2609
|
},
|
|
2616
|
-
i:
|
|
2617
|
-
o:
|
|
2610
|
+
i: G,
|
|
2611
|
+
o: G,
|
|
2618
2612
|
d(o) {
|
|
2619
|
-
o &&
|
|
2613
|
+
o && k(t), n && n.d();
|
|
2620
2614
|
}
|
|
2621
2615
|
};
|
|
2622
2616
|
}
|
|
@@ -2624,38 +2618,38 @@ const Ho = 20, Fo = 1500;
|
|
|
2624
2618
|
function jo(e, t, n) {
|
|
2625
2619
|
let o;
|
|
2626
2620
|
const i = Te();
|
|
2627
|
-
let { addEventListener: s } = t, { drawingMode: r } = t, { transform: l } = t, { viewportScale: a = 1 } = t, c, u = [], f,
|
|
2621
|
+
let { addEventListener: s } = t, { drawingMode: r } = t, { transform: l } = t, { viewportScale: a = 1 } = t, c, u = [], f, d, g = !1;
|
|
2628
2622
|
const m = (w) => {
|
|
2629
|
-
const
|
|
2630
|
-
if (c = { timeStamp:
|
|
2631
|
-
const
|
|
2632
|
-
u.push(
|
|
2623
|
+
const A = w, { timeStamp: I, offsetX: N, offsetY: U } = A;
|
|
2624
|
+
if (c = { timeStamp: I, offsetX: N, offsetY: U }, r === "drag" && u.length === 0) {
|
|
2625
|
+
const _ = l.elementToImage(A.offsetX, A.offsetY);
|
|
2626
|
+
u.push(_), n(1, f = _);
|
|
2633
2627
|
}
|
|
2634
|
-
},
|
|
2635
|
-
const
|
|
2636
|
-
if (
|
|
2637
|
-
if (n(1, f = l.elementToImage(
|
|
2638
|
-
const
|
|
2639
|
-
n(2, g =
|
|
2628
|
+
}, y = (w) => {
|
|
2629
|
+
const A = w;
|
|
2630
|
+
if (d && clearTimeout(d), u.length > 0) {
|
|
2631
|
+
if (n(1, f = l.elementToImage(A.offsetX, A.offsetY)), u.length > 2) {
|
|
2632
|
+
const I = Qe(f, u[0]) * a;
|
|
2633
|
+
n(2, g = I < Ho);
|
|
2640
2634
|
}
|
|
2641
|
-
|
|
2635
|
+
A.pointerType === "touch" && (d = setTimeout(
|
|
2642
2636
|
() => {
|
|
2643
|
-
|
|
2637
|
+
p();
|
|
2644
2638
|
},
|
|
2645
2639
|
Fo
|
|
2646
2640
|
));
|
|
2647
2641
|
}
|
|
2648
|
-
},
|
|
2649
|
-
const
|
|
2650
|
-
if (
|
|
2651
|
-
const
|
|
2652
|
-
if (
|
|
2642
|
+
}, E = (w) => {
|
|
2643
|
+
const A = w;
|
|
2644
|
+
if (d && clearTimeout(d), r === "click") {
|
|
2645
|
+
const I = A.timeStamp - c.timeStamp, N = Qe([c.offsetX, c.offsetY], [A.offsetX, A.offsetY]);
|
|
2646
|
+
if (I > 300 || N > 15)
|
|
2653
2647
|
return;
|
|
2654
2648
|
if (g)
|
|
2655
|
-
|
|
2649
|
+
S();
|
|
2656
2650
|
else if (u.length === 0) {
|
|
2657
|
-
const
|
|
2658
|
-
u.push(
|
|
2651
|
+
const U = l.elementToImage(A.offsetX, A.offsetY);
|
|
2652
|
+
u.push(U), n(1, f = U);
|
|
2659
2653
|
} else
|
|
2660
2654
|
u.push(f);
|
|
2661
2655
|
} else {
|
|
@@ -2663,19 +2657,19 @@ function jo(e, t, n) {
|
|
|
2663
2657
|
n(0, u = []), n(1, f = void 0);
|
|
2664
2658
|
return;
|
|
2665
2659
|
}
|
|
2666
|
-
|
|
2660
|
+
A.stopImmediatePropagation(), g ? S() : u.push(f);
|
|
2667
2661
|
}
|
|
2668
|
-
},
|
|
2662
|
+
}, p = () => {
|
|
2669
2663
|
if (!f)
|
|
2670
2664
|
return;
|
|
2671
|
-
const w = [...u, f],
|
|
2672
|
-
type:
|
|
2665
|
+
const w = [...u, f], A = {
|
|
2666
|
+
type: F.POLYGON,
|
|
2673
2667
|
geometry: { bounds: Fe(w), points: w }
|
|
2674
2668
|
};
|
|
2675
|
-
st(
|
|
2676
|
-
},
|
|
2669
|
+
st(A) > 4 && (n(0, u = []), n(1, f = void 0), i("create", A));
|
|
2670
|
+
}, S = () => {
|
|
2677
2671
|
const w = {
|
|
2678
|
-
type:
|
|
2672
|
+
type: F.POLYGON,
|
|
2679
2673
|
geometry: {
|
|
2680
2674
|
bounds: Fe(u),
|
|
2681
2675
|
points: [...u]
|
|
@@ -2683,8 +2677,8 @@ function jo(e, t, n) {
|
|
|
2683
2677
|
};
|
|
2684
2678
|
n(0, u = []), n(1, f = void 0), i("create", w);
|
|
2685
2679
|
};
|
|
2686
|
-
return
|
|
2687
|
-
s("pointerdown", m, !0), s("pointermove",
|
|
2680
|
+
return Ye(() => {
|
|
2681
|
+
s("pointerdown", m, !0), s("pointermove", y), s("pointerup", E, !0), s("dblclick", p, !0);
|
|
2688
2682
|
}), e.$$set = (w) => {
|
|
2689
2683
|
"addEventListener" in w && n(4, s = w.addEventListener), "drawingMode" in w && n(5, r = w.drawingMode), "transform" in w && n(6, l = w.transform), "viewportScale" in w && n(7, a = w.viewportScale);
|
|
2690
2684
|
}, e.$$.update = () => {
|
|
@@ -2703,7 +2697,7 @@ function jo(e, t, n) {
|
|
|
2703
2697
|
}
|
|
2704
2698
|
class qo extends te {
|
|
2705
2699
|
constructor(t) {
|
|
2706
|
-
super(), ee(this, t, jo, zo,
|
|
2700
|
+
super(), ee(this, t, jo, zo, K, {
|
|
2707
2701
|
addEventListener: 4,
|
|
2708
2702
|
drawingMode: 5,
|
|
2709
2703
|
transform: 6,
|
|
@@ -2719,75 +2713,75 @@ function Wo(e) {
|
|
|
2719
2713
|
let t, n, o, i, s;
|
|
2720
2714
|
return {
|
|
2721
2715
|
c() {
|
|
2722
|
-
t =
|
|
2723
|
-
e[1] ? "display:none;" : void 0),
|
|
2716
|
+
t = X("g"), n = X("ellipse"), i = X("ellipse"), h(n, "class", "a9s-outer"), h(n, "style", o = /*computedStyle*/
|
|
2717
|
+
e[1] ? "display:none;" : void 0), h(
|
|
2724
2718
|
n,
|
|
2725
2719
|
"cx",
|
|
2726
2720
|
/*cx*/
|
|
2727
2721
|
e[2]
|
|
2728
|
-
),
|
|
2722
|
+
), h(
|
|
2729
2723
|
n,
|
|
2730
2724
|
"cy",
|
|
2731
2725
|
/*cy*/
|
|
2732
2726
|
e[3]
|
|
2733
|
-
),
|
|
2727
|
+
), h(
|
|
2734
2728
|
n,
|
|
2735
2729
|
"rx",
|
|
2736
2730
|
/*rx*/
|
|
2737
2731
|
e[4]
|
|
2738
|
-
),
|
|
2732
|
+
), h(
|
|
2739
2733
|
n,
|
|
2740
2734
|
"ry",
|
|
2741
2735
|
/*ry*/
|
|
2742
2736
|
e[5]
|
|
2743
|
-
),
|
|
2737
|
+
), h(i, "class", "a9s-inner"), h(
|
|
2744
2738
|
i,
|
|
2745
2739
|
"style",
|
|
2746
2740
|
/*computedStyle*/
|
|
2747
2741
|
e[1]
|
|
2748
|
-
),
|
|
2742
|
+
), h(
|
|
2749
2743
|
i,
|
|
2750
2744
|
"cx",
|
|
2751
2745
|
/*cx*/
|
|
2752
2746
|
e[2]
|
|
2753
|
-
),
|
|
2747
|
+
), h(
|
|
2754
2748
|
i,
|
|
2755
2749
|
"cy",
|
|
2756
2750
|
/*cy*/
|
|
2757
2751
|
e[3]
|
|
2758
|
-
),
|
|
2752
|
+
), h(
|
|
2759
2753
|
i,
|
|
2760
2754
|
"rx",
|
|
2761
2755
|
/*rx*/
|
|
2762
2756
|
e[4]
|
|
2763
|
-
),
|
|
2757
|
+
), h(
|
|
2764
2758
|
i,
|
|
2765
2759
|
"ry",
|
|
2766
2760
|
/*ry*/
|
|
2767
2761
|
e[5]
|
|
2768
|
-
),
|
|
2762
|
+
), h(t, "data-id", s = /*annotation*/
|
|
2769
2763
|
e[0].id);
|
|
2770
2764
|
},
|
|
2771
2765
|
m(r, l) {
|
|
2772
|
-
|
|
2766
|
+
B(r, t, l), ie(t, n), ie(t, i);
|
|
2773
2767
|
},
|
|
2774
2768
|
p(r, [l]) {
|
|
2775
2769
|
l & /*computedStyle*/
|
|
2776
2770
|
2 && o !== (o = /*computedStyle*/
|
|
2777
|
-
r[1] ? "display:none;" : void 0) &&
|
|
2778
|
-
2 &&
|
|
2771
|
+
r[1] ? "display:none;" : void 0) && h(n, "style", o), l & /*computedStyle*/
|
|
2772
|
+
2 && h(
|
|
2779
2773
|
i,
|
|
2780
2774
|
"style",
|
|
2781
2775
|
/*computedStyle*/
|
|
2782
2776
|
r[1]
|
|
2783
2777
|
), l & /*annotation*/
|
|
2784
2778
|
1 && s !== (s = /*annotation*/
|
|
2785
|
-
r[0].id) &&
|
|
2779
|
+
r[0].id) && h(t, "data-id", s);
|
|
2786
2780
|
},
|
|
2787
|
-
i:
|
|
2788
|
-
o:
|
|
2781
|
+
i: G,
|
|
2782
|
+
o: G,
|
|
2789
2783
|
d(r) {
|
|
2790
|
-
r &&
|
|
2784
|
+
r && k(t);
|
|
2791
2785
|
}
|
|
2792
2786
|
};
|
|
2793
2787
|
}
|
|
@@ -2803,52 +2797,52 @@ function Jo(e, t, n) {
|
|
|
2803
2797
|
}
|
|
2804
2798
|
class Zo extends te {
|
|
2805
2799
|
constructor(t) {
|
|
2806
|
-
super(), ee(this, t, Jo, Wo,
|
|
2800
|
+
super(), ee(this, t, Jo, Wo, K, { annotation: 0, geom: 6, style: 7 });
|
|
2807
2801
|
}
|
|
2808
2802
|
}
|
|
2809
2803
|
function Qo(e) {
|
|
2810
2804
|
let t, n, o, i, s;
|
|
2811
2805
|
return {
|
|
2812
2806
|
c() {
|
|
2813
|
-
t =
|
|
2814
|
-
e[1] ? "display:none;" : void 0),
|
|
2807
|
+
t = X("g"), n = X("polygon"), i = X("polygon"), h(n, "class", "a9s-outer"), h(n, "style", o = /*computedStyle*/
|
|
2808
|
+
e[1] ? "display:none;" : void 0), h(
|
|
2815
2809
|
n,
|
|
2816
2810
|
"points",
|
|
2817
2811
|
/*points*/
|
|
2818
2812
|
e[2].map(xo).join(" ")
|
|
2819
|
-
),
|
|
2813
|
+
), h(i, "class", "a9s-inner"), h(
|
|
2820
2814
|
i,
|
|
2821
2815
|
"style",
|
|
2822
2816
|
/*computedStyle*/
|
|
2823
2817
|
e[1]
|
|
2824
|
-
),
|
|
2818
|
+
), h(
|
|
2825
2819
|
i,
|
|
2826
2820
|
"points",
|
|
2827
2821
|
/*points*/
|
|
2828
2822
|
e[2].map($o).join(" ")
|
|
2829
|
-
),
|
|
2823
|
+
), h(t, "data-id", s = /*annotation*/
|
|
2830
2824
|
e[0].id);
|
|
2831
2825
|
},
|
|
2832
2826
|
m(r, l) {
|
|
2833
|
-
|
|
2827
|
+
B(r, t, l), ie(t, n), ie(t, i);
|
|
2834
2828
|
},
|
|
2835
2829
|
p(r, [l]) {
|
|
2836
2830
|
l & /*computedStyle*/
|
|
2837
2831
|
2 && o !== (o = /*computedStyle*/
|
|
2838
|
-
r[1] ? "display:none;" : void 0) &&
|
|
2839
|
-
2 &&
|
|
2832
|
+
r[1] ? "display:none;" : void 0) && h(n, "style", o), l & /*computedStyle*/
|
|
2833
|
+
2 && h(
|
|
2840
2834
|
i,
|
|
2841
2835
|
"style",
|
|
2842
2836
|
/*computedStyle*/
|
|
2843
2837
|
r[1]
|
|
2844
2838
|
), l & /*annotation*/
|
|
2845
2839
|
1 && s !== (s = /*annotation*/
|
|
2846
|
-
r[0].id) &&
|
|
2840
|
+
r[0].id) && h(t, "data-id", s);
|
|
2847
2841
|
},
|
|
2848
|
-
i:
|
|
2849
|
-
o:
|
|
2842
|
+
i: G,
|
|
2843
|
+
o: G,
|
|
2850
2844
|
d(r) {
|
|
2851
|
-
r &&
|
|
2845
|
+
r && k(t);
|
|
2852
2846
|
}
|
|
2853
2847
|
};
|
|
2854
2848
|
}
|
|
@@ -2865,130 +2859,130 @@ function ei(e, t, n) {
|
|
|
2865
2859
|
}
|
|
2866
2860
|
class ti extends te {
|
|
2867
2861
|
constructor(t) {
|
|
2868
|
-
super(), ee(this, t, ei, Qo,
|
|
2862
|
+
super(), ee(this, t, ei, Qo, K, { annotation: 0, geom: 3, style: 4 });
|
|
2869
2863
|
}
|
|
2870
2864
|
}
|
|
2871
2865
|
function ni(e) {
|
|
2872
2866
|
let t, n, o, i, s;
|
|
2873
2867
|
return {
|
|
2874
2868
|
c() {
|
|
2875
|
-
t =
|
|
2876
|
-
e[5] ? "display:none;" : void 0),
|
|
2869
|
+
t = X("g"), n = X("rect"), i = X("rect"), h(n, "class", "a9s-outer"), h(n, "style", o = /*computedStyle*/
|
|
2870
|
+
e[5] ? "display:none;" : void 0), h(
|
|
2877
2871
|
n,
|
|
2878
2872
|
"x",
|
|
2879
2873
|
/*x*/
|
|
2880
2874
|
e[4]
|
|
2881
|
-
),
|
|
2875
|
+
), h(
|
|
2882
2876
|
n,
|
|
2883
2877
|
"y",
|
|
2884
2878
|
/*y*/
|
|
2885
2879
|
e[3]
|
|
2886
|
-
),
|
|
2880
|
+
), h(
|
|
2887
2881
|
n,
|
|
2888
2882
|
"width",
|
|
2889
2883
|
/*w*/
|
|
2890
2884
|
e[2]
|
|
2891
|
-
),
|
|
2885
|
+
), h(
|
|
2892
2886
|
n,
|
|
2893
2887
|
"height",
|
|
2894
2888
|
/*h*/
|
|
2895
2889
|
e[1]
|
|
2896
|
-
),
|
|
2890
|
+
), h(i, "class", "a9s-inner"), h(
|
|
2897
2891
|
i,
|
|
2898
2892
|
"style",
|
|
2899
2893
|
/*computedStyle*/
|
|
2900
2894
|
e[5]
|
|
2901
|
-
),
|
|
2895
|
+
), h(
|
|
2902
2896
|
i,
|
|
2903
2897
|
"x",
|
|
2904
2898
|
/*x*/
|
|
2905
2899
|
e[4]
|
|
2906
|
-
),
|
|
2900
|
+
), h(
|
|
2907
2901
|
i,
|
|
2908
2902
|
"y",
|
|
2909
2903
|
/*y*/
|
|
2910
2904
|
e[3]
|
|
2911
|
-
),
|
|
2905
|
+
), h(
|
|
2912
2906
|
i,
|
|
2913
2907
|
"width",
|
|
2914
2908
|
/*w*/
|
|
2915
2909
|
e[2]
|
|
2916
|
-
),
|
|
2910
|
+
), h(
|
|
2917
2911
|
i,
|
|
2918
2912
|
"height",
|
|
2919
2913
|
/*h*/
|
|
2920
2914
|
e[1]
|
|
2921
|
-
),
|
|
2915
|
+
), h(t, "data-id", s = /*annotation*/
|
|
2922
2916
|
e[0].id);
|
|
2923
2917
|
},
|
|
2924
2918
|
m(r, l) {
|
|
2925
|
-
|
|
2919
|
+
B(r, t, l), ie(t, n), ie(t, i);
|
|
2926
2920
|
},
|
|
2927
2921
|
p(r, [l]) {
|
|
2928
2922
|
l & /*computedStyle*/
|
|
2929
2923
|
32 && o !== (o = /*computedStyle*/
|
|
2930
|
-
r[5] ? "display:none;" : void 0) &&
|
|
2931
|
-
16 &&
|
|
2924
|
+
r[5] ? "display:none;" : void 0) && h(n, "style", o), l & /*x*/
|
|
2925
|
+
16 && h(
|
|
2932
2926
|
n,
|
|
2933
2927
|
"x",
|
|
2934
2928
|
/*x*/
|
|
2935
2929
|
r[4]
|
|
2936
2930
|
), l & /*y*/
|
|
2937
|
-
8 &&
|
|
2931
|
+
8 && h(
|
|
2938
2932
|
n,
|
|
2939
2933
|
"y",
|
|
2940
2934
|
/*y*/
|
|
2941
2935
|
r[3]
|
|
2942
2936
|
), l & /*w*/
|
|
2943
|
-
4 &&
|
|
2937
|
+
4 && h(
|
|
2944
2938
|
n,
|
|
2945
2939
|
"width",
|
|
2946
2940
|
/*w*/
|
|
2947
2941
|
r[2]
|
|
2948
2942
|
), l & /*h*/
|
|
2949
|
-
2 &&
|
|
2943
|
+
2 && h(
|
|
2950
2944
|
n,
|
|
2951
2945
|
"height",
|
|
2952
2946
|
/*h*/
|
|
2953
2947
|
r[1]
|
|
2954
2948
|
), l & /*computedStyle*/
|
|
2955
|
-
32 &&
|
|
2949
|
+
32 && h(
|
|
2956
2950
|
i,
|
|
2957
2951
|
"style",
|
|
2958
2952
|
/*computedStyle*/
|
|
2959
2953
|
r[5]
|
|
2960
2954
|
), l & /*x*/
|
|
2961
|
-
16 &&
|
|
2955
|
+
16 && h(
|
|
2962
2956
|
i,
|
|
2963
2957
|
"x",
|
|
2964
2958
|
/*x*/
|
|
2965
2959
|
r[4]
|
|
2966
2960
|
), l & /*y*/
|
|
2967
|
-
8 &&
|
|
2961
|
+
8 && h(
|
|
2968
2962
|
i,
|
|
2969
2963
|
"y",
|
|
2970
2964
|
/*y*/
|
|
2971
2965
|
r[3]
|
|
2972
2966
|
), l & /*w*/
|
|
2973
|
-
4 &&
|
|
2967
|
+
4 && h(
|
|
2974
2968
|
i,
|
|
2975
2969
|
"width",
|
|
2976
2970
|
/*w*/
|
|
2977
2971
|
r[2]
|
|
2978
2972
|
), l & /*h*/
|
|
2979
|
-
2 &&
|
|
2973
|
+
2 && h(
|
|
2980
2974
|
i,
|
|
2981
2975
|
"height",
|
|
2982
2976
|
/*h*/
|
|
2983
2977
|
r[1]
|
|
2984
2978
|
), l & /*annotation*/
|
|
2985
2979
|
1 && s !== (s = /*annotation*/
|
|
2986
|
-
r[0].id) &&
|
|
2980
|
+
r[0].id) && h(t, "data-id", s);
|
|
2987
2981
|
},
|
|
2988
|
-
i:
|
|
2989
|
-
o:
|
|
2982
|
+
i: G,
|
|
2983
|
+
o: G,
|
|
2990
2984
|
d(r) {
|
|
2991
|
-
r &&
|
|
2985
|
+
r && k(t);
|
|
2992
2986
|
}
|
|
2993
2987
|
};
|
|
2994
2988
|
}
|
|
@@ -3004,7 +2998,7 @@ function oi(e, t, n) {
|
|
|
3004
2998
|
}
|
|
3005
2999
|
class ii extends te {
|
|
3006
3000
|
constructor(t) {
|
|
3007
|
-
super(), ee(this, t, oi, ni,
|
|
3001
|
+
super(), ee(this, t, oi, ni, K, { annotation: 0, geom: 6, style: 7 });
|
|
3008
3002
|
}
|
|
3009
3003
|
}
|
|
3010
3004
|
const Ci = {
|
|
@@ -3031,35 +3025,35 @@ const Ci = {
|
|
|
3031
3025
|
}, { Boolean: en } = fn;
|
|
3032
3026
|
function Lt(e, t, n) {
|
|
3033
3027
|
const o = e.slice();
|
|
3034
|
-
return o[
|
|
3028
|
+
return o[31] = t[n], o;
|
|
3035
3029
|
}
|
|
3036
3030
|
function kt(e, t, n) {
|
|
3037
3031
|
const o = e.slice();
|
|
3038
|
-
return o[
|
|
3032
|
+
return o[34] = t[n], o;
|
|
3039
3033
|
}
|
|
3040
3034
|
function $e(e) {
|
|
3041
3035
|
const t = e.slice(), n = (
|
|
3042
3036
|
/*annotation*/
|
|
3043
|
-
t[
|
|
3037
|
+
t[34].target.selector
|
|
3044
3038
|
);
|
|
3045
|
-
return t[
|
|
3039
|
+
return t[37] = n, t;
|
|
3046
3040
|
}
|
|
3047
3041
|
function Ot(e) {
|
|
3048
3042
|
let t = (
|
|
3049
3043
|
/*annotation*/
|
|
3050
|
-
e[
|
|
3044
|
+
e[34].id
|
|
3051
3045
|
), n, o, i = Bt(e);
|
|
3052
3046
|
return {
|
|
3053
3047
|
c() {
|
|
3054
|
-
i.c(), n =
|
|
3048
|
+
i.c(), n = ae();
|
|
3055
3049
|
},
|
|
3056
3050
|
m(s, r) {
|
|
3057
|
-
i.m(s, r),
|
|
3051
|
+
i.m(s, r), B(s, n, r), o = !0;
|
|
3058
3052
|
},
|
|
3059
3053
|
p(s, r) {
|
|
3060
3054
|
r[0] & /*$store*/
|
|
3061
|
-
|
|
3062
|
-
s[
|
|
3055
|
+
16384 && K(t, t = /*annotation*/
|
|
3056
|
+
s[34].id) ? (se(), D(i, 1, 1, G), re(), i = Bt(s), i.c(), P(i, 1), i.m(n.parentNode, n)) : i.p(s, r);
|
|
3063
3057
|
},
|
|
3064
3058
|
i(s) {
|
|
3065
3059
|
o || (P(i), o = !0);
|
|
@@ -3068,7 +3062,7 @@ function Ot(e) {
|
|
|
3068
3062
|
D(i), o = !1;
|
|
3069
3063
|
},
|
|
3070
3064
|
d(s) {
|
|
3071
|
-
s &&
|
|
3065
|
+
s && k(n), i.d(s);
|
|
3072
3066
|
}
|
|
3073
3067
|
};
|
|
3074
3068
|
}
|
|
@@ -3078,11 +3072,11 @@ function ci(e) {
|
|
|
3078
3072
|
props: {
|
|
3079
3073
|
annotation: (
|
|
3080
3074
|
/*annotation*/
|
|
3081
|
-
e[
|
|
3075
|
+
e[34]
|
|
3082
3076
|
),
|
|
3083
3077
|
geom: (
|
|
3084
3078
|
/*selector*/
|
|
3085
|
-
e[
|
|
3079
|
+
e[37].geometry
|
|
3086
3080
|
),
|
|
3087
3081
|
style: (
|
|
3088
3082
|
/*style*/
|
|
@@ -3099,10 +3093,10 @@ function ci(e) {
|
|
|
3099
3093
|
p(o, i) {
|
|
3100
3094
|
const s = {};
|
|
3101
3095
|
i[0] & /*$store*/
|
|
3102
|
-
|
|
3103
|
-
o[
|
|
3104
|
-
|
|
3105
|
-
o[
|
|
3096
|
+
16384 && (s.annotation = /*annotation*/
|
|
3097
|
+
o[34]), i[0] & /*$store*/
|
|
3098
|
+
16384 && (s.geom = /*selector*/
|
|
3099
|
+
o[37].geometry), i[0] & /*style*/
|
|
3106
3100
|
2 && (s.style = /*style*/
|
|
3107
3101
|
o[1]), t.$set(s);
|
|
3108
3102
|
},
|
|
@@ -3123,11 +3117,11 @@ function fi(e) {
|
|
|
3123
3117
|
props: {
|
|
3124
3118
|
annotation: (
|
|
3125
3119
|
/*annotation*/
|
|
3126
|
-
e[
|
|
3120
|
+
e[34]
|
|
3127
3121
|
),
|
|
3128
3122
|
geom: (
|
|
3129
3123
|
/*selector*/
|
|
3130
|
-
e[
|
|
3124
|
+
e[37].geometry
|
|
3131
3125
|
),
|
|
3132
3126
|
style: (
|
|
3133
3127
|
/*style*/
|
|
@@ -3144,10 +3138,10 @@ function fi(e) {
|
|
|
3144
3138
|
p(o, i) {
|
|
3145
3139
|
const s = {};
|
|
3146
3140
|
i[0] & /*$store*/
|
|
3147
|
-
|
|
3148
|
-
o[
|
|
3149
|
-
|
|
3150
|
-
o[
|
|
3141
|
+
16384 && (s.annotation = /*annotation*/
|
|
3142
|
+
o[34]), i[0] & /*$store*/
|
|
3143
|
+
16384 && (s.geom = /*selector*/
|
|
3144
|
+
o[37].geometry), i[0] & /*style*/
|
|
3151
3145
|
2 && (s.style = /*style*/
|
|
3152
3146
|
o[1]), t.$set(s);
|
|
3153
3147
|
},
|
|
@@ -3168,11 +3162,11 @@ function ui(e) {
|
|
|
3168
3162
|
props: {
|
|
3169
3163
|
annotation: (
|
|
3170
3164
|
/*annotation*/
|
|
3171
|
-
e[
|
|
3165
|
+
e[34]
|
|
3172
3166
|
),
|
|
3173
3167
|
geom: (
|
|
3174
3168
|
/*selector*/
|
|
3175
|
-
e[
|
|
3169
|
+
e[37].geometry
|
|
3176
3170
|
),
|
|
3177
3171
|
style: (
|
|
3178
3172
|
/*style*/
|
|
@@ -3189,10 +3183,10 @@ function ui(e) {
|
|
|
3189
3183
|
p(o, i) {
|
|
3190
3184
|
const s = {};
|
|
3191
3185
|
i[0] & /*$store*/
|
|
3192
|
-
|
|
3193
|
-
o[
|
|
3194
|
-
|
|
3195
|
-
o[
|
|
3186
|
+
16384 && (s.annotation = /*annotation*/
|
|
3187
|
+
o[34]), i[0] & /*$store*/
|
|
3188
|
+
16384 && (s.geom = /*selector*/
|
|
3189
|
+
o[37].geometry), i[0] & /*style*/
|
|
3196
3190
|
2 && (s.style = /*style*/
|
|
3197
3191
|
o[1]), t.$set(s);
|
|
3198
3192
|
},
|
|
@@ -3213,27 +3207,27 @@ function Bt(e) {
|
|
|
3213
3207
|
function l(a, c) {
|
|
3214
3208
|
return (
|
|
3215
3209
|
/*selector*/
|
|
3216
|
-
a[
|
|
3210
|
+
a[37].type === F.ELLIPSE ? 0 : (
|
|
3217
3211
|
/*selector*/
|
|
3218
|
-
a[
|
|
3212
|
+
a[37].type === F.RECTANGLE ? 1 : (
|
|
3219
3213
|
/*selector*/
|
|
3220
|
-
a[
|
|
3214
|
+
a[37].type === F.POLYGON ? 2 : -1
|
|
3221
3215
|
)
|
|
3222
3216
|
)
|
|
3223
3217
|
);
|
|
3224
3218
|
}
|
|
3225
3219
|
return ~(t = l(e)) && (n = r[t] = s[t](e)), {
|
|
3226
3220
|
c() {
|
|
3227
|
-
n && n.c(), o =
|
|
3221
|
+
n && n.c(), o = ae();
|
|
3228
3222
|
},
|
|
3229
3223
|
m(a, c) {
|
|
3230
|
-
~t && r[t].m(a, c),
|
|
3224
|
+
~t && r[t].m(a, c), B(a, o, c), i = !0;
|
|
3231
3225
|
},
|
|
3232
3226
|
p(a, c) {
|
|
3233
3227
|
let u = t;
|
|
3234
|
-
t = l(a), t === u ? ~t && r[t].p(a, c) : (n && (
|
|
3228
|
+
t = l(a), t === u ? ~t && r[t].p(a, c) : (n && (se(), D(r[u], 1, 1, () => {
|
|
3235
3229
|
r[u] = null;
|
|
3236
|
-
}),
|
|
3230
|
+
}), re()), ~t ? (n = r[t], n ? n.p(a, c) : (n = r[t] = s[t](a), n.c()), P(n, 1), n.m(o.parentNode, o)) : n = null);
|
|
3237
3231
|
},
|
|
3238
3232
|
i(a) {
|
|
3239
3233
|
i || (P(n), i = !0);
|
|
@@ -3242,33 +3236,33 @@ function Bt(e) {
|
|
|
3242
3236
|
D(n), i = !1;
|
|
3243
3237
|
},
|
|
3244
3238
|
d(a) {
|
|
3245
|
-
a &&
|
|
3239
|
+
a && k(o), ~t && r[t].d(a);
|
|
3246
3240
|
}
|
|
3247
3241
|
};
|
|
3248
3242
|
}
|
|
3249
3243
|
function It(e) {
|
|
3250
3244
|
let t = !/*isEditable*/
|
|
3251
|
-
e[
|
|
3245
|
+
e[8](
|
|
3252
3246
|
/*annotation*/
|
|
3253
|
-
e[
|
|
3247
|
+
e[34]
|
|
3254
3248
|
), n, o, i = t && Ot($e(e));
|
|
3255
3249
|
return {
|
|
3256
3250
|
c() {
|
|
3257
|
-
i && i.c(), n =
|
|
3251
|
+
i && i.c(), n = ae();
|
|
3258
3252
|
},
|
|
3259
3253
|
m(s, r) {
|
|
3260
|
-
i && i.m(s, r),
|
|
3254
|
+
i && i.m(s, r), B(s, n, r), o = !0;
|
|
3261
3255
|
},
|
|
3262
3256
|
p(s, r) {
|
|
3263
3257
|
r[0] & /*isEditable, $store*/
|
|
3264
|
-
|
|
3265
|
-
s[
|
|
3258
|
+
16640 && (t = !/*isEditable*/
|
|
3259
|
+
s[8](
|
|
3266
3260
|
/*annotation*/
|
|
3267
|
-
s[
|
|
3261
|
+
s[34]
|
|
3268
3262
|
)), t ? i ? (i.p($e(s), r), r[0] & /*isEditable, $store*/
|
|
3269
|
-
|
|
3263
|
+
16640 && P(i, 1)) : (i = Ot($e(s)), i.c(), P(i, 1), i.m(n.parentNode, n)) : i && (se(), D(i, 1, 1, () => {
|
|
3270
3264
|
i = null;
|
|
3271
|
-
}),
|
|
3265
|
+
}), re());
|
|
3272
3266
|
},
|
|
3273
3267
|
i(s) {
|
|
3274
3268
|
o || (P(i), o = !0);
|
|
@@ -3277,7 +3271,7 @@ function It(e) {
|
|
|
3277
3271
|
D(i), o = !1;
|
|
3278
3272
|
},
|
|
3279
3273
|
d(s) {
|
|
3280
|
-
s &&
|
|
3274
|
+
s && k(n), i && i.d(s);
|
|
3281
3275
|
}
|
|
3282
3276
|
};
|
|
3283
3277
|
}
|
|
@@ -3287,25 +3281,25 @@ function Pt(e) {
|
|
|
3287
3281
|
function l(a, c) {
|
|
3288
3282
|
return (
|
|
3289
3283
|
/*editableAnnotations*/
|
|
3290
|
-
a[
|
|
3284
|
+
a[7] ? 0 : (
|
|
3291
3285
|
/*tool*/
|
|
3292
|
-
a[
|
|
3286
|
+
a[13] && /*drawingEnabled*/
|
|
3293
3287
|
a[0] ? 1 : -1
|
|
3294
3288
|
)
|
|
3295
3289
|
);
|
|
3296
3290
|
}
|
|
3297
3291
|
return ~(t = l(e)) && (n = r[t] = s[t](e)), {
|
|
3298
3292
|
c() {
|
|
3299
|
-
n && n.c(), o =
|
|
3293
|
+
n && n.c(), o = ae();
|
|
3300
3294
|
},
|
|
3301
3295
|
m(a, c) {
|
|
3302
|
-
~t && r[t].m(a, c),
|
|
3296
|
+
~t && r[t].m(a, c), B(a, o, c), i = !0;
|
|
3303
3297
|
},
|
|
3304
3298
|
p(a, c) {
|
|
3305
3299
|
let u = t;
|
|
3306
|
-
t = l(a), t === u ? ~t && r[t].p(a, c) : (n && (
|
|
3300
|
+
t = l(a), t === u ? ~t && r[t].p(a, c) : (n && (se(), D(r[u], 1, 1, () => {
|
|
3307
3301
|
r[u] = null;
|
|
3308
|
-
}),
|
|
3302
|
+
}), re()), ~t ? (n = r[t], n ? n.p(a, c) : (n = r[t] = s[t](a), n.c()), P(n, 1), n.m(o.parentNode, o)) : n = null);
|
|
3309
3303
|
},
|
|
3310
3304
|
i(a) {
|
|
3311
3305
|
i || (P(n), i = !0);
|
|
@@ -3314,7 +3308,7 @@ function Pt(e) {
|
|
|
3314
3308
|
D(n), i = !1;
|
|
3315
3309
|
},
|
|
3316
3310
|
d(a) {
|
|
3317
|
-
a &&
|
|
3311
|
+
a && k(o), ~t && r[t].d(a);
|
|
3318
3312
|
}
|
|
3319
3313
|
};
|
|
3320
3314
|
}
|
|
@@ -3325,15 +3319,15 @@ function di(e) {
|
|
|
3325
3319
|
), n, o, i = Yt(e);
|
|
3326
3320
|
return {
|
|
3327
3321
|
c() {
|
|
3328
|
-
i.c(), n =
|
|
3322
|
+
i.c(), n = ae();
|
|
3329
3323
|
},
|
|
3330
3324
|
m(s, r) {
|
|
3331
|
-
i.m(s, r),
|
|
3325
|
+
i.m(s, r), B(s, n, r), o = !0;
|
|
3332
3326
|
},
|
|
3333
3327
|
p(s, r) {
|
|
3334
3328
|
r[0] & /*toolName*/
|
|
3335
|
-
4 &&
|
|
3336
|
-
s[2]) ? (
|
|
3329
|
+
4 && K(t, t = /*toolName*/
|
|
3330
|
+
s[2]) ? (se(), D(i, 1, 1, G), re(), i = Yt(s), i.c(), P(i, 1), i.m(n.parentNode, n)) : i.p(s, r);
|
|
3337
3331
|
},
|
|
3338
3332
|
i(s) {
|
|
3339
3333
|
o || (P(i), o = !0);
|
|
@@ -3342,14 +3336,14 @@ function di(e) {
|
|
|
3342
3336
|
D(i), o = !1;
|
|
3343
3337
|
},
|
|
3344
3338
|
d(s) {
|
|
3345
|
-
s &&
|
|
3339
|
+
s && k(n), i.d(s);
|
|
3346
3340
|
}
|
|
3347
3341
|
};
|
|
3348
3342
|
}
|
|
3349
3343
|
function hi(e) {
|
|
3350
3344
|
let t, n, o = Se(
|
|
3351
3345
|
/*editableAnnotations*/
|
|
3352
|
-
e[
|
|
3346
|
+
e[7]
|
|
3353
3347
|
), i = [];
|
|
3354
3348
|
for (let r = 0; r < o.length; r += 1)
|
|
3355
3349
|
i[r] = Dt(Lt(e, o, r));
|
|
@@ -3360,28 +3354,28 @@ function hi(e) {
|
|
|
3360
3354
|
c() {
|
|
3361
3355
|
for (let r = 0; r < i.length; r += 1)
|
|
3362
3356
|
i[r].c();
|
|
3363
|
-
t =
|
|
3357
|
+
t = ae();
|
|
3364
3358
|
},
|
|
3365
3359
|
m(r, l) {
|
|
3366
3360
|
for (let a = 0; a < i.length; a += 1)
|
|
3367
3361
|
i[a] && i[a].m(r, l);
|
|
3368
|
-
|
|
3362
|
+
B(r, t, l), n = !0;
|
|
3369
3363
|
},
|
|
3370
3364
|
p(r, l) {
|
|
3371
3365
|
if (l[0] & /*editableAnnotations, drawingEl, getEditor, style, transform, $scale, onChangeSelected*/
|
|
3372
|
-
|
|
3366
|
+
1607842) {
|
|
3373
3367
|
o = Se(
|
|
3374
3368
|
/*editableAnnotations*/
|
|
3375
|
-
r[
|
|
3369
|
+
r[7]
|
|
3376
3370
|
);
|
|
3377
3371
|
let a;
|
|
3378
3372
|
for (a = 0; a < o.length; a += 1) {
|
|
3379
3373
|
const c = Lt(r, o, a);
|
|
3380
3374
|
i[a] ? (i[a].p(c, l), P(i[a], 1)) : (i[a] = Dt(c), i[a].c(), P(i[a], 1), i[a].m(t.parentNode, t));
|
|
3381
3375
|
}
|
|
3382
|
-
for (
|
|
3376
|
+
for (se(), a = o.length; a < i.length; a += 1)
|
|
3383
3377
|
s(a);
|
|
3384
|
-
|
|
3378
|
+
re();
|
|
3385
3379
|
}
|
|
3386
3380
|
},
|
|
3387
3381
|
i(r) {
|
|
@@ -3398,7 +3392,7 @@ function hi(e) {
|
|
|
3398
3392
|
n = !1;
|
|
3399
3393
|
},
|
|
3400
3394
|
d(r) {
|
|
3401
|
-
r &&
|
|
3395
|
+
r && k(t), rt(i, r);
|
|
3402
3396
|
}
|
|
3403
3397
|
};
|
|
3404
3398
|
}
|
|
@@ -3408,29 +3402,29 @@ function Yt(e) {
|
|
|
3408
3402
|
props: {
|
|
3409
3403
|
target: (
|
|
3410
3404
|
/*drawingEl*/
|
|
3411
|
-
e[
|
|
3405
|
+
e[5]
|
|
3412
3406
|
),
|
|
3413
3407
|
tool: (
|
|
3414
3408
|
/*tool*/
|
|
3415
|
-
e[
|
|
3409
|
+
e[13]
|
|
3416
3410
|
),
|
|
3417
3411
|
drawingMode: (
|
|
3418
3412
|
/*drawingMode*/
|
|
3419
|
-
e[
|
|
3413
|
+
e[12]
|
|
3420
3414
|
),
|
|
3421
3415
|
transform: (
|
|
3422
3416
|
/*transform*/
|
|
3423
|
-
e[
|
|
3417
|
+
e[11]
|
|
3424
3418
|
),
|
|
3425
3419
|
viewportScale: (
|
|
3426
3420
|
/*$scale*/
|
|
3427
|
-
e[
|
|
3421
|
+
e[15]
|
|
3428
3422
|
)
|
|
3429
3423
|
}
|
|
3430
3424
|
}), t.$on(
|
|
3431
3425
|
"create",
|
|
3432
3426
|
/*onSelectionCreated*/
|
|
3433
|
-
e[
|
|
3427
|
+
e[18]
|
|
3434
3428
|
), {
|
|
3435
3429
|
c() {
|
|
3436
3430
|
$(t.$$.fragment);
|
|
@@ -3441,16 +3435,16 @@ function Yt(e) {
|
|
|
3441
3435
|
p(o, i) {
|
|
3442
3436
|
const s = {};
|
|
3443
3437
|
i[0] & /*drawingEl*/
|
|
3444
|
-
|
|
3445
|
-
o[
|
|
3446
|
-
|
|
3447
|
-
o[
|
|
3448
|
-
|
|
3449
|
-
o[
|
|
3450
|
-
|
|
3451
|
-
o[
|
|
3452
|
-
|
|
3453
|
-
o[
|
|
3438
|
+
32 && (s.target = /*drawingEl*/
|
|
3439
|
+
o[5]), i[0] & /*tool*/
|
|
3440
|
+
8192 && (s.tool = /*tool*/
|
|
3441
|
+
o[13]), i[0] & /*drawingMode*/
|
|
3442
|
+
4096 && (s.drawingMode = /*drawingMode*/
|
|
3443
|
+
o[12]), i[0] & /*transform*/
|
|
3444
|
+
2048 && (s.transform = /*transform*/
|
|
3445
|
+
o[11]), i[0] & /*$scale*/
|
|
3446
|
+
32768 && (s.viewportScale = /*$scale*/
|
|
3447
|
+
o[15]), t.$set(s);
|
|
3454
3448
|
},
|
|
3455
3449
|
i(o) {
|
|
3456
3450
|
n || (P(t.$$.fragment, o), n = !0);
|
|
@@ -3469,18 +3463,18 @@ function Ct(e) {
|
|
|
3469
3463
|
props: {
|
|
3470
3464
|
target: (
|
|
3471
3465
|
/*drawingEl*/
|
|
3472
|
-
e[
|
|
3466
|
+
e[5]
|
|
3473
3467
|
),
|
|
3474
3468
|
editor: (
|
|
3475
3469
|
/*getEditor*/
|
|
3476
|
-
e[
|
|
3470
|
+
e[20](
|
|
3477
3471
|
/*editable*/
|
|
3478
|
-
e[
|
|
3472
|
+
e[31].target.selector
|
|
3479
3473
|
)
|
|
3480
3474
|
),
|
|
3481
3475
|
annotation: (
|
|
3482
3476
|
/*editable*/
|
|
3483
|
-
e[
|
|
3477
|
+
e[31]
|
|
3484
3478
|
),
|
|
3485
3479
|
style: (
|
|
3486
3480
|
/*style*/
|
|
@@ -3488,23 +3482,23 @@ function Ct(e) {
|
|
|
3488
3482
|
),
|
|
3489
3483
|
transform: (
|
|
3490
3484
|
/*transform*/
|
|
3491
|
-
e[
|
|
3485
|
+
e[11]
|
|
3492
3486
|
),
|
|
3493
3487
|
viewportScale: (
|
|
3494
3488
|
/*$scale*/
|
|
3495
|
-
e[
|
|
3489
|
+
e[15]
|
|
3496
3490
|
)
|
|
3497
3491
|
}
|
|
3498
3492
|
}), t.$on("change", function() {
|
|
3499
|
-
|
|
3493
|
+
j(
|
|
3500
3494
|
/*onChangeSelected*/
|
|
3501
|
-
e[
|
|
3495
|
+
e[19](
|
|
3502
3496
|
/*editable*/
|
|
3503
|
-
e[
|
|
3497
|
+
e[31]
|
|
3504
3498
|
)
|
|
3505
|
-
) && e[
|
|
3499
|
+
) && e[19](
|
|
3506
3500
|
/*editable*/
|
|
3507
|
-
e[
|
|
3501
|
+
e[31]
|
|
3508
3502
|
).apply(this, arguments);
|
|
3509
3503
|
}), {
|
|
3510
3504
|
c() {
|
|
@@ -3517,21 +3511,21 @@ function Ct(e) {
|
|
|
3517
3511
|
e = o;
|
|
3518
3512
|
const s = {};
|
|
3519
3513
|
i[0] & /*drawingEl*/
|
|
3520
|
-
|
|
3521
|
-
e[
|
|
3522
|
-
|
|
3523
|
-
e[
|
|
3514
|
+
32 && (s.target = /*drawingEl*/
|
|
3515
|
+
e[5]), i[0] & /*editableAnnotations*/
|
|
3516
|
+
128 && (s.editor = /*getEditor*/
|
|
3517
|
+
e[20](
|
|
3524
3518
|
/*editable*/
|
|
3525
|
-
e[
|
|
3519
|
+
e[31].target.selector
|
|
3526
3520
|
)), i[0] & /*editableAnnotations*/
|
|
3527
|
-
|
|
3528
|
-
e[
|
|
3521
|
+
128 && (s.annotation = /*editable*/
|
|
3522
|
+
e[31]), i[0] & /*style*/
|
|
3529
3523
|
2 && (s.style = /*style*/
|
|
3530
3524
|
e[1]), i[0] & /*transform*/
|
|
3531
|
-
|
|
3532
|
-
e[
|
|
3533
|
-
|
|
3534
|
-
e[
|
|
3525
|
+
2048 && (s.transform = /*transform*/
|
|
3526
|
+
e[11]), i[0] & /*$scale*/
|
|
3527
|
+
32768 && (s.viewportScale = /*$scale*/
|
|
3528
|
+
e[15]), t.$set(s);
|
|
3535
3529
|
},
|
|
3536
3530
|
i(o) {
|
|
3537
3531
|
n || (P(t.$$.fragment, o), n = !0);
|
|
@@ -3547,19 +3541,19 @@ function Ct(e) {
|
|
|
3547
3541
|
function Dt(e) {
|
|
3548
3542
|
let t = (
|
|
3549
3543
|
/*editable*/
|
|
3550
|
-
e[
|
|
3544
|
+
e[31].id
|
|
3551
3545
|
), n, o, i = Ct(e);
|
|
3552
3546
|
return {
|
|
3553
3547
|
c() {
|
|
3554
|
-
i.c(), n =
|
|
3548
|
+
i.c(), n = ae();
|
|
3555
3549
|
},
|
|
3556
3550
|
m(s, r) {
|
|
3557
|
-
i.m(s, r),
|
|
3551
|
+
i.m(s, r), B(s, n, r), o = !0;
|
|
3558
3552
|
},
|
|
3559
3553
|
p(s, r) {
|
|
3560
3554
|
r[0] & /*editableAnnotations*/
|
|
3561
|
-
|
|
3562
|
-
s[
|
|
3555
|
+
128 && K(t, t = /*editable*/
|
|
3556
|
+
s[31].id) ? (se(), D(i, 1, 1, G), re(), i = Ct(s), i.c(), P(i, 1), i.m(n.parentNode, n)) : i.p(s, r);
|
|
3563
3557
|
},
|
|
3564
3558
|
i(s) {
|
|
3565
3559
|
o || (P(i), o = !0);
|
|
@@ -3568,14 +3562,14 @@ function Dt(e) {
|
|
|
3568
3562
|
D(i), o = !1;
|
|
3569
3563
|
},
|
|
3570
3564
|
d(s) {
|
|
3571
|
-
s &&
|
|
3565
|
+
s && k(n), i.d(s);
|
|
3572
3566
|
}
|
|
3573
3567
|
};
|
|
3574
3568
|
}
|
|
3575
3569
|
function gi(e) {
|
|
3576
3570
|
let t, n, o, i, s, r, l = Se(
|
|
3577
3571
|
/*$store*/
|
|
3578
|
-
e[
|
|
3572
|
+
e[14]
|
|
3579
3573
|
), a = [];
|
|
3580
3574
|
for (let f = 0; f < l.length; f += 1)
|
|
3581
3575
|
a[f] = It(kt(e, l, f));
|
|
@@ -3584,151 +3578,155 @@ function gi(e) {
|
|
|
3584
3578
|
});
|
|
3585
3579
|
let u = (
|
|
3586
3580
|
/*drawingEl*/
|
|
3587
|
-
e[
|
|
3581
|
+
e[5] && Pt(e)
|
|
3588
3582
|
);
|
|
3589
3583
|
return {
|
|
3590
3584
|
c() {
|
|
3591
|
-
t =
|
|
3585
|
+
t = X("svg"), n = X("g");
|
|
3592
3586
|
for (let f = 0; f < a.length; f += 1)
|
|
3593
3587
|
a[f].c();
|
|
3594
|
-
o =
|
|
3588
|
+
o = X("g"), u && u.c(), h(o, "class", "drawing"), h(t, "class", "a9s-annotationlayer"), Ee(
|
|
3595
3589
|
t,
|
|
3596
3590
|
"drawing",
|
|
3597
3591
|
/*tool*/
|
|
3598
|
-
e[
|
|
3599
|
-
)
|
|
3592
|
+
e[13]
|
|
3593
|
+
), Ee(t, "hidden", !/*visible*/
|
|
3594
|
+
e[3]);
|
|
3600
3595
|
},
|
|
3601
|
-
m(f,
|
|
3602
|
-
|
|
3596
|
+
m(f, d) {
|
|
3597
|
+
B(f, t, d), ie(t, n);
|
|
3603
3598
|
for (let g = 0; g < a.length; g += 1)
|
|
3604
3599
|
a[g] && a[g].m(n, null);
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3600
|
+
ie(t, o), u && u.m(o, null), e[27](o), e[28](t), i = !0, s || (r = [
|
|
3601
|
+
H(t, "pointerup", function() {
|
|
3602
|
+
j(
|
|
3608
3603
|
/*onPointerUp*/
|
|
3609
|
-
e[8]
|
|
3610
|
-
) && e[8].apply(this, arguments);
|
|
3611
|
-
}),
|
|
3612
|
-
F(t, "pointerdown", function() {
|
|
3613
|
-
q(
|
|
3614
|
-
/*onPointerDown*/
|
|
3615
3604
|
e[9]
|
|
3616
3605
|
) && e[9].apply(this, arguments);
|
|
3606
|
+
}),
|
|
3607
|
+
H(t, "pointerdown", function() {
|
|
3608
|
+
j(
|
|
3609
|
+
/*onPointerDown*/
|
|
3610
|
+
e[10]
|
|
3611
|
+
) && e[10].apply(this, arguments);
|
|
3617
3612
|
})
|
|
3618
3613
|
], s = !0);
|
|
3619
3614
|
},
|
|
3620
|
-
p(f,
|
|
3621
|
-
if (e = f,
|
|
3622
|
-
|
|
3615
|
+
p(f, d) {
|
|
3616
|
+
if (e = f, d[0] & /*$store, style, isEditable*/
|
|
3617
|
+
16642) {
|
|
3623
3618
|
l = Se(
|
|
3624
3619
|
/*$store*/
|
|
3625
|
-
e[
|
|
3620
|
+
e[14]
|
|
3626
3621
|
);
|
|
3627
3622
|
let g;
|
|
3628
3623
|
for (g = 0; g < l.length; g += 1) {
|
|
3629
3624
|
const m = kt(e, l, g);
|
|
3630
|
-
a[g] ? (a[g].p(m,
|
|
3625
|
+
a[g] ? (a[g].p(m, d), P(a[g], 1)) : (a[g] = It(m), a[g].c(), P(a[g], 1), a[g].m(n, null));
|
|
3631
3626
|
}
|
|
3632
|
-
for (
|
|
3627
|
+
for (se(), g = l.length; g < a.length; g += 1)
|
|
3633
3628
|
c(g);
|
|
3634
|
-
|
|
3629
|
+
re();
|
|
3635
3630
|
}
|
|
3636
3631
|
/*drawingEl*/
|
|
3637
|
-
e[
|
|
3638
|
-
|
|
3632
|
+
e[5] ? u ? (u.p(e, d), d[0] & /*drawingEl*/
|
|
3633
|
+
32 && P(u, 1)) : (u = Pt(e), u.c(), P(u, 1), u.m(o, null)) : u && (se(), D(u, 1, 1, () => {
|
|
3639
3634
|
u = null;
|
|
3640
|
-
}),
|
|
3641
|
-
|
|
3635
|
+
}), re()), (!i || d[0] & /*tool*/
|
|
3636
|
+
8192) && Ee(
|
|
3642
3637
|
t,
|
|
3643
3638
|
"drawing",
|
|
3644
3639
|
/*tool*/
|
|
3645
|
-
e[
|
|
3646
|
-
)
|
|
3640
|
+
e[13]
|
|
3641
|
+
), (!i || d[0] & /*visible*/
|
|
3642
|
+
8) && Ee(t, "hidden", !/*visible*/
|
|
3643
|
+
e[3]);
|
|
3647
3644
|
},
|
|
3648
3645
|
i(f) {
|
|
3649
3646
|
if (!i) {
|
|
3650
|
-
for (let
|
|
3651
|
-
P(a[
|
|
3647
|
+
for (let d = 0; d < l.length; d += 1)
|
|
3648
|
+
P(a[d]);
|
|
3652
3649
|
P(u), i = !0;
|
|
3653
3650
|
}
|
|
3654
3651
|
},
|
|
3655
3652
|
o(f) {
|
|
3656
3653
|
a = a.filter(en);
|
|
3657
|
-
for (let
|
|
3658
|
-
D(a[
|
|
3654
|
+
for (let d = 0; d < a.length; d += 1)
|
|
3655
|
+
D(a[d]);
|
|
3659
3656
|
D(u), i = !1;
|
|
3660
3657
|
},
|
|
3661
3658
|
d(f) {
|
|
3662
|
-
f &&
|
|
3659
|
+
f && k(t), rt(a, f), u && u.d(), e[27](null), e[28](null), s = !1, le(r);
|
|
3663
3660
|
}
|
|
3664
3661
|
};
|
|
3665
3662
|
}
|
|
3666
3663
|
function mi(e, t, n) {
|
|
3667
|
-
let o, i, s, r, l, a, c, u, f,
|
|
3664
|
+
let o, i, s, r, l, a, c, u, f, d, g = G, m = () => (g(), g = Vt(b, (L) => n(15, d = L)), b);
|
|
3668
3665
|
e.$$.on_destroy.push(() => g());
|
|
3669
|
-
let { drawingEnabled:
|
|
3670
|
-
|
|
3671
|
-
const { selection: T, store:
|
|
3672
|
-
ht(e, T, (
|
|
3673
|
-
let
|
|
3674
|
-
const
|
|
3675
|
-
|
|
3676
|
-
const
|
|
3677
|
-
|
|
3678
|
-
const { updated:
|
|
3679
|
-
n(
|
|
3680
|
-
},
|
|
3681
|
-
},
|
|
3682
|
-
const
|
|
3683
|
-
id:
|
|
3666
|
+
let { drawingEnabled: y } = t, { image: E } = t, { preferredDrawingMode: p } = t, { state: S } = t, { style: w = void 0 } = t, { toolName: A = xt()[0] } = t, { user: I } = t, { visible: N = !0 } = t, U, _, b;
|
|
3667
|
+
Ye(() => m(n(6, b = bo(E, _))));
|
|
3668
|
+
const { selection: T, store: M } = S;
|
|
3669
|
+
ht(e, T, (L) => n(26, u = L)), ht(e, M, (L) => n(14, f = L));
|
|
3670
|
+
let O, Y;
|
|
3671
|
+
const Z = (L) => {
|
|
3672
|
+
O && M.unobserve(O);
|
|
3673
|
+
const W = L.filter(({ editable: V }) => V).map(({ id: V }) => V);
|
|
3674
|
+
W.length > 0 ? (n(7, Y = W.map((V) => M.getAnnotation(V)).filter(Boolean)), O = (V) => {
|
|
3675
|
+
const { updated: ce } = V.changes;
|
|
3676
|
+
n(7, Y = ce == null ? void 0 : ce.map((J) => J.newValue));
|
|
3677
|
+
}, M.observe(O, { annotations: W })) : n(7, Y = void 0);
|
|
3678
|
+
}, he = (L) => {
|
|
3679
|
+
const W = qt(), V = {
|
|
3680
|
+
id: W,
|
|
3684
3681
|
bodies: [],
|
|
3685
3682
|
target: {
|
|
3686
|
-
annotation:
|
|
3687
|
-
selector:
|
|
3688
|
-
creator:
|
|
3683
|
+
annotation: W,
|
|
3684
|
+
selector: L.detail,
|
|
3685
|
+
creator: I,
|
|
3689
3686
|
created: /* @__PURE__ */ new Date()
|
|
3690
3687
|
}
|
|
3691
3688
|
};
|
|
3692
|
-
|
|
3693
|
-
}, ge = (
|
|
3694
|
-
var
|
|
3695
|
-
const { target:
|
|
3696
|
-
|
|
3697
|
-
...
|
|
3698
|
-
selector:
|
|
3699
|
-
created:
|
|
3700
|
-
updated:
|
|
3701
|
-
updatedBy:
|
|
3689
|
+
M.addAnnotation(V), T.setSelected(V.id);
|
|
3690
|
+
}, ge = (L) => (W) => {
|
|
3691
|
+
var R;
|
|
3692
|
+
const { target: V } = L, ce = 10 * 60 * 1e3, J = ((R = V.creator) == null ? void 0 : R.id) !== I.id || !V.created || (/* @__PURE__ */ new Date()).getTime() - V.created.getTime() > ce;
|
|
3693
|
+
M.updateTarget({
|
|
3694
|
+
...V,
|
|
3695
|
+
selector: W.detail,
|
|
3696
|
+
created: J ? V.created : /* @__PURE__ */ new Date(),
|
|
3697
|
+
updated: J ? /* @__PURE__ */ new Date() : void 0,
|
|
3698
|
+
updatedBy: J ? I : void 0
|
|
3702
3699
|
});
|
|
3703
|
-
},
|
|
3704
|
-
function
|
|
3705
|
-
He[
|
|
3706
|
-
U =
|
|
3700
|
+
}, Me = (L) => Bo(L);
|
|
3701
|
+
function oe(L) {
|
|
3702
|
+
He[L ? "unshift" : "push"](() => {
|
|
3703
|
+
U = L, n(5, U);
|
|
3707
3704
|
});
|
|
3708
3705
|
}
|
|
3709
|
-
function
|
|
3710
|
-
He[
|
|
3711
|
-
|
|
3706
|
+
function ve(L) {
|
|
3707
|
+
He[L ? "unshift" : "push"](() => {
|
|
3708
|
+
_ = L, n(4, _);
|
|
3712
3709
|
});
|
|
3713
3710
|
}
|
|
3714
|
-
return e.$$set = (
|
|
3715
|
-
"drawingEnabled" in
|
|
3711
|
+
return e.$$set = (L) => {
|
|
3712
|
+
"drawingEnabled" in L && n(0, y = L.drawingEnabled), "image" in L && n(21, E = L.image), "preferredDrawingMode" in L && n(22, p = L.preferredDrawingMode), "state" in L && n(23, S = L.state), "style" in L && n(1, w = L.style), "toolName" in L && n(2, A = L.toolName), "user" in L && n(24, I = L.user), "visible" in L && n(3, N = L.visible);
|
|
3716
3713
|
}, e.$$.update = () => {
|
|
3717
3714
|
e.$$.dirty[0] & /*toolName*/
|
|
3718
|
-
4 && n(
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3715
|
+
4 && n(13, { tool: o, opts: i } = $t(A) || { tool: void 0, opts: void 0 }, o, (n(25, i), n(2, A))), e.$$.dirty[0] & /*opts, preferredDrawingMode*/
|
|
3716
|
+
37748736 && n(12, s = (i == null ? void 0 : i.drawingMode) || p), e.$$.dirty[0] & /*svgEl*/
|
|
3717
|
+
16 && n(11, r = si(_)), e.$$.dirty[0] & /*svgEl*/
|
|
3718
|
+
16 && n(10, { onPointerDown: l, onPointerUp: a } = li(_, M), l, (n(9, a), n(4, _))), e.$$.dirty[0] & /*$selection*/
|
|
3719
|
+
67108864 && n(8, c = (L) => u.selected.find((W) => W.id === L.id && W.editable)), e.$$.dirty[0] & /*$selection*/
|
|
3720
|
+
67108864 && Z(u.selected);
|
|
3724
3721
|
}, [
|
|
3725
|
-
|
|
3722
|
+
y,
|
|
3726
3723
|
w,
|
|
3727
|
-
|
|
3728
|
-
|
|
3724
|
+
A,
|
|
3725
|
+
N,
|
|
3726
|
+
_,
|
|
3729
3727
|
U,
|
|
3730
|
-
|
|
3731
|
-
|
|
3728
|
+
b,
|
|
3729
|
+
Y,
|
|
3732
3730
|
c,
|
|
3733
3731
|
a,
|
|
3734
3732
|
l,
|
|
@@ -3736,20 +3734,20 @@ function mi(e, t, n) {
|
|
|
3736
3734
|
s,
|
|
3737
3735
|
o,
|
|
3738
3736
|
f,
|
|
3739
|
-
|
|
3737
|
+
d,
|
|
3740
3738
|
T,
|
|
3741
|
-
|
|
3742
|
-
|
|
3739
|
+
M,
|
|
3740
|
+
he,
|
|
3743
3741
|
ge,
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3742
|
+
Me,
|
|
3743
|
+
E,
|
|
3744
|
+
p,
|
|
3745
|
+
S,
|
|
3746
|
+
I,
|
|
3749
3747
|
i,
|
|
3750
3748
|
u,
|
|
3751
|
-
|
|
3752
|
-
|
|
3749
|
+
oe,
|
|
3750
|
+
ve
|
|
3753
3751
|
];
|
|
3754
3752
|
}
|
|
3755
3753
|
class pi extends te {
|
|
@@ -3759,15 +3757,16 @@ class pi extends te {
|
|
|
3759
3757
|
t,
|
|
3760
3758
|
mi,
|
|
3761
3759
|
gi,
|
|
3762
|
-
|
|
3760
|
+
K,
|
|
3763
3761
|
{
|
|
3764
3762
|
drawingEnabled: 0,
|
|
3765
|
-
image:
|
|
3766
|
-
preferredDrawingMode:
|
|
3767
|
-
state:
|
|
3763
|
+
image: 21,
|
|
3764
|
+
preferredDrawingMode: 22,
|
|
3765
|
+
state: 23,
|
|
3768
3766
|
style: 1,
|
|
3769
3767
|
toolName: 2,
|
|
3770
|
-
user:
|
|
3768
|
+
user: 24,
|
|
3769
|
+
visible: 3
|
|
3771
3770
|
},
|
|
3772
3771
|
null,
|
|
3773
3772
|
[-1, -1]
|
|
@@ -3783,17 +3782,17 @@ function tn(e, t, n, o, i) {
|
|
|
3783
3782
|
var s = o - n + 1, r = t - n + 1, l = Math.log(s), a = 0.5 * Math.exp(2 * l / 3), c = 0.5 * Math.sqrt(l * a * (s - a) / s) * (r - s / 2 < 0 ? -1 : 1), u = Math.max(n, Math.floor(t - r * a / s + c)), f = Math.min(o, Math.floor(t + (s - r) * a / s + c));
|
|
3784
3783
|
tn(e, t, u, f, i);
|
|
3785
3784
|
}
|
|
3786
|
-
var
|
|
3787
|
-
for (
|
|
3788
|
-
for (
|
|
3785
|
+
var d = e[t], g = n, m = o;
|
|
3786
|
+
for (Le(e, n, t), i(e[o], d) > 0 && Le(e, n, o); g < m; ) {
|
|
3787
|
+
for (Le(e, g, m), g++, m--; i(e[g], d) < 0; )
|
|
3789
3788
|
g++;
|
|
3790
|
-
for (; i(e[m],
|
|
3789
|
+
for (; i(e[m], d) > 0; )
|
|
3791
3790
|
m--;
|
|
3792
3791
|
}
|
|
3793
|
-
i(e[n],
|
|
3792
|
+
i(e[n], d) === 0 ? Le(e, n, m) : (m++, Le(e, m, o)), m <= t && (n = m + 1), t <= m && (o = m - 1);
|
|
3794
3793
|
}
|
|
3795
3794
|
}
|
|
3796
|
-
function
|
|
3795
|
+
function Le(e, t, n) {
|
|
3797
3796
|
var o = e[t];
|
|
3798
3797
|
e[t] = e[n], e[n] = o;
|
|
3799
3798
|
}
|
|
@@ -3810,13 +3809,13 @@ class wi {
|
|
|
3810
3809
|
search(t) {
|
|
3811
3810
|
let n = this.data;
|
|
3812
3811
|
const o = [];
|
|
3813
|
-
if (!
|
|
3812
|
+
if (!Ve(t, n))
|
|
3814
3813
|
return o;
|
|
3815
3814
|
const i = this.toBBox, s = [];
|
|
3816
3815
|
for (; n; ) {
|
|
3817
3816
|
for (let r = 0; r < n.children.length; r++) {
|
|
3818
3817
|
const l = n.children[r], a = n.leaf ? i(l) : l;
|
|
3819
|
-
|
|
3818
|
+
Ve(t, a) && (n.leaf ? o.push(l) : tt(t, a) ? this._all(l, o) : s.push(l));
|
|
3820
3819
|
}
|
|
3821
3820
|
n = s.pop();
|
|
3822
3821
|
}
|
|
@@ -3824,13 +3823,13 @@ class wi {
|
|
|
3824
3823
|
}
|
|
3825
3824
|
collides(t) {
|
|
3826
3825
|
let n = this.data;
|
|
3827
|
-
if (!
|
|
3826
|
+
if (!Ve(t, n))
|
|
3828
3827
|
return !1;
|
|
3829
3828
|
const o = [];
|
|
3830
3829
|
for (; n; ) {
|
|
3831
3830
|
for (let i = 0; i < n.children.length; i++) {
|
|
3832
3831
|
const s = n.children[i], r = n.leaf ? this.toBBox(s) : s;
|
|
3833
|
-
if (
|
|
3832
|
+
if (Ve(t, r)) {
|
|
3834
3833
|
if (n.leaf || tt(t, r))
|
|
3835
3834
|
return !0;
|
|
3836
3835
|
o.push(s);
|
|
@@ -3866,7 +3865,7 @@ class wi {
|
|
|
3866
3865
|
return t && this._insert(t, this.data.height - 1), this;
|
|
3867
3866
|
}
|
|
3868
3867
|
clear() {
|
|
3869
|
-
return this.data =
|
|
3868
|
+
return this.data = be([]), this;
|
|
3870
3869
|
}
|
|
3871
3870
|
remove(t, n) {
|
|
3872
3871
|
if (!t)
|
|
@@ -3909,19 +3908,19 @@ class wi {
|
|
|
3909
3908
|
const s = o - n + 1;
|
|
3910
3909
|
let r = this._maxEntries, l;
|
|
3911
3910
|
if (s <= r)
|
|
3912
|
-
return l =
|
|
3913
|
-
i || (i = Math.ceil(Math.log(s) / Math.log(r)), r = Math.ceil(s / Math.pow(r, i - 1))), l =
|
|
3911
|
+
return l = be(t.slice(n, o + 1)), _e(l, this.toBBox), l;
|
|
3912
|
+
i || (i = Math.ceil(Math.log(s) / Math.log(r)), r = Math.ceil(s / Math.pow(r, i - 1))), l = be([]), l.leaf = !1, l.height = i;
|
|
3914
3913
|
const a = Math.ceil(s / r), c = a * Math.ceil(Math.sqrt(r));
|
|
3915
3914
|
Xt(t, n, o, c, this.compareMinX);
|
|
3916
3915
|
for (let u = n; u <= o; u += c) {
|
|
3917
3916
|
const f = Math.min(u + c - 1, o);
|
|
3918
3917
|
Xt(t, u, f, a, this.compareMinY);
|
|
3919
|
-
for (let
|
|
3920
|
-
const g = Math.min(
|
|
3921
|
-
l.children.push(this._build(t,
|
|
3918
|
+
for (let d = u; d <= f; d += a) {
|
|
3919
|
+
const g = Math.min(d + a - 1, f);
|
|
3920
|
+
l.children.push(this._build(t, d, g, i - 1));
|
|
3922
3921
|
}
|
|
3923
3922
|
}
|
|
3924
|
-
return
|
|
3923
|
+
return _e(l, this.toBBox), l;
|
|
3925
3924
|
}
|
|
3926
3925
|
_chooseSubtree(t, n, o, i) {
|
|
3927
3926
|
for (; i.push(n), !(n.leaf || i.length - 1 === o); ) {
|
|
@@ -3936,7 +3935,7 @@ class wi {
|
|
|
3936
3935
|
}
|
|
3937
3936
|
_insert(t, n, o) {
|
|
3938
3937
|
const i = o ? t : this.toBBox(t), s = [], r = this._chooseSubtree(i, this.data, n, s);
|
|
3939
|
-
for (r.children.push(t),
|
|
3938
|
+
for (r.children.push(t), Be(r, i); n >= 0 && s[n].children.length > this._maxEntries; )
|
|
3940
3939
|
this._split(s, n), n--;
|
|
3941
3940
|
this._adjustParentBBoxes(i, s, n);
|
|
3942
3941
|
}
|
|
@@ -3944,16 +3943,16 @@ class wi {
|
|
|
3944
3943
|
_split(t, n) {
|
|
3945
3944
|
const o = t[n], i = o.children.length, s = this._minEntries;
|
|
3946
3945
|
this._chooseSplitAxis(o, s, i);
|
|
3947
|
-
const r = this._chooseSplitIndex(o, s, i), l =
|
|
3948
|
-
l.height = o.height, l.leaf = o.leaf,
|
|
3946
|
+
const r = this._chooseSplitIndex(o, s, i), l = be(o.children.splice(r, o.children.length - r));
|
|
3947
|
+
l.height = o.height, l.leaf = o.leaf, _e(o, this.toBBox), _e(l, this.toBBox), n ? t[n - 1].children.push(l) : this._splitRoot(o, l);
|
|
3949
3948
|
}
|
|
3950
3949
|
_splitRoot(t, n) {
|
|
3951
|
-
this.data =
|
|
3950
|
+
this.data = be([t, n]), this.data.height = t.height + 1, this.data.leaf = !1, _e(this.data, this.toBBox);
|
|
3952
3951
|
}
|
|
3953
3952
|
_chooseSplitIndex(t, n, o) {
|
|
3954
3953
|
let i, s = 1 / 0, r = 1 / 0;
|
|
3955
3954
|
for (let l = n; l <= o - n; l++) {
|
|
3956
|
-
const a =
|
|
3955
|
+
const a = Oe(t, 0, l, this.toBBox), c = Oe(t, l, o, this.toBBox), u = Ti(a, c), f = et(a) + et(c);
|
|
3957
3956
|
u < s ? (s = u, i = l, r = f < r ? f : r) : u === s && f < r && (r = f, i = l);
|
|
3958
3957
|
}
|
|
3959
3958
|
return i || o - n;
|
|
@@ -3966,25 +3965,25 @@ class wi {
|
|
|
3966
3965
|
// total margin of all possible split distributions where each node is at least m full
|
|
3967
3966
|
_allDistMargin(t, n, o, i) {
|
|
3968
3967
|
t.children.sort(i);
|
|
3969
|
-
const s = this.toBBox, r =
|
|
3970
|
-
let a =
|
|
3968
|
+
const s = this.toBBox, r = Oe(t, 0, n, s), l = Oe(t, o - n, o, s);
|
|
3969
|
+
let a = Ne(r) + Ne(l);
|
|
3971
3970
|
for (let c = n; c < o - n; c++) {
|
|
3972
3971
|
const u = t.children[c];
|
|
3973
|
-
|
|
3972
|
+
Be(r, t.leaf ? s(u) : u), a += Ne(r);
|
|
3974
3973
|
}
|
|
3975
3974
|
for (let c = o - n - 1; c >= n; c--) {
|
|
3976
3975
|
const u = t.children[c];
|
|
3977
|
-
|
|
3976
|
+
Be(l, t.leaf ? s(u) : u), a += Ne(l);
|
|
3978
3977
|
}
|
|
3979
3978
|
return a;
|
|
3980
3979
|
}
|
|
3981
3980
|
_adjustParentBBoxes(t, n, o) {
|
|
3982
3981
|
for (let i = o; i >= 0; i--)
|
|
3983
|
-
|
|
3982
|
+
Be(n[i], t);
|
|
3984
3983
|
}
|
|
3985
3984
|
_condense(t) {
|
|
3986
3985
|
for (let n = t.length - 1, o; n >= 0; n--)
|
|
3987
|
-
t[n].children.length === 0 ? n > 0 ? (o = t[n - 1].children, o.splice(o.indexOf(t[n]), 1)) : this.clear() :
|
|
3986
|
+
t[n].children.length === 0 ? n > 0 ? (o = t[n - 1].children, o.splice(o.indexOf(t[n]), 1)) : this.clear() : _e(t[n], this.toBBox);
|
|
3988
3987
|
}
|
|
3989
3988
|
}
|
|
3990
3989
|
function bi(e, t, n) {
|
|
@@ -3995,18 +3994,18 @@ function bi(e, t, n) {
|
|
|
3995
3994
|
return o;
|
|
3996
3995
|
return -1;
|
|
3997
3996
|
}
|
|
3998
|
-
function
|
|
3999
|
-
|
|
3997
|
+
function _e(e, t) {
|
|
3998
|
+
Oe(e, 0, e.children.length, t, e);
|
|
4000
3999
|
}
|
|
4001
|
-
function
|
|
4002
|
-
i || (i =
|
|
4000
|
+
function Oe(e, t, n, o, i) {
|
|
4001
|
+
i || (i = be(null)), i.minX = 1 / 0, i.minY = 1 / 0, i.maxX = -1 / 0, i.maxY = -1 / 0;
|
|
4003
4002
|
for (let s = t; s < n; s++) {
|
|
4004
4003
|
const r = e.children[s];
|
|
4005
|
-
|
|
4004
|
+
Be(i, e.leaf ? o(r) : r);
|
|
4006
4005
|
}
|
|
4007
4006
|
return i;
|
|
4008
4007
|
}
|
|
4009
|
-
function
|
|
4008
|
+
function Be(e, t) {
|
|
4010
4009
|
return e.minX = Math.min(e.minX, t.minX), e.minY = Math.min(e.minY, t.minY), e.maxX = Math.max(e.maxX, t.maxX), e.maxY = Math.max(e.maxY, t.maxY), e;
|
|
4011
4010
|
}
|
|
4012
4011
|
function Ei(e, t) {
|
|
@@ -4018,7 +4017,7 @@ function Ai(e, t) {
|
|
|
4018
4017
|
function et(e) {
|
|
4019
4018
|
return (e.maxX - e.minX) * (e.maxY - e.minY);
|
|
4020
4019
|
}
|
|
4021
|
-
function
|
|
4020
|
+
function Ne(e) {
|
|
4022
4021
|
return e.maxX - e.minX + (e.maxY - e.minY);
|
|
4023
4022
|
}
|
|
4024
4023
|
function Si(e, t) {
|
|
@@ -4031,10 +4030,10 @@ function Ti(e, t) {
|
|
|
4031
4030
|
function tt(e, t) {
|
|
4032
4031
|
return e.minX <= t.minX && e.minY <= t.minY && t.maxX <= e.maxX && t.maxY <= e.maxY;
|
|
4033
4032
|
}
|
|
4034
|
-
function
|
|
4033
|
+
function Ve(e, t) {
|
|
4035
4034
|
return t.minX <= e.maxX && t.minY <= e.maxY && t.maxX >= e.minX && t.maxY >= e.minY;
|
|
4036
4035
|
}
|
|
4037
|
-
function
|
|
4036
|
+
function be(e) {
|
|
4038
4037
|
return {
|
|
4039
4038
|
children: e,
|
|
4040
4039
|
height: 1,
|
|
@@ -4058,44 +4057,44 @@ const Mi = () => {
|
|
|
4058
4057
|
const e = new wi(), t = /* @__PURE__ */ new Map(), n = () => [...t.values()], o = () => {
|
|
4059
4058
|
e.clear(), t.clear();
|
|
4060
4059
|
}, i = (f) => {
|
|
4061
|
-
const { minX:
|
|
4062
|
-
e.insert(
|
|
4060
|
+
const { minX: d, minY: g, maxX: m, maxY: y } = f.selector.geometry.bounds, E = { minX: d, minY: g, maxX: m, maxY: y, target: f };
|
|
4061
|
+
e.insert(E), t.set(f.annotation, E);
|
|
4063
4062
|
}, s = (f) => {
|
|
4064
|
-
const
|
|
4065
|
-
|
|
4063
|
+
const d = t.get(f.annotation);
|
|
4064
|
+
d && e.remove(d), t.delete(f.annotation);
|
|
4066
4065
|
};
|
|
4067
4066
|
return {
|
|
4068
4067
|
all: n,
|
|
4069
4068
|
clear: o,
|
|
4070
|
-
getAt: (f,
|
|
4069
|
+
getAt: (f, d) => {
|
|
4071
4070
|
const m = e.search({
|
|
4072
4071
|
minX: f,
|
|
4073
|
-
minY:
|
|
4072
|
+
minY: d,
|
|
4074
4073
|
maxX: f,
|
|
4075
|
-
maxY:
|
|
4076
|
-
}).map((
|
|
4074
|
+
maxY: d
|
|
4075
|
+
}).map((y) => y.target).filter((y) => y.selector.type === F.RECTANGLE || wn(y.selector, f, d));
|
|
4077
4076
|
if (m.length > 0)
|
|
4078
|
-
return m.sort((
|
|
4077
|
+
return m.sort((y, E) => st(y.selector) - st(E.selector)), m[0];
|
|
4079
4078
|
},
|
|
4080
|
-
getIntersecting: (f,
|
|
4079
|
+
getIntersecting: (f, d, g, m) => e.search({
|
|
4081
4080
|
minX: f,
|
|
4082
|
-
minY:
|
|
4081
|
+
minY: d,
|
|
4083
4082
|
maxX: f + g,
|
|
4084
|
-
maxY:
|
|
4085
|
-
}).map((
|
|
4083
|
+
maxY: d + m
|
|
4084
|
+
}).map((y) => y.target),
|
|
4086
4085
|
insert: i,
|
|
4087
4086
|
remove: s,
|
|
4088
|
-
set: (f,
|
|
4089
|
-
|
|
4087
|
+
set: (f, d = !0) => {
|
|
4088
|
+
d && o();
|
|
4090
4089
|
const g = f.map((m) => {
|
|
4091
|
-
const { minX:
|
|
4092
|
-
return { minX:
|
|
4090
|
+
const { minX: y, minY: E, maxX: p, maxY: S } = m.selector.geometry.bounds;
|
|
4091
|
+
return { minX: y, minY: E, maxX: p, maxY: S, target: m };
|
|
4093
4092
|
});
|
|
4094
4093
|
g.forEach((m) => t.set(m.target.annotation, m)), e.load(g);
|
|
4095
4094
|
},
|
|
4096
4095
|
size: () => e.all().length,
|
|
4097
|
-
update: (f,
|
|
4098
|
-
s(f), i(
|
|
4096
|
+
update: (f, d) => {
|
|
4097
|
+
s(f), i(d);
|
|
4099
4098
|
}
|
|
4100
4099
|
};
|
|
4101
4100
|
}, vi = (e) => {
|
|
@@ -4109,7 +4108,7 @@ const Mi = () => {
|
|
|
4109
4108
|
const u = n.getAt(a, c);
|
|
4110
4109
|
return u ? t.getAnnotation(u.annotation) : void 0;
|
|
4111
4110
|
},
|
|
4112
|
-
getIntersecting: (a, c, u, f) => n.getIntersecting(a, c, u, f).map((
|
|
4111
|
+
getIntersecting: (a, c, u, f) => n.getIntersecting(a, c, u, f).map((d) => t.getAnnotation(d.annotation))
|
|
4113
4112
|
},
|
|
4114
4113
|
selection: o,
|
|
4115
4114
|
hover: i,
|
|
@@ -4176,7 +4175,7 @@ const Mi = () => {
|
|
|
4176
4175
|
const u = Ii(l);
|
|
4177
4176
|
let f = lo();
|
|
4178
4177
|
Rt(n, c, o.theme);
|
|
4179
|
-
const
|
|
4178
|
+
const d = new pi({
|
|
4180
4179
|
target: c,
|
|
4181
4180
|
props: {
|
|
4182
4181
|
drawingEnabled: !!o.drawingEnabled,
|
|
@@ -4187,50 +4186,54 @@ const Mi = () => {
|
|
|
4187
4186
|
user: f
|
|
4188
4187
|
}
|
|
4189
4188
|
});
|
|
4190
|
-
|
|
4191
|
-
const { originalEvent: T, annotation:
|
|
4192
|
-
|
|
4189
|
+
d.$on("click", (b) => {
|
|
4190
|
+
const { originalEvent: T, annotation: M } = b.detail;
|
|
4191
|
+
M ? s.clickSelect(M.id, T) : s.isEmpty() || s.clear();
|
|
4193
4192
|
});
|
|
4194
4193
|
const g = to(i, l, o.adapter), m = () => {
|
|
4195
|
-
|
|
4196
|
-
},
|
|
4197
|
-
if (!$t(
|
|
4198
|
-
throw `No drawing tool named ${
|
|
4199
|
-
|
|
4200
|
-
}, w = (
|
|
4194
|
+
d.$destroy(), c.parentNode.insertBefore(n, c), c.parentNode.removeChild(c), u.destroy(), l.destroy();
|
|
4195
|
+
}, y = () => f, E = (b, T, M) => Ko(b, T, M), p = (b, T) => Io(b, T), S = (b) => {
|
|
4196
|
+
if (!$t(b))
|
|
4197
|
+
throw `No drawing tool named ${b}`;
|
|
4198
|
+
d.$set({ toolName: b });
|
|
4199
|
+
}, w = (b) => d.$set({ drawingEnabled: b }), A = (b) => {
|
|
4201
4200
|
console.warn("Filter not implemented yet");
|
|
4202
|
-
},
|
|
4203
|
-
f =
|
|
4204
|
-
}
|
|
4201
|
+
}, I = (b) => d.$set({ style: b }), N = (b) => Rt(n, c, b), U = (b) => {
|
|
4202
|
+
f = b, d.$set({ user: b });
|
|
4203
|
+
}, _ = (b) => (
|
|
4204
|
+
// @ts-ignore
|
|
4205
|
+
d.$set({ visible: b })
|
|
4206
|
+
);
|
|
4205
4207
|
return {
|
|
4206
4208
|
...g,
|
|
4207
4209
|
destroy: m,
|
|
4208
|
-
getUser:
|
|
4210
|
+
getUser: y,
|
|
4209
4211
|
listDrawingTools: xt,
|
|
4210
4212
|
on: a.on,
|
|
4211
4213
|
off: a.off,
|
|
4212
|
-
registerDrawingTool:
|
|
4213
|
-
registerShapeEditor:
|
|
4214
|
+
registerDrawingTool: E,
|
|
4215
|
+
registerShapeEditor: p,
|
|
4214
4216
|
setDrawingEnabled: w,
|
|
4215
|
-
setDrawingTool:
|
|
4216
|
-
setFilter:
|
|
4217
|
-
setStyle:
|
|
4218
|
-
setTheme:
|
|
4219
|
-
setUser:
|
|
4217
|
+
setDrawingTool: S,
|
|
4218
|
+
setFilter: A,
|
|
4219
|
+
setStyle: I,
|
|
4220
|
+
setTheme: N,
|
|
4221
|
+
setUser: U,
|
|
4222
|
+
setVisible: _,
|
|
4220
4223
|
state: i
|
|
4221
4224
|
};
|
|
4222
4225
|
};
|
|
4223
4226
|
export {
|
|
4224
4227
|
Qt as Editor,
|
|
4225
4228
|
Xo as EditorMount,
|
|
4226
|
-
|
|
4229
|
+
ke as Handle,
|
|
4227
4230
|
Ci as IdentityTransform,
|
|
4228
4231
|
yo as PolygonEditor,
|
|
4229
4232
|
Oo as RectangleEditor,
|
|
4230
4233
|
An as RectangleUtil,
|
|
4231
4234
|
Go as RubberbandRectangle,
|
|
4232
4235
|
pi as SVGAnnotationLayer,
|
|
4233
|
-
|
|
4236
|
+
F as ShapeType,
|
|
4234
4237
|
Uo as ToolMount,
|
|
4235
4238
|
Yi as W3CImageFormat,
|
|
4236
4239
|
li as addEventListeners,
|