@annotorious/svelte 3.0.0-rc.4 → 3.0.0-rc.6
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-svelte.es.js +2 -2
- package/dist/annotorious-svelte.es5.js +279 -274
- package/dist/annotorious-svelte.es5.js.map +1 -1
- package/dist/annotorious-svelte.es6.js +7 -7
- package/dist/annotorious-svelte.es9.js +1652 -1647
- package/dist/annotorious-svelte.es9.js.map +1 -1
- package/package.json +6 -1
|
@@ -5,14 +5,14 @@ function qt(t, n) {
|
|
|
5
5
|
t[r] = n[r];
|
|
6
6
|
return t;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function kt(t) {
|
|
9
9
|
return t();
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function It() {
|
|
12
12
|
return /* @__PURE__ */ Object.create(null);
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
t.forEach(
|
|
14
|
+
function D(t) {
|
|
15
|
+
t.forEach(kt);
|
|
16
16
|
}
|
|
17
17
|
function _(t) {
|
|
18
18
|
return typeof t == "function";
|
|
@@ -23,7 +23,7 @@ function Et(t, n) {
|
|
|
23
23
|
function Jt(t) {
|
|
24
24
|
return Object.keys(t).length === 0;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function Kt(t, n, r, o) {
|
|
27
27
|
if (t) {
|
|
28
28
|
const s = jt(t, n, r, o);
|
|
29
29
|
return t[0](s);
|
|
@@ -32,7 +32,7 @@ function Qt(t, n, r, o) {
|
|
|
32
32
|
function jt(t, n, r, o) {
|
|
33
33
|
return t[1] && o ? qt(r.ctx.slice(), t[1](o(n))) : r.ctx;
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function Qt(t, n, r, o) {
|
|
36
36
|
if (t[2] && o) {
|
|
37
37
|
const s = t[2](o(r));
|
|
38
38
|
if (n.dirty === void 0)
|
|
@@ -47,13 +47,13 @@ function Zt(t, n, r, o) {
|
|
|
47
47
|
}
|
|
48
48
|
return n.dirty;
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function Zt(t, n, r, o, s, a) {
|
|
51
51
|
if (s) {
|
|
52
52
|
const c = jt(n, r, o, a);
|
|
53
53
|
t.p(c, s);
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function Mt(t) {
|
|
57
57
|
if (t.ctx.length > 32) {
|
|
58
58
|
const n = [], r = t.ctx.length / 32;
|
|
59
59
|
for (let o = 0; o < r; o++)
|
|
@@ -62,7 +62,7 @@ function Rt(t) {
|
|
|
62
62
|
}
|
|
63
63
|
return -1;
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function w(t, n, r) {
|
|
66
66
|
t.insertBefore(n, r || null);
|
|
67
67
|
}
|
|
68
68
|
function x(t) {
|
|
@@ -75,14 +75,14 @@ function tn(t, n) {
|
|
|
75
75
|
function L(t) {
|
|
76
76
|
return document.createElementNS("http://www.w3.org/2000/svg", t);
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function Xt(t) {
|
|
79
79
|
return document.createTextNode(t);
|
|
80
80
|
}
|
|
81
|
-
function
|
|
82
|
-
return
|
|
81
|
+
function C() {
|
|
82
|
+
return Xt(" ");
|
|
83
83
|
}
|
|
84
84
|
function nn() {
|
|
85
|
-
return
|
|
85
|
+
return Xt("");
|
|
86
86
|
}
|
|
87
87
|
function A(t, n, r, o) {
|
|
88
88
|
return t.addEventListener(n, r, o), () => t.removeEventListener(n, r, o);
|
|
@@ -97,14 +97,14 @@ function on(t, n, { bubbles: r = !1, cancelable: o = !1 } = {}) {
|
|
|
97
97
|
const s = document.createEvent("CustomEvent");
|
|
98
98
|
return s.initCustomEvent(t, r, o, n), s;
|
|
99
99
|
}
|
|
100
|
-
let
|
|
100
|
+
let K;
|
|
101
101
|
function J(t) {
|
|
102
|
-
|
|
102
|
+
K = t;
|
|
103
103
|
}
|
|
104
104
|
function en() {
|
|
105
|
-
if (!
|
|
105
|
+
if (!K)
|
|
106
106
|
throw new Error("Function called outside component initialization");
|
|
107
|
-
return
|
|
107
|
+
return K;
|
|
108
108
|
}
|
|
109
109
|
function sn() {
|
|
110
110
|
const t = en();
|
|
@@ -119,52 +119,52 @@ function sn() {
|
|
|
119
119
|
return !0;
|
|
120
120
|
};
|
|
121
121
|
}
|
|
122
|
-
function
|
|
122
|
+
function W(t, n) {
|
|
123
123
|
const r = t.$$.callbacks[n.type];
|
|
124
124
|
r && r.slice().forEach((o) => o.call(this, n));
|
|
125
125
|
}
|
|
126
|
-
const
|
|
126
|
+
const V = [], Ft = [];
|
|
127
127
|
let q = [];
|
|
128
|
-
const
|
|
129
|
-
let
|
|
128
|
+
const Rt = [], an = /* @__PURE__ */ Promise.resolve();
|
|
129
|
+
let Tt = !1;
|
|
130
130
|
function cn() {
|
|
131
|
-
|
|
131
|
+
Tt || (Tt = !0, an.then(Pt));
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function wt(t) {
|
|
134
134
|
q.push(t);
|
|
135
135
|
}
|
|
136
136
|
const $t = /* @__PURE__ */ new Set();
|
|
137
|
-
let
|
|
138
|
-
function
|
|
139
|
-
if (
|
|
137
|
+
let z = 0;
|
|
138
|
+
function Pt() {
|
|
139
|
+
if (z !== 0)
|
|
140
140
|
return;
|
|
141
|
-
const t =
|
|
141
|
+
const t = K;
|
|
142
142
|
do {
|
|
143
143
|
try {
|
|
144
|
-
for (;
|
|
145
|
-
const n =
|
|
146
|
-
|
|
144
|
+
for (; z < V.length; ) {
|
|
145
|
+
const n = V[z];
|
|
146
|
+
z++, J(n), ln(n.$$);
|
|
147
147
|
}
|
|
148
148
|
} catch (n) {
|
|
149
|
-
throw
|
|
149
|
+
throw V.length = 0, z = 0, n;
|
|
150
150
|
}
|
|
151
|
-
for (J(null),
|
|
152
|
-
|
|
151
|
+
for (J(null), V.length = 0, z = 0; Ft.length; )
|
|
152
|
+
Ft.pop()();
|
|
153
153
|
for (let n = 0; n < q.length; n += 1) {
|
|
154
154
|
const r = q[n];
|
|
155
155
|
$t.has(r) || ($t.add(r), r());
|
|
156
156
|
}
|
|
157
157
|
q.length = 0;
|
|
158
|
-
} while (
|
|
159
|
-
for (;
|
|
160
|
-
|
|
161
|
-
|
|
158
|
+
} while (V.length);
|
|
159
|
+
for (; Rt.length; )
|
|
160
|
+
Rt.pop()();
|
|
161
|
+
Tt = !1, $t.clear(), J(t);
|
|
162
162
|
}
|
|
163
163
|
function ln(t) {
|
|
164
164
|
if (t.fragment !== null) {
|
|
165
|
-
t.update(),
|
|
165
|
+
t.update(), D(t.before_update);
|
|
166
166
|
const n = t.dirty;
|
|
167
|
-
t.dirty = [-1], t.fragment && t.fragment.p(t.ctx, n), t.after_update.forEach(
|
|
167
|
+
t.dirty = [-1], t.fragment && t.fragment.p(t.ctx, n), t.after_update.forEach(wt);
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
function pn(t) {
|
|
@@ -176,7 +176,7 @@ let un;
|
|
|
176
176
|
function ut(t, n) {
|
|
177
177
|
t && t.i && (pt.delete(t), t.i(n));
|
|
178
178
|
}
|
|
179
|
-
function
|
|
179
|
+
function Ot(t, n, r, o) {
|
|
180
180
|
if (t && t.o) {
|
|
181
181
|
if (pt.has(t))
|
|
182
182
|
return;
|
|
@@ -186,25 +186,25 @@ function bt(t, n, r, o) {
|
|
|
186
186
|
} else
|
|
187
187
|
o && o();
|
|
188
188
|
}
|
|
189
|
-
function
|
|
189
|
+
function Dt(t) {
|
|
190
190
|
t && t.c();
|
|
191
191
|
}
|
|
192
|
-
function
|
|
192
|
+
function bt(t, n, r, o) {
|
|
193
193
|
const { fragment: s, after_update: a } = t.$$;
|
|
194
|
-
s && s.m(n, r), o ||
|
|
195
|
-
const c = t.$$.on_mount.map(
|
|
196
|
-
t.$$.on_destroy ? t.$$.on_destroy.push(...c) :
|
|
197
|
-
}), a.forEach(
|
|
194
|
+
s && s.m(n, r), o || wt(() => {
|
|
195
|
+
const c = t.$$.on_mount.map(kt).filter(_);
|
|
196
|
+
t.$$.on_destroy ? t.$$.on_destroy.push(...c) : D(c), t.$$.on_mount = [];
|
|
197
|
+
}), a.forEach(wt);
|
|
198
198
|
}
|
|
199
|
-
function
|
|
199
|
+
function St(t, n) {
|
|
200
200
|
const r = t.$$;
|
|
201
|
-
r.fragment !== null && (pn(r.after_update),
|
|
201
|
+
r.fragment !== null && (pn(r.after_update), D(r.on_destroy), r.fragment && r.fragment.d(n), r.on_destroy = r.fragment = null, r.ctx = []);
|
|
202
202
|
}
|
|
203
203
|
function hn(t, n) {
|
|
204
|
-
t.$$.dirty[0] === -1 && (
|
|
204
|
+
t.$$.dirty[0] === -1 && (V.push(t), cn(), t.$$.dirty.fill(0)), t.$$.dirty[n / 31 | 0] |= 1 << n % 31;
|
|
205
205
|
}
|
|
206
|
-
function
|
|
207
|
-
const p =
|
|
206
|
+
function vt(t, n, r, o, s, a, c, l = [-1]) {
|
|
207
|
+
const p = K;
|
|
208
208
|
J(t);
|
|
209
209
|
const f = t.$$ = {
|
|
210
210
|
fragment: null,
|
|
@@ -213,7 +213,7 @@ function Pt(t, n, r, o, s, a, c, l = [-1]) {
|
|
|
213
213
|
props: a,
|
|
214
214
|
update: xt,
|
|
215
215
|
not_equal: s,
|
|
216
|
-
bound:
|
|
216
|
+
bound: It(),
|
|
217
217
|
// lifecycle
|
|
218
218
|
on_mount: [],
|
|
219
219
|
on_destroy: [],
|
|
@@ -222,29 +222,29 @@ function Pt(t, n, r, o, s, a, c, l = [-1]) {
|
|
|
222
222
|
after_update: [],
|
|
223
223
|
context: new Map(n.context || (p ? p.$$.context : [])),
|
|
224
224
|
// everything else
|
|
225
|
-
callbacks:
|
|
225
|
+
callbacks: It(),
|
|
226
226
|
dirty: l,
|
|
227
227
|
skip_bound: !1,
|
|
228
228
|
root: n.target || p.$$.root
|
|
229
229
|
};
|
|
230
230
|
c && c(f.root);
|
|
231
|
-
let
|
|
231
|
+
let T = !1;
|
|
232
232
|
if (f.ctx = r ? r(t, n.props || {}, ($, m, ...i) => {
|
|
233
|
-
const
|
|
234
|
-
return f.ctx && s(f.ctx[$], f.ctx[$] =
|
|
235
|
-
}) : [], f.update(),
|
|
233
|
+
const g = i.length ? i[0] : m;
|
|
234
|
+
return f.ctx && s(f.ctx[$], f.ctx[$] = g) && (!f.skip_bound && f.bound[$] && f.bound[$](g), T && hn(t, $)), m;
|
|
235
|
+
}) : [], f.update(), T = !0, D(f.before_update), f.fragment = o ? o(f.ctx) : !1, n.target) {
|
|
236
236
|
if (n.hydrate) {
|
|
237
237
|
const $ = rn(n.target);
|
|
238
238
|
f.fragment && f.fragment.l($), $.forEach(x);
|
|
239
239
|
} else
|
|
240
240
|
f.fragment && f.fragment.c();
|
|
241
|
-
n.intro && ut(t.$$.fragment),
|
|
241
|
+
n.intro && ut(t.$$.fragment), bt(t, n.target, n.anchor, n.customElement), Pt();
|
|
242
242
|
}
|
|
243
243
|
J(p);
|
|
244
244
|
}
|
|
245
245
|
class _t {
|
|
246
246
|
$destroy() {
|
|
247
|
-
|
|
247
|
+
St(this, 1), this.$destroy = xt;
|
|
248
248
|
}
|
|
249
249
|
$on(n, r) {
|
|
250
250
|
if (!_(r))
|
|
@@ -259,8 +259,8 @@ class _t {
|
|
|
259
259
|
this.$$set && !Jt(n) && (this.$$.skip_bound = !0, this.$$set(n), this.$$.skip_bound = !1);
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
|
-
var
|
|
263
|
-
const At = (t, n) => n,
|
|
262
|
+
var N = /* @__PURE__ */ ((t) => (t.ELLIPSE = "ELLIPSE", t.POLYGON = "POLYGON", t.RECTANGLE = "RECTANGLE", t))(N || {});
|
|
263
|
+
const At = (t, n) => n, zt = (t) => {
|
|
264
264
|
let n = 1 / 0, r = 1 / 0, o = -1 / 0, s = -1 / 0;
|
|
265
265
|
return t.forEach(([a, c]) => {
|
|
266
266
|
n = Math.min(n, a), r = Math.min(r, c), o = Math.max(o, a), s = Math.max(s, c);
|
|
@@ -268,11 +268,11 @@ const At = (t, n) => n, Dt = (t) => {
|
|
|
268
268
|
}, dn = {
|
|
269
269
|
area: (t) => Math.PI * t.geometry.rx * t.geometry.ry,
|
|
270
270
|
intersects: (t, n, r) => {
|
|
271
|
-
const { cx: o, cy: s, rx: a, ry: c } = t.geometry, l = 0, p = Math.cos(l), f = Math.sin(l),
|
|
271
|
+
const { cx: o, cy: s, rx: a, ry: c } = t.geometry, l = 0, p = Math.cos(l), f = Math.sin(l), T = n - o, $ = r - s, m = p * T + f * $, i = f * T - p * $;
|
|
272
272
|
return m * m / (a * a) + i * i / (c * c) <= 1;
|
|
273
273
|
}
|
|
274
274
|
};
|
|
275
|
-
At(
|
|
275
|
+
At(N.ELLIPSE, dn);
|
|
276
276
|
const fn = {
|
|
277
277
|
area: (t) => {
|
|
278
278
|
const { points: n } = t.geometry;
|
|
@@ -285,36 +285,36 @@ const fn = {
|
|
|
285
285
|
const { points: o } = t.geometry;
|
|
286
286
|
let s = !1;
|
|
287
287
|
for (let a = 0, c = o.length - 1; a < o.length; c = a++) {
|
|
288
|
-
const l = o[a][0], p = o[a][1], f = o[c][0],
|
|
289
|
-
p > r !=
|
|
288
|
+
const l = o[a][0], p = o[a][1], f = o[c][0], T = o[c][1];
|
|
289
|
+
p > r != T > r && n < (f - l) * (r - p) / (T - p) + l && (s = !s);
|
|
290
290
|
}
|
|
291
291
|
return s;
|
|
292
292
|
}
|
|
293
293
|
};
|
|
294
|
-
At(
|
|
295
|
-
const
|
|
294
|
+
At(N.POLYGON, fn);
|
|
295
|
+
const gn = {
|
|
296
296
|
area: (t) => t.geometry.w * t.geometry.h,
|
|
297
297
|
intersects: (t, n, r) => n >= t.geometry.x && n <= t.geometry.x + t.geometry.w && r >= t.geometry.y && r <= t.geometry.y + t.geometry.h
|
|
298
298
|
};
|
|
299
|
-
At(
|
|
300
|
-
const
|
|
301
|
-
const r = typeof t == "string" ? t : t.value, o = /^(xywh)=(pixel|percent)?:?(.+?),(.+?),(.+?),(.+)*/g, s = [...r.matchAll(o)][0], [a, c, l, p, f,
|
|
299
|
+
At(N.RECTANGLE, gn);
|
|
300
|
+
const yn = (t, n = !1) => {
|
|
301
|
+
const r = typeof t == "string" ? t : t.value, o = /^(xywh)=(pixel|percent)?:?(.+?),(.+?),(.+?),(.+)*/g, s = [...r.matchAll(o)][0], [a, c, l, p, f, T, $] = s;
|
|
302
302
|
if (c !== "xywh")
|
|
303
303
|
throw new Error("Unsupported MediaFragment: " + r);
|
|
304
304
|
if (l && l !== "pixel")
|
|
305
305
|
throw new Error(`Unsupported MediaFragment unit: ${l}`);
|
|
306
|
-
const [m, i,
|
|
306
|
+
const [m, i, g, h] = [p, f, T, $].map(parseFloat);
|
|
307
307
|
return {
|
|
308
|
-
type:
|
|
308
|
+
type: N.RECTANGLE,
|
|
309
309
|
geometry: {
|
|
310
310
|
x: m,
|
|
311
311
|
y: i,
|
|
312
|
-
w:
|
|
312
|
+
w: g,
|
|
313
313
|
h,
|
|
314
314
|
bounds: {
|
|
315
315
|
minX: m,
|
|
316
316
|
minY: n ? i - h : i,
|
|
317
|
-
maxX: m +
|
|
317
|
+
maxX: m + g,
|
|
318
318
|
maxY: n ? i : i + h
|
|
319
319
|
}
|
|
320
320
|
}
|
|
@@ -326,7 +326,7 @@ const gn = (t, n = !1) => {
|
|
|
326
326
|
conformsTo: "http://www.w3.org/TR/media-frags/",
|
|
327
327
|
value: `xywh=pixel:${n},${r},${o},${s}`
|
|
328
328
|
};
|
|
329
|
-
},
|
|
329
|
+
}, Vt = "http://www.w3.org/2000/svg", Ht = (t) => {
|
|
330
330
|
const n = (o) => {
|
|
331
331
|
Array.from(o.attributes).forEach((s) => {
|
|
332
332
|
s.name.startsWith("on") && o.removeAttribute(s.name);
|
|
@@ -334,24 +334,24 @@ const gn = (t, n = !1) => {
|
|
|
334
334
|
}, r = t.getElementsByTagName("script");
|
|
335
335
|
return Array.from(r).reverse().forEach((o) => o.parentNode.removeChild(o)), Array.from(t.querySelectorAll("*")).forEach(n), t;
|
|
336
336
|
}, $n = (t) => {
|
|
337
|
-
const n = new XMLSerializer().serializeToString(t.documentElement).replace("<svg>", `<svg xmlns="${
|
|
337
|
+
const n = new XMLSerializer().serializeToString(t.documentElement).replace("<svg>", `<svg xmlns="${Vt}">`);
|
|
338
338
|
return new DOMParser().parseFromString(n, "image/svg+xml").documentElement;
|
|
339
339
|
}, xn = (t) => {
|
|
340
|
-
const n = new DOMParser().parseFromString(t, "image/svg+xml"), r = n.lookupPrefix(
|
|
340
|
+
const n = new DOMParser().parseFromString(t, "image/svg+xml"), r = n.lookupPrefix(Vt), o = n.lookupNamespaceURI(null);
|
|
341
341
|
return r || o ? Ht(n).firstChild : Ht($n(n)).firstChild;
|
|
342
|
-
},
|
|
342
|
+
}, Tn = (t) => {
|
|
343
343
|
const [n, r, o] = t.match(/(<polygon points=["|'])([^("|')]*)/) || [];
|
|
344
344
|
if (!o)
|
|
345
345
|
return;
|
|
346
346
|
const s = o.split(" ").map((a) => a.split(",").map(parseFloat));
|
|
347
347
|
return {
|
|
348
|
-
type:
|
|
348
|
+
type: N.POLYGON,
|
|
349
349
|
geometry: {
|
|
350
350
|
points: s,
|
|
351
|
-
bounds:
|
|
351
|
+
bounds: zt(s)
|
|
352
352
|
}
|
|
353
353
|
};
|
|
354
|
-
},
|
|
354
|
+
}, wn = (t) => {
|
|
355
355
|
const n = xn(t), r = parseFloat(n.getAttribute("cx")), o = parseFloat(n.getAttribute("cy")), s = parseFloat(n.getAttribute("rx")), a = parseFloat(n.getAttribute("ry")), c = {
|
|
356
356
|
minX: r - s,
|
|
357
357
|
minY: o - a,
|
|
@@ -359,7 +359,7 @@ const gn = (t, n = !1) => {
|
|
|
359
359
|
maxY: o + a
|
|
360
360
|
};
|
|
361
361
|
return {
|
|
362
|
-
type:
|
|
362
|
+
type: N.ELLIPSE,
|
|
363
363
|
geometry: {
|
|
364
364
|
cx: r,
|
|
365
365
|
cy: o,
|
|
@@ -371,15 +371,15 @@ const gn = (t, n = !1) => {
|
|
|
371
371
|
}, En = (t) => {
|
|
372
372
|
const n = typeof t == "string" ? t : t.value;
|
|
373
373
|
if (n.includes("<polygon points="))
|
|
374
|
-
return wn(n);
|
|
375
|
-
if (n.includes("<ellipse "))
|
|
376
374
|
return Tn(n);
|
|
377
|
-
|
|
375
|
+
if (n.includes("<ellipse "))
|
|
376
|
+
return wn(n);
|
|
377
|
+
}, On = (t) => {
|
|
378
378
|
let n;
|
|
379
|
-
if (t.type ===
|
|
379
|
+
if (t.type === N.POLYGON) {
|
|
380
380
|
const r = t.geometry, { points: o } = r;
|
|
381
381
|
n = `<svg><polygon points="${o.map((s) => s.join(",")).join(" ")}" /></svg>`;
|
|
382
|
-
} else if (t.type ===
|
|
382
|
+
} else if (t.type === N.ELLIPSE) {
|
|
383
383
|
const r = t.geometry;
|
|
384
384
|
n = `<svg><ellipse cx="${r.cx}" cy="${r.cy}" rx="${r.rx}" ry="${r.ry}" /></svg>`;
|
|
385
385
|
}
|
|
@@ -388,17 +388,17 @@ const gn = (t, n = !1) => {
|
|
|
388
388
|
throw `Unsupported shape type: ${t.type}`;
|
|
389
389
|
};
|
|
390
390
|
let lt;
|
|
391
|
-
const
|
|
392
|
-
function
|
|
391
|
+
const bn = new Uint8Array(16);
|
|
392
|
+
function Sn() {
|
|
393
393
|
if (!lt && (lt = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !lt))
|
|
394
394
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
395
|
-
return lt(
|
|
395
|
+
return lt(bn);
|
|
396
396
|
}
|
|
397
|
-
const
|
|
397
|
+
const b = [];
|
|
398
398
|
for (let t = 0; t < 256; ++t)
|
|
399
|
-
|
|
400
|
-
function
|
|
401
|
-
return
|
|
399
|
+
b.push((t + 256).toString(16).slice(1));
|
|
400
|
+
function vn(t, n = 0) {
|
|
401
|
+
return b[t[n + 0]] + b[t[n + 1]] + b[t[n + 2]] + b[t[n + 3]] + "-" + b[t[n + 4]] + b[t[n + 5]] + "-" + b[t[n + 6]] + b[t[n + 7]] + "-" + b[t[n + 8]] + b[t[n + 9]] + "-" + b[t[n + 10]] + b[t[n + 11]] + b[t[n + 12]] + b[t[n + 13]] + b[t[n + 14]] + b[t[n + 15]];
|
|
402
402
|
}
|
|
403
403
|
const _n = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Gt = {
|
|
404
404
|
randomUUID: _n
|
|
@@ -407,17 +407,21 @@ function An(t, n, r) {
|
|
|
407
407
|
if (Gt.randomUUID && !n && !t)
|
|
408
408
|
return Gt.randomUUID();
|
|
409
409
|
t = t || {};
|
|
410
|
-
const o = t.random || (t.rng ||
|
|
410
|
+
const o = t.random || (t.rng || Sn)();
|
|
411
411
|
if (o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, n) {
|
|
412
412
|
r = r || 0;
|
|
413
413
|
for (let s = 0; s < 16; ++s)
|
|
414
414
|
n[r + s] = o[s];
|
|
415
415
|
return n;
|
|
416
416
|
}
|
|
417
|
-
return
|
|
417
|
+
return vn(o);
|
|
418
418
|
}
|
|
419
|
-
|
|
420
|
-
|
|
419
|
+
const Ln = [];
|
|
420
|
+
for (let t = 0; t < 256; ++t)
|
|
421
|
+
Ln.push((t + 256).toString(16).slice(1));
|
|
422
|
+
typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
423
|
+
let In = (t = 21) => crypto.getRandomValues(new Uint8Array(t)).reduce((n, r) => (r &= 63, r < 36 ? n += r.toString(36) : r < 62 ? n += (r - 26).toString(36).toUpperCase() : r > 62 ? n += "-" : n += "_", n), "");
|
|
424
|
+
const Fn = (t) => {
|
|
421
425
|
const n = JSON.stringify(t);
|
|
422
426
|
let r = 0;
|
|
423
427
|
for (let o = 0, s = n.length; o < s; o++) {
|
|
@@ -425,10 +429,10 @@ const Mn = (t) => {
|
|
|
425
429
|
r = (r << 5) - r + a, r |= 0;
|
|
426
430
|
}
|
|
427
431
|
return `${r}`;
|
|
428
|
-
},
|
|
432
|
+
}, Rn = (t, n) => (Array.isArray(t) ? t : [t]).map((r) => {
|
|
429
433
|
const { id: o, type: s, purpose: a, value: c, created: l, creator: p, ...f } = r;
|
|
430
434
|
return {
|
|
431
|
-
id: o || `temp-${
|
|
435
|
+
id: o || `temp-${Fn(r)}`,
|
|
432
436
|
annotation: n,
|
|
433
437
|
type: s,
|
|
434
438
|
purpose: a,
|
|
@@ -437,20 +441,21 @@ const Mn = (t) => {
|
|
|
437
441
|
creator: p ? typeof p == "object" ? { ...p } : p : void 0,
|
|
438
442
|
...f
|
|
439
443
|
};
|
|
440
|
-
}),
|
|
444
|
+
}), Hn = (t) => t.map((n) => {
|
|
441
445
|
var r;
|
|
442
446
|
const o = { ...n };
|
|
443
447
|
return delete o.annotation, (r = o.id) != null && r.startsWith("temp-") && delete o.id, o;
|
|
444
448
|
});
|
|
445
|
-
|
|
446
|
-
const
|
|
447
|
-
const r = t.id || An(), { body: o, ...s } = t, a =
|
|
449
|
+
In();
|
|
450
|
+
const qn = (t, n = !1) => ({ parse: (r) => Gn(r, n), serialize: (r) => Un(r, t) }), Gn = (t, n = !1) => {
|
|
451
|
+
const r = t.id || An(), { body: o, ...s } = t, a = Rn(o, r), c = Array.isArray(t.target) ? t.target[0] : t.target, l = Array.isArray(c.selector) ? c.selector[0] : c.selector, p = l.type === "FragmentSelector" ? yn(l, n) : l.type === "SvgSelector" ? En(l) : void 0;
|
|
448
452
|
return p ? {
|
|
449
453
|
parsed: {
|
|
450
454
|
...s,
|
|
451
455
|
id: r,
|
|
452
456
|
bodies: a,
|
|
453
457
|
target: {
|
|
458
|
+
...s.target,
|
|
454
459
|
annotation: r,
|
|
455
460
|
selector: p
|
|
456
461
|
}
|
|
@@ -458,25 +463,25 @@ const Wn = (t, n = !1) => ({ parse: (r) => Hn(r, n), serialize: (r) => Gn(r, t)
|
|
|
458
463
|
} : {
|
|
459
464
|
error: Error(`Unknown selector type: ${l.type}`)
|
|
460
465
|
};
|
|
461
|
-
},
|
|
462
|
-
const r = t.target.selector, o = r.type ==
|
|
466
|
+
}, Un = (t, n) => {
|
|
467
|
+
const r = t.target.selector, o = r.type == N.RECTANGLE ? mn(r.geometry) : On(r);
|
|
463
468
|
return {
|
|
464
469
|
...t,
|
|
465
470
|
"@context": "http://www.w3.org/ns/anno.jsonld",
|
|
466
471
|
id: t.id,
|
|
467
472
|
type: "Annotation",
|
|
468
|
-
body:
|
|
473
|
+
body: Hn(t.bodies),
|
|
469
474
|
target: {
|
|
470
475
|
source: n,
|
|
471
476
|
selector: o
|
|
472
477
|
}
|
|
473
478
|
};
|
|
474
479
|
};
|
|
475
|
-
function
|
|
480
|
+
function Ut(t, n, r) {
|
|
476
481
|
const o = t.slice();
|
|
477
482
|
return o[11] = n[r], o[13] = r, o;
|
|
478
483
|
}
|
|
479
|
-
function
|
|
484
|
+
function Nt(t) {
|
|
480
485
|
let n, r, o, s, a;
|
|
481
486
|
return {
|
|
482
487
|
c() {
|
|
@@ -497,7 +502,7 @@ function Bt(t) {
|
|
|
497
502
|
);
|
|
498
503
|
},
|
|
499
504
|
m(c, l) {
|
|
500
|
-
|
|
505
|
+
w(c, n, l), s || (a = A(n, "pointerdown", function() {
|
|
501
506
|
_(
|
|
502
507
|
/*grab*/
|
|
503
508
|
t[10](d(
|
|
@@ -537,32 +542,32 @@ function Bt(t) {
|
|
|
537
542
|
};
|
|
538
543
|
}
|
|
539
544
|
function Nn(t) {
|
|
540
|
-
let n, r, o, s, a, c, l, p, f,
|
|
545
|
+
let n, r, o, s, a, c, l, p, f, T, $ = (
|
|
541
546
|
/*geom*/
|
|
542
547
|
t[4].points
|
|
543
548
|
), m = [];
|
|
544
549
|
for (let i = 0; i < $.length; i += 1)
|
|
545
|
-
m[i] =
|
|
550
|
+
m[i] = Nt(Ut(t, $, i));
|
|
546
551
|
return {
|
|
547
552
|
c() {
|
|
548
|
-
n = L("polygon"), s =
|
|
553
|
+
n = L("polygon"), s = C(), a = L("polygon"), l = C();
|
|
549
554
|
for (let i = 0; i < m.length; i += 1)
|
|
550
555
|
m[i].c();
|
|
551
556
|
p = nn(), e(n, "class", "a9s-outer"), e(n, "style", r = /*computedStyle*/
|
|
552
557
|
t[1] ? "display:none;" : void 0), e(n, "points", o = /*geom*/
|
|
553
|
-
t[4].points.map(
|
|
558
|
+
t[4].points.map(Bt).join(" ")), e(a, "class", "a9s-inner a9s-shape-handle"), e(
|
|
554
559
|
a,
|
|
555
560
|
"style",
|
|
556
561
|
/*computedStyle*/
|
|
557
562
|
t[1]
|
|
558
563
|
), e(a, "points", c = /*geom*/
|
|
559
|
-
t[4].points.map(
|
|
564
|
+
t[4].points.map(Ct).join(" "));
|
|
560
565
|
},
|
|
561
|
-
m(i,
|
|
562
|
-
|
|
566
|
+
m(i, g) {
|
|
567
|
+
w(i, n, g), w(i, s, g), w(i, a, g), w(i, l, g);
|
|
563
568
|
for (let h = 0; h < m.length; h += 1)
|
|
564
|
-
m[h] && m[h].m(i,
|
|
565
|
-
|
|
569
|
+
m[h] && m[h].m(i, g);
|
|
570
|
+
w(i, p, g), f || (T = [
|
|
566
571
|
A(n, "pointerdown", function() {
|
|
567
572
|
_(
|
|
568
573
|
/*grab*/
|
|
@@ -577,27 +582,27 @@ function Nn(t) {
|
|
|
577
582
|
})
|
|
578
583
|
], f = !0);
|
|
579
584
|
},
|
|
580
|
-
p(i,
|
|
581
|
-
if (t = i,
|
|
585
|
+
p(i, g) {
|
|
586
|
+
if (t = i, g & /*computedStyle*/
|
|
582
587
|
2 && r !== (r = /*computedStyle*/
|
|
583
|
-
t[1] ? "display:none;" : void 0) && e(n, "style", r),
|
|
588
|
+
t[1] ? "display:none;" : void 0) && e(n, "style", r), g & /*geom*/
|
|
584
589
|
16 && o !== (o = /*geom*/
|
|
585
|
-
t[4].points.map(
|
|
590
|
+
t[4].points.map(Bt).join(" ")) && e(n, "points", o), g & /*computedStyle*/
|
|
586
591
|
2 && e(
|
|
587
592
|
a,
|
|
588
593
|
"style",
|
|
589
594
|
/*computedStyle*/
|
|
590
595
|
t[1]
|
|
591
|
-
),
|
|
596
|
+
), g & /*geom*/
|
|
592
597
|
16 && c !== (c = /*geom*/
|
|
593
|
-
t[4].points.map(
|
|
598
|
+
t[4].points.map(Ct).join(" ")) && e(a, "points", c), g & /*geom, handleSize, grab, Handle*/
|
|
594
599
|
1048) {
|
|
595
600
|
$ = /*geom*/
|
|
596
601
|
t[4].points;
|
|
597
602
|
let h;
|
|
598
603
|
for (h = 0; h < $.length; h += 1) {
|
|
599
|
-
const E =
|
|
600
|
-
m[h] ? m[h].p(E,
|
|
604
|
+
const E = Ut(t, $, h);
|
|
605
|
+
m[h] ? m[h].p(E, g) : (m[h] = Nt(E), m[h].c(), m[h].m(p.parentNode, p));
|
|
601
606
|
}
|
|
602
607
|
for (; h < m.length; h += 1)
|
|
603
608
|
m[h].d(1);
|
|
@@ -605,13 +610,13 @@ function Nn(t) {
|
|
|
605
610
|
}
|
|
606
611
|
},
|
|
607
612
|
d(i) {
|
|
608
|
-
i && x(n), i && x(s), i && x(a), i && x(l), tn(m, i), i && x(p), f = !1,
|
|
613
|
+
i && x(n), i && x(s), i && x(a), i && x(l), tn(m, i), i && x(p), f = !1, D(T);
|
|
609
614
|
}
|
|
610
615
|
};
|
|
611
616
|
}
|
|
612
617
|
function Bn(t) {
|
|
613
618
|
let n, r;
|
|
614
|
-
return n = new
|
|
619
|
+
return n = new Wt({
|
|
615
620
|
props: {
|
|
616
621
|
shape: (
|
|
617
622
|
/*shape*/
|
|
@@ -648,10 +653,10 @@ function Bn(t) {
|
|
|
648
653
|
t[9]
|
|
649
654
|
), {
|
|
650
655
|
c() {
|
|
651
|
-
|
|
656
|
+
Dt(n.$$.fragment);
|
|
652
657
|
},
|
|
653
658
|
m(o, s) {
|
|
654
|
-
|
|
659
|
+
bt(n, o, s), r = !0;
|
|
655
660
|
},
|
|
656
661
|
p(o, [s]) {
|
|
657
662
|
const a = {};
|
|
@@ -666,30 +671,30 @@ function Bn(t) {
|
|
|
666
671
|
r || (ut(n.$$.fragment, o), r = !0);
|
|
667
672
|
},
|
|
668
673
|
o(o) {
|
|
669
|
-
|
|
674
|
+
Ot(n.$$.fragment, o), r = !1;
|
|
670
675
|
},
|
|
671
676
|
d(o) {
|
|
672
|
-
|
|
677
|
+
St(n, o);
|
|
673
678
|
}
|
|
674
679
|
};
|
|
675
680
|
}
|
|
676
|
-
const
|
|
681
|
+
const Bt = (t) => t.join(","), Ct = (t) => t.join(",");
|
|
677
682
|
function Cn(t, n, r) {
|
|
678
683
|
let o, s, { shape: a } = n, { computedStyle: c = void 0 } = n, { transform: l } = n, { viewportScale: p = 1 } = n;
|
|
679
|
-
const f = (i,
|
|
684
|
+
const f = (i, g, h) => {
|
|
680
685
|
let E;
|
|
681
|
-
|
|
682
|
-
const
|
|
683
|
-
return { ...i, geometry: { points: E, bounds:
|
|
686
|
+
g === d.SHAPE ? E = i.geometry.points.map(([v, O]) => [v + h[0], O + h[1]]) : E = i.geometry.points.map(([v, O], B) => g === d(B) ? [v + h[0], O + h[1]] : [v, O]);
|
|
687
|
+
const I = zt(E);
|
|
688
|
+
return { ...i, geometry: { points: E, bounds: I } };
|
|
684
689
|
};
|
|
685
|
-
function
|
|
686
|
-
|
|
690
|
+
function T(i) {
|
|
691
|
+
W.call(this, t, i);
|
|
687
692
|
}
|
|
688
693
|
function $(i) {
|
|
689
|
-
|
|
694
|
+
W.call(this, t, i);
|
|
690
695
|
}
|
|
691
696
|
function m(i) {
|
|
692
|
-
|
|
697
|
+
W.call(this, t, i);
|
|
693
698
|
}
|
|
694
699
|
return t.$$set = (i) => {
|
|
695
700
|
"shape" in i && r(0, a = i.shape), "computedStyle" in i && r(1, c = i.computedStyle), "transform" in i && r(2, l = i.transform), "viewportScale" in i && r(6, p = i.viewportScale);
|
|
@@ -705,14 +710,14 @@ function Cn(t, n, r) {
|
|
|
705
710
|
o,
|
|
706
711
|
f,
|
|
707
712
|
p,
|
|
708
|
-
|
|
713
|
+
T,
|
|
709
714
|
$,
|
|
710
715
|
m
|
|
711
716
|
];
|
|
712
717
|
}
|
|
713
|
-
class
|
|
718
|
+
class Yn extends _t {
|
|
714
719
|
constructor(n) {
|
|
715
|
-
super(),
|
|
720
|
+
super(), vt(this, n, Cn, Bn, Et, {
|
|
716
721
|
shape: 0,
|
|
717
722
|
computedStyle: 1,
|
|
718
723
|
transform: 2,
|
|
@@ -721,10 +726,10 @@ class Un extends _t {
|
|
|
721
726
|
}
|
|
722
727
|
}
|
|
723
728
|
function kn(t) {
|
|
724
|
-
let n, r, o, s, a, c, l, p, f,
|
|
729
|
+
let n, r, o, s, a, c, l, p, f, T, $, m, i, g, h, E, I, v, O, B, Y, k, j, S, X, P, Q, ht, U, Z, M, tt, dt, F, nt, rt, ft, R, ot, et, gt, H, st, at, yt, G, it, ct, mt, Lt;
|
|
725
730
|
return {
|
|
726
731
|
c() {
|
|
727
|
-
n = L("rect"), l =
|
|
732
|
+
n = L("rect"), l = C(), p = L("rect"), i = C(), g = L("rect"), v = C(), O = L("rect"), j = C(), S = L("rect"), ht = C(), U = L("rect"), dt = C(), F = L("rect"), ft = C(), R = L("rect"), gt = C(), H = L("rect"), yt = C(), G = L("rect"), e(n, "class", "a9s-outer"), e(n, "style", r = /*computedStyle*/
|
|
728
733
|
t[1] ? "display:none;" : void 0), e(n, "x", o = /*geom*/
|
|
729
734
|
t[4].x), e(n, "y", s = /*geom*/
|
|
730
735
|
t[4].y), e(n, "width", a = /*geom*/
|
|
@@ -735,49 +740,49 @@ function kn(t) {
|
|
|
735
740
|
/*computedStyle*/
|
|
736
741
|
t[1]
|
|
737
742
|
), e(p, "x", f = /*geom*/
|
|
738
|
-
t[4].x), e(p, "y",
|
|
743
|
+
t[4].x), e(p, "y", T = /*geom*/
|
|
739
744
|
t[4].y), e(p, "width", $ = /*geom*/
|
|
740
745
|
t[4].w), e(p, "height", m = /*geom*/
|
|
741
|
-
t[4].h), e(
|
|
742
|
-
t[4].x), e(
|
|
743
|
-
t[4].y), e(
|
|
744
|
-
t[4].w), e(
|
|
746
|
+
t[4].h), e(g, "class", "a9s-edge-handle a9s-edge-handle-top"), e(g, "x", h = /*geom*/
|
|
747
|
+
t[4].x), e(g, "y", E = /*geom*/
|
|
748
|
+
t[4].y), e(g, "height", 1), e(g, "width", I = /*geom*/
|
|
749
|
+
t[4].w), e(O, "class", "a9s-edge-handle a9s-edge-handle-right"), e(O, "x", B = /*geom*/
|
|
745
750
|
t[4].x + /*geom*/
|
|
746
|
-
t[4].w), e(
|
|
747
|
-
t[4].y), e(
|
|
748
|
-
t[4].h), e(
|
|
749
|
-
t[4].x), e(
|
|
751
|
+
t[4].w), e(O, "y", Y = /*geom*/
|
|
752
|
+
t[4].y), e(O, "height", k = /*geom*/
|
|
753
|
+
t[4].h), e(O, "width", 1), e(S, "class", "a9s-edge-handle a9s-edge-handle-bottom"), e(S, "x", X = /*geom*/
|
|
754
|
+
t[4].x), e(S, "y", P = /*geom*/
|
|
750
755
|
t[4].y + /*geom*/
|
|
751
|
-
t[4].h), e(
|
|
752
|
-
t[4].w), e(
|
|
753
|
-
t[4].x), e(
|
|
754
|
-
t[4].y), e(
|
|
755
|
-
t[4].h), e(
|
|
756
|
+
t[4].h), e(S, "height", 1), e(S, "width", Q = /*geom*/
|
|
757
|
+
t[4].w), e(U, "class", "a9s-edge-handle a9s-edge-handle-left"), e(U, "x", Z = /*geom*/
|
|
758
|
+
t[4].x), e(U, "y", M = /*geom*/
|
|
759
|
+
t[4].y), e(U, "height", tt = /*geom*/
|
|
760
|
+
t[4].h), e(U, "width", 1), e(F, "class", "a9s-corner-handle a9s-corner-handle-topleft"), e(F, "x", nt = /*geom*/
|
|
756
761
|
t[4].x - /*handleSize*/
|
|
757
|
-
t[3] / 2), e(
|
|
762
|
+
t[3] / 2), e(F, "y", rt = /*geom*/
|
|
758
763
|
t[4].y - /*handleSize*/
|
|
759
764
|
t[3] / 2), e(
|
|
760
|
-
|
|
765
|
+
F,
|
|
761
766
|
"height",
|
|
762
767
|
/*handleSize*/
|
|
763
768
|
t[3]
|
|
764
769
|
), e(
|
|
765
|
-
|
|
770
|
+
F,
|
|
766
771
|
"width",
|
|
767
772
|
/*handleSize*/
|
|
768
773
|
t[3]
|
|
769
|
-
), e(
|
|
774
|
+
), e(R, "class", "a9s-corner-handle a9s-corner-handle-topright"), e(R, "x", ot = /*geom*/
|
|
770
775
|
t[4].x + /*geom*/
|
|
771
776
|
t[4].w - /*handleSize*/
|
|
772
|
-
t[3] / 2), e(
|
|
777
|
+
t[3] / 2), e(R, "y", et = /*geom*/
|
|
773
778
|
t[4].y - /*handleSize*/
|
|
774
779
|
t[3] / 2), e(
|
|
775
|
-
|
|
780
|
+
R,
|
|
776
781
|
"height",
|
|
777
782
|
/*handleSize*/
|
|
778
783
|
t[3]
|
|
779
784
|
), e(
|
|
780
|
-
|
|
785
|
+
R,
|
|
781
786
|
"width",
|
|
782
787
|
/*handleSize*/
|
|
783
788
|
t[3]
|
|
@@ -814,8 +819,8 @@ function kn(t) {
|
|
|
814
819
|
t[3]
|
|
815
820
|
);
|
|
816
821
|
},
|
|
817
|
-
m(
|
|
818
|
-
|
|
822
|
+
m(y, u) {
|
|
823
|
+
w(y, n, u), w(y, l, u), w(y, p, u), w(y, i, u), w(y, g, u), w(y, v, u), w(y, O, u), w(y, j, u), w(y, S, u), w(y, ht, u), w(y, U, u), w(y, dt, u), w(y, F, u), w(y, ft, u), w(y, R, u), w(y, gt, u), w(y, H, u), w(y, yt, u), w(y, G, u), mt || (Lt = [
|
|
819
824
|
A(n, "pointerdown", function() {
|
|
820
825
|
_(
|
|
821
826
|
/*grab*/
|
|
@@ -828,37 +833,37 @@ function kn(t) {
|
|
|
828
833
|
t[10](d.SHAPE)
|
|
829
834
|
) && t[10](d.SHAPE).apply(this, arguments);
|
|
830
835
|
}),
|
|
831
|
-
A(
|
|
836
|
+
A(g, "pointerdown", function() {
|
|
832
837
|
_(
|
|
833
838
|
/*grab*/
|
|
834
839
|
t[10](d.TOP)
|
|
835
840
|
) && t[10](d.TOP).apply(this, arguments);
|
|
836
841
|
}),
|
|
837
|
-
A(
|
|
842
|
+
A(O, "pointerdown", function() {
|
|
838
843
|
_(
|
|
839
844
|
/*grab*/
|
|
840
845
|
t[10](d.RIGHT)
|
|
841
846
|
) && t[10](d.RIGHT).apply(this, arguments);
|
|
842
847
|
}),
|
|
843
|
-
A(
|
|
848
|
+
A(S, "pointerdown", function() {
|
|
844
849
|
_(
|
|
845
850
|
/*grab*/
|
|
846
851
|
t[10](d.BOTTOM)
|
|
847
852
|
) && t[10](d.BOTTOM).apply(this, arguments);
|
|
848
853
|
}),
|
|
849
|
-
A(
|
|
854
|
+
A(U, "pointerdown", function() {
|
|
850
855
|
_(
|
|
851
856
|
/*grab*/
|
|
852
857
|
t[10](d.LEFT)
|
|
853
858
|
) && t[10](d.LEFT).apply(this, arguments);
|
|
854
859
|
}),
|
|
855
|
-
A(
|
|
860
|
+
A(F, "pointerdown", function() {
|
|
856
861
|
_(
|
|
857
862
|
/*grab*/
|
|
858
863
|
t[10](d.TOP_LEFT)
|
|
859
864
|
) && t[10](d.TOP_LEFT).apply(this, arguments);
|
|
860
865
|
}),
|
|
861
|
-
A(
|
|
866
|
+
A(R, "pointerdown", function() {
|
|
862
867
|
_(
|
|
863
868
|
/*grab*/
|
|
864
869
|
t[10](d.TOP_RIGHT)
|
|
@@ -878,8 +883,8 @@ function kn(t) {
|
|
|
878
883
|
})
|
|
879
884
|
], mt = !0);
|
|
880
885
|
},
|
|
881
|
-
p(
|
|
882
|
-
t =
|
|
886
|
+
p(y, u) {
|
|
887
|
+
t = y, u & /*computedStyle*/
|
|
883
888
|
2 && r !== (r = /*computedStyle*/
|
|
884
889
|
t[1] ? "display:none;" : void 0) && e(n, "style", r), u & /*geom*/
|
|
885
890
|
16 && o !== (o = /*geom*/
|
|
@@ -898,52 +903,52 @@ function kn(t) {
|
|
|
898
903
|
), u & /*geom*/
|
|
899
904
|
16 && f !== (f = /*geom*/
|
|
900
905
|
t[4].x) && e(p, "x", f), u & /*geom*/
|
|
901
|
-
16 &&
|
|
902
|
-
t[4].y) && e(p, "y",
|
|
906
|
+
16 && T !== (T = /*geom*/
|
|
907
|
+
t[4].y) && e(p, "y", T), u & /*geom*/
|
|
903
908
|
16 && $ !== ($ = /*geom*/
|
|
904
909
|
t[4].w) && e(p, "width", $), u & /*geom*/
|
|
905
910
|
16 && m !== (m = /*geom*/
|
|
906
911
|
t[4].h) && e(p, "height", m), u & /*geom*/
|
|
907
912
|
16 && h !== (h = /*geom*/
|
|
908
|
-
t[4].x) && e(
|
|
913
|
+
t[4].x) && e(g, "x", h), u & /*geom*/
|
|
909
914
|
16 && E !== (E = /*geom*/
|
|
910
|
-
t[4].y) && e(
|
|
911
|
-
16 &&
|
|
912
|
-
t[4].w) && e(
|
|
913
|
-
16 &&
|
|
915
|
+
t[4].y) && e(g, "y", E), u & /*geom*/
|
|
916
|
+
16 && I !== (I = /*geom*/
|
|
917
|
+
t[4].w) && e(g, "width", I), u & /*geom*/
|
|
918
|
+
16 && B !== (B = /*geom*/
|
|
914
919
|
t[4].x + /*geom*/
|
|
915
|
-
t[4].w) && e(
|
|
916
|
-
16 && k !== (k = /*geom*/
|
|
917
|
-
t[4].y) && e(b, "y", k), u & /*geom*/
|
|
920
|
+
t[4].w) && e(O, "x", B), u & /*geom*/
|
|
918
921
|
16 && Y !== (Y = /*geom*/
|
|
919
|
-
t[4].
|
|
920
|
-
16 &&
|
|
921
|
-
t[4].
|
|
922
|
+
t[4].y) && e(O, "y", Y), u & /*geom*/
|
|
923
|
+
16 && k !== (k = /*geom*/
|
|
924
|
+
t[4].h) && e(O, "height", k), u & /*geom*/
|
|
922
925
|
16 && X !== (X = /*geom*/
|
|
926
|
+
t[4].x) && e(S, "x", X), u & /*geom*/
|
|
927
|
+
16 && P !== (P = /*geom*/
|
|
923
928
|
t[4].y + /*geom*/
|
|
924
|
-
t[4].h) && e(
|
|
929
|
+
t[4].h) && e(S, "y", P), u & /*geom*/
|
|
930
|
+
16 && Q !== (Q = /*geom*/
|
|
931
|
+
t[4].w) && e(S, "width", Q), u & /*geom*/
|
|
925
932
|
16 && Z !== (Z = /*geom*/
|
|
926
|
-
t[4].
|
|
927
|
-
16 &&
|
|
928
|
-
t[4].
|
|
929
|
-
16 && R !== (R = /*geom*/
|
|
930
|
-
t[4].y) && e(N, "y", R), u & /*geom*/
|
|
933
|
+
t[4].x) && e(U, "x", Z), u & /*geom*/
|
|
934
|
+
16 && M !== (M = /*geom*/
|
|
935
|
+
t[4].y) && e(U, "y", M), u & /*geom*/
|
|
931
936
|
16 && tt !== (tt = /*geom*/
|
|
932
|
-
t[4].h) && e(
|
|
937
|
+
t[4].h) && e(U, "height", tt), u & /*geom, handleSize*/
|
|
933
938
|
24 && nt !== (nt = /*geom*/
|
|
934
939
|
t[4].x - /*handleSize*/
|
|
935
|
-
t[3] / 2) && e(
|
|
940
|
+
t[3] / 2) && e(F, "x", nt), u & /*geom, handleSize*/
|
|
936
941
|
24 && rt !== (rt = /*geom*/
|
|
937
942
|
t[4].y - /*handleSize*/
|
|
938
|
-
t[3] / 2) && e(
|
|
943
|
+
t[3] / 2) && e(F, "y", rt), u & /*handleSize*/
|
|
939
944
|
8 && e(
|
|
940
|
-
|
|
945
|
+
F,
|
|
941
946
|
"height",
|
|
942
947
|
/*handleSize*/
|
|
943
948
|
t[3]
|
|
944
949
|
), u & /*handleSize*/
|
|
945
950
|
8 && e(
|
|
946
|
-
|
|
951
|
+
F,
|
|
947
952
|
"width",
|
|
948
953
|
/*handleSize*/
|
|
949
954
|
t[3]
|
|
@@ -951,18 +956,18 @@ function kn(t) {
|
|
|
951
956
|
24 && ot !== (ot = /*geom*/
|
|
952
957
|
t[4].x + /*geom*/
|
|
953
958
|
t[4].w - /*handleSize*/
|
|
954
|
-
t[3] / 2) && e(
|
|
959
|
+
t[3] / 2) && e(R, "x", ot), u & /*geom, handleSize*/
|
|
955
960
|
24 && et !== (et = /*geom*/
|
|
956
961
|
t[4].y - /*handleSize*/
|
|
957
|
-
t[3] / 2) && e(
|
|
962
|
+
t[3] / 2) && e(R, "y", et), u & /*handleSize*/
|
|
958
963
|
8 && e(
|
|
959
|
-
|
|
964
|
+
R,
|
|
960
965
|
"height",
|
|
961
966
|
/*handleSize*/
|
|
962
967
|
t[3]
|
|
963
968
|
), u & /*handleSize*/
|
|
964
969
|
8 && e(
|
|
965
|
-
|
|
970
|
+
R,
|
|
966
971
|
"width",
|
|
967
972
|
/*handleSize*/
|
|
968
973
|
t[3]
|
|
@@ -1007,14 +1012,14 @@ function kn(t) {
|
|
|
1007
1012
|
t[3]
|
|
1008
1013
|
);
|
|
1009
1014
|
},
|
|
1010
|
-
d(
|
|
1011
|
-
|
|
1015
|
+
d(y) {
|
|
1016
|
+
y && x(n), y && x(l), y && x(p), y && x(i), y && x(g), y && x(v), y && x(O), y && x(j), y && x(S), y && x(ht), y && x(U), y && x(dt), y && x(F), y && x(ft), y && x(R), y && x(gt), y && x(H), y && x(yt), y && x(G), mt = !1, D(Lt);
|
|
1012
1017
|
}
|
|
1013
1018
|
};
|
|
1014
1019
|
}
|
|
1015
|
-
function
|
|
1020
|
+
function jn(t) {
|
|
1016
1021
|
let n, r;
|
|
1017
|
-
return n = new
|
|
1022
|
+
return n = new Wt({
|
|
1018
1023
|
props: {
|
|
1019
1024
|
shape: (
|
|
1020
1025
|
/*shape*/
|
|
@@ -1051,10 +1056,10 @@ function Yn(t) {
|
|
|
1051
1056
|
t[9]
|
|
1052
1057
|
), {
|
|
1053
1058
|
c() {
|
|
1054
|
-
|
|
1059
|
+
Dt(n.$$.fragment);
|
|
1055
1060
|
},
|
|
1056
1061
|
m(o, s) {
|
|
1057
|
-
|
|
1062
|
+
bt(n, o, s), r = !0;
|
|
1058
1063
|
},
|
|
1059
1064
|
p(o, [s]) {
|
|
1060
1065
|
const a = {};
|
|
@@ -1069,76 +1074,76 @@ function Yn(t) {
|
|
|
1069
1074
|
r || (ut(n.$$.fragment, o), r = !0);
|
|
1070
1075
|
},
|
|
1071
1076
|
o(o) {
|
|
1072
|
-
|
|
1077
|
+
Ot(n.$$.fragment, o), r = !1;
|
|
1073
1078
|
},
|
|
1074
1079
|
d(o) {
|
|
1075
|
-
|
|
1080
|
+
St(n, o);
|
|
1076
1081
|
}
|
|
1077
1082
|
};
|
|
1078
1083
|
}
|
|
1079
|
-
function
|
|
1084
|
+
function Xn(t, n, r) {
|
|
1080
1085
|
let o, s, { shape: a } = n, { computedStyle: c = void 0 } = n, { transform: l } = n, { viewportScale: p = 1 } = n;
|
|
1081
|
-
const f = (i,
|
|
1086
|
+
const f = (i, g, h) => {
|
|
1082
1087
|
const E = i.geometry.bounds;
|
|
1083
|
-
let [
|
|
1084
|
-
const [
|
|
1085
|
-
if (
|
|
1086
|
-
|
|
1088
|
+
let [I, v] = [E.minX, E.minY], [O, B] = [E.maxX, E.maxY];
|
|
1089
|
+
const [Y, k] = h;
|
|
1090
|
+
if (g === d.SHAPE)
|
|
1091
|
+
I += Y, O += Y, v += k, B += k;
|
|
1087
1092
|
else {
|
|
1088
|
-
switch (
|
|
1093
|
+
switch (g) {
|
|
1089
1094
|
case d.TOP:
|
|
1090
1095
|
case d.TOP_LEFT:
|
|
1091
1096
|
case d.TOP_RIGHT: {
|
|
1092
|
-
|
|
1097
|
+
v += k;
|
|
1093
1098
|
break;
|
|
1094
1099
|
}
|
|
1095
1100
|
case d.BOTTOM:
|
|
1096
1101
|
case d.BOTTOM_LEFT:
|
|
1097
1102
|
case d.BOTTOM_RIGHT: {
|
|
1098
|
-
|
|
1103
|
+
B += k;
|
|
1099
1104
|
break;
|
|
1100
1105
|
}
|
|
1101
1106
|
}
|
|
1102
|
-
switch (
|
|
1107
|
+
switch (g) {
|
|
1103
1108
|
case d.LEFT:
|
|
1104
1109
|
case d.TOP_LEFT:
|
|
1105
1110
|
case d.BOTTOM_LEFT: {
|
|
1106
|
-
|
|
1111
|
+
I += Y;
|
|
1107
1112
|
break;
|
|
1108
1113
|
}
|
|
1109
1114
|
case d.RIGHT:
|
|
1110
1115
|
case d.TOP_RIGHT:
|
|
1111
1116
|
case d.BOTTOM_RIGHT: {
|
|
1112
|
-
|
|
1117
|
+
O += Y;
|
|
1113
1118
|
break;
|
|
1114
1119
|
}
|
|
1115
1120
|
}
|
|
1116
1121
|
}
|
|
1117
|
-
const j = Math.min(
|
|
1122
|
+
const j = Math.min(I, O), S = Math.min(v, B), X = Math.abs(O - I), P = Math.abs(B - v);
|
|
1118
1123
|
return {
|
|
1119
1124
|
...i,
|
|
1120
1125
|
geometry: {
|
|
1121
1126
|
x: j,
|
|
1122
|
-
y:
|
|
1123
|
-
w:
|
|
1124
|
-
h:
|
|
1127
|
+
y: S,
|
|
1128
|
+
w: X,
|
|
1129
|
+
h: P,
|
|
1125
1130
|
bounds: {
|
|
1126
1131
|
minX: j,
|
|
1127
|
-
minY:
|
|
1128
|
-
maxX: j +
|
|
1129
|
-
maxY:
|
|
1132
|
+
minY: S,
|
|
1133
|
+
maxX: j + X,
|
|
1134
|
+
maxY: S + P
|
|
1130
1135
|
}
|
|
1131
1136
|
}
|
|
1132
1137
|
};
|
|
1133
1138
|
};
|
|
1134
|
-
function
|
|
1135
|
-
|
|
1139
|
+
function T(i) {
|
|
1140
|
+
W.call(this, t, i);
|
|
1136
1141
|
}
|
|
1137
1142
|
function $(i) {
|
|
1138
|
-
|
|
1143
|
+
W.call(this, t, i);
|
|
1139
1144
|
}
|
|
1140
1145
|
function m(i) {
|
|
1141
|
-
|
|
1146
|
+
W.call(this, t, i);
|
|
1142
1147
|
}
|
|
1143
1148
|
return t.$$set = (i) => {
|
|
1144
1149
|
"shape" in i && r(0, a = i.shape), "computedStyle" in i && r(1, c = i.computedStyle), "transform" in i && r(2, l = i.transform), "viewportScale" in i && r(6, p = i.viewportScale);
|
|
@@ -1154,14 +1159,14 @@ function jn(t, n, r) {
|
|
|
1154
1159
|
o,
|
|
1155
1160
|
f,
|
|
1156
1161
|
p,
|
|
1157
|
-
|
|
1162
|
+
T,
|
|
1158
1163
|
$,
|
|
1159
1164
|
m
|
|
1160
1165
|
];
|
|
1161
1166
|
}
|
|
1162
|
-
class
|
|
1167
|
+
class Pn extends _t {
|
|
1163
1168
|
constructor(n) {
|
|
1164
|
-
super(),
|
|
1169
|
+
super(), vt(this, n, Xn, jn, Et, {
|
|
1165
1170
|
shape: 0,
|
|
1166
1171
|
computedStyle: 1,
|
|
1167
1172
|
transform: 2,
|
|
@@ -1169,7 +1174,7 @@ class On extends _t {
|
|
|
1169
1174
|
});
|
|
1170
1175
|
}
|
|
1171
1176
|
}
|
|
1172
|
-
|
|
1177
|
+
N.RECTANGLE, N.POLYGON;
|
|
1173
1178
|
const d = (t) => `HANDLE-${t}`;
|
|
1174
1179
|
d.SHAPE = "SHAPE";
|
|
1175
1180
|
d.TOP = "TOP";
|
|
@@ -1180,7 +1185,7 @@ d.TOP_LEFT = "TOP_LEFT";
|
|
|
1180
1185
|
d.TOP_RIGHT = "TOP_RIGHT";
|
|
1181
1186
|
d.BOTTOM_RIGHT = "BOTTOM_RIGHT";
|
|
1182
1187
|
d.BOTTOM_LEFT = "BOTTOM_LEFT";
|
|
1183
|
-
const
|
|
1188
|
+
const Dn = (t) => ({}), Yt = (t) => ({ grab: (
|
|
1184
1189
|
/*onGrab*/
|
|
1185
1190
|
t[0]
|
|
1186
1191
|
) });
|
|
@@ -1189,19 +1194,19 @@ function zn(t) {
|
|
|
1189
1194
|
const a = (
|
|
1190
1195
|
/*#slots*/
|
|
1191
1196
|
t[7].default
|
|
1192
|
-
), c =
|
|
1197
|
+
), c = Kt(
|
|
1193
1198
|
a,
|
|
1194
1199
|
t,
|
|
1195
1200
|
/*$$scope*/
|
|
1196
1201
|
t[6],
|
|
1197
|
-
|
|
1202
|
+
Yt
|
|
1198
1203
|
);
|
|
1199
1204
|
return {
|
|
1200
1205
|
c() {
|
|
1201
1206
|
n = L("g"), c && c.c(), e(n, "class", "a9s-annotation selected");
|
|
1202
1207
|
},
|
|
1203
1208
|
m(l, p) {
|
|
1204
|
-
|
|
1209
|
+
w(l, n, p), c && c.m(n, null), r = !0, o || (s = [
|
|
1205
1210
|
A(
|
|
1206
1211
|
n,
|
|
1207
1212
|
"pointerup",
|
|
@@ -1218,77 +1223,77 @@ function zn(t) {
|
|
|
1218
1223
|
},
|
|
1219
1224
|
p(l, [p]) {
|
|
1220
1225
|
c && c.p && (!r || p & /*$$scope*/
|
|
1221
|
-
64) &&
|
|
1226
|
+
64) && Zt(
|
|
1222
1227
|
c,
|
|
1223
1228
|
a,
|
|
1224
1229
|
l,
|
|
1225
1230
|
/*$$scope*/
|
|
1226
1231
|
l[6],
|
|
1227
|
-
r ?
|
|
1232
|
+
r ? Qt(
|
|
1228
1233
|
a,
|
|
1229
1234
|
/*$$scope*/
|
|
1230
1235
|
l[6],
|
|
1231
1236
|
p,
|
|
1232
|
-
|
|
1233
|
-
) :
|
|
1237
|
+
Dn
|
|
1238
|
+
) : Mt(
|
|
1234
1239
|
/*$$scope*/
|
|
1235
1240
|
l[6]
|
|
1236
1241
|
),
|
|
1237
|
-
|
|
1242
|
+
Yt
|
|
1238
1243
|
);
|
|
1239
1244
|
},
|
|
1240
1245
|
i(l) {
|
|
1241
1246
|
r || (ut(c, l), r = !0);
|
|
1242
1247
|
},
|
|
1243
1248
|
o(l) {
|
|
1244
|
-
|
|
1249
|
+
Ot(c, l), r = !1;
|
|
1245
1250
|
},
|
|
1246
1251
|
d(l) {
|
|
1247
|
-
l && x(n), c && c.d(l), o = !1,
|
|
1252
|
+
l && x(n), c && c.d(l), o = !1, D(s);
|
|
1248
1253
|
}
|
|
1249
1254
|
};
|
|
1250
1255
|
}
|
|
1251
|
-
function
|
|
1256
|
+
function Vn(t, n, r) {
|
|
1252
1257
|
let { $$slots: o = {}, $$scope: s } = n;
|
|
1253
1258
|
const a = sn();
|
|
1254
|
-
let { shape: c } = n, { editor: l } = n, { transform: p } = n, f = null,
|
|
1259
|
+
let { shape: c } = n, { editor: l } = n, { transform: p } = n, f = null, T, $ = null;
|
|
1255
1260
|
const m = (h) => (E) => {
|
|
1256
|
-
f = h,
|
|
1261
|
+
f = h, T = p.elementToImage(E.offsetX, E.offsetY), $ = c, E.target.setPointerCapture(E.pointerId), a("grab");
|
|
1257
1262
|
}, i = (h) => {
|
|
1258
1263
|
if (f) {
|
|
1259
|
-
const [E,
|
|
1260
|
-
r(3, c = l($, f,
|
|
1264
|
+
const [E, I] = p.elementToImage(h.offsetX, h.offsetY), v = [E - T[0], I - T[1]];
|
|
1265
|
+
r(3, c = l($, f, v)), a("change", c);
|
|
1261
1266
|
}
|
|
1262
|
-
},
|
|
1267
|
+
}, g = (h) => {
|
|
1263
1268
|
h.target.releasePointerCapture(h.pointerId), f = null, $ = c, a("release");
|
|
1264
1269
|
};
|
|
1265
1270
|
return t.$$set = (h) => {
|
|
1266
1271
|
"shape" in h && r(3, c = h.shape), "editor" in h && r(4, l = h.editor), "transform" in h && r(5, p = h.transform), "$$scope" in h && r(6, s = h.$$scope);
|
|
1267
|
-
}, [m, i,
|
|
1272
|
+
}, [m, i, g, c, l, p, s, o];
|
|
1268
1273
|
}
|
|
1269
|
-
class
|
|
1274
|
+
class Wt extends _t {
|
|
1270
1275
|
constructor(n) {
|
|
1271
|
-
super(),
|
|
1276
|
+
super(), vt(this, n, Vn, zn, Et, { shape: 3, editor: 4, transform: 5 });
|
|
1272
1277
|
}
|
|
1273
1278
|
}
|
|
1274
1279
|
navigator.userAgent.indexOf("Mac OS X");
|
|
1280
|
+
let Wn = (t = 21) => crypto.getRandomValues(new Uint8Array(t)).reduce((n, r) => (r &= 63, r < 36 ? n += r.toString(36) : r < 62 ? n += (r - 26).toString(36).toUpperCase() : r > 62 ? n += "-" : n += "_", n), "");
|
|
1281
|
+
Wn();
|
|
1275
1282
|
export {
|
|
1276
|
-
|
|
1283
|
+
Wt as Editor,
|
|
1277
1284
|
d as Handle,
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
+
Yn as PolygonEditor,
|
|
1286
|
+
Pn as RectangleEditor,
|
|
1287
|
+
gn as RectangleUtil,
|
|
1288
|
+
N as ShapeType,
|
|
1289
|
+
qn as W3CImageFormat,
|
|
1290
|
+
zt as boundsFromPoints,
|
|
1291
|
+
yn as parseFragmentSelector,
|
|
1285
1292
|
En as parseSVGSelector,
|
|
1286
|
-
|
|
1287
|
-
Hn as parseW3CImageAnnotation,
|
|
1293
|
+
Gn as parseW3CImageAnnotation,
|
|
1288
1294
|
At as registerShapeUtil,
|
|
1289
1295
|
mn as serializeFragmentSelector,
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
Gn as serializeW3CImageAnnotation
|
|
1296
|
+
On as serializeSVGSelector,
|
|
1297
|
+
Un as serializeW3CImageAnnotation
|
|
1293
1298
|
};
|
|
1294
1299
|
//# sourceMappingURL=annotorious-svelte.es5.js.map
|