@annotorious/annotorious 3.0.20 → 3.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/annotorious.es.js +256 -250
- package/dist/annotorious.es.js.map +1 -1
- package/dist/annotorious.js +1 -1
- package/dist/annotorious.js.map +1 -1
- package/package.json +8 -8
package/dist/annotorious.es.js
CHANGED
|
@@ -127,13 +127,13 @@ function ye(e, t, n) {
|
|
|
127
127
|
function En(e, t, { bubbles: n = !1, cancelable: o = !1 } = {}) {
|
|
128
128
|
return new CustomEvent(e, { detail: t, bubbles: n, cancelable: o });
|
|
129
129
|
}
|
|
130
|
-
let
|
|
131
|
-
function
|
|
132
|
-
|
|
130
|
+
let Ue;
|
|
131
|
+
function Re(e) {
|
|
132
|
+
Ue = e;
|
|
133
133
|
}
|
|
134
134
|
function xt() {
|
|
135
|
-
if (!
|
|
136
|
-
return
|
|
135
|
+
if (!Ue) throw new Error("Function called outside component initialization");
|
|
136
|
+
return Ue;
|
|
137
137
|
}
|
|
138
138
|
function Ne(e) {
|
|
139
139
|
xt().$$.on_mount.push(e);
|
|
@@ -161,40 +161,40 @@ function me(e, t) {
|
|
|
161
161
|
n && n.slice().forEach((o) => o.call(this, t));
|
|
162
162
|
}
|
|
163
163
|
const Me = [], We = [];
|
|
164
|
-
let
|
|
164
|
+
let ke = [];
|
|
165
165
|
const Et = [], An = /* @__PURE__ */ Promise.resolve();
|
|
166
166
|
let ut = !1;
|
|
167
167
|
function Sn() {
|
|
168
168
|
ut || (ut = !0, An.then($t));
|
|
169
169
|
}
|
|
170
170
|
function dt(e) {
|
|
171
|
-
|
|
171
|
+
ke.push(e);
|
|
172
172
|
}
|
|
173
173
|
const $e = /* @__PURE__ */ new Set();
|
|
174
174
|
let Ee = 0;
|
|
175
175
|
function $t() {
|
|
176
176
|
if (Ee !== 0)
|
|
177
177
|
return;
|
|
178
|
-
const e =
|
|
178
|
+
const e = Ue;
|
|
179
179
|
do {
|
|
180
180
|
try {
|
|
181
181
|
for (; Ee < Me.length; ) {
|
|
182
182
|
const t = Me[Ee];
|
|
183
|
-
Ee++,
|
|
183
|
+
Ee++, Re(t), Tn(t.$$);
|
|
184
184
|
}
|
|
185
185
|
} catch (t) {
|
|
186
186
|
throw Me.length = 0, Ee = 0, t;
|
|
187
187
|
}
|
|
188
|
-
for (
|
|
189
|
-
for (let t = 0; t <
|
|
190
|
-
const n =
|
|
188
|
+
for (Re(null), Me.length = 0, Ee = 0; We.length; ) We.pop()();
|
|
189
|
+
for (let t = 0; t < ke.length; t += 1) {
|
|
190
|
+
const n = ke[t];
|
|
191
191
|
$e.has(n) || ($e.add(n), n());
|
|
192
192
|
}
|
|
193
|
-
|
|
193
|
+
ke.length = 0;
|
|
194
194
|
} while (Me.length);
|
|
195
195
|
for (; Et.length; )
|
|
196
196
|
Et.pop()();
|
|
197
|
-
ut = !1, $e.clear(),
|
|
197
|
+
ut = !1, $e.clear(), Re(e);
|
|
198
198
|
}
|
|
199
199
|
function Tn(e) {
|
|
200
200
|
if (e.fragment !== null) {
|
|
@@ -205,7 +205,7 @@ function Tn(e) {
|
|
|
205
205
|
}
|
|
206
206
|
function Mn(e) {
|
|
207
207
|
const t = [], n = [];
|
|
208
|
-
|
|
208
|
+
ke.forEach((o) => e.indexOf(o) === -1 ? t.push(o) : n.push(o)), n.forEach((o) => o()), ke = t;
|
|
209
209
|
}
|
|
210
210
|
const He = /* @__PURE__ */ new Set();
|
|
211
211
|
let be;
|
|
@@ -231,7 +231,7 @@ function P(e, t, n, o) {
|
|
|
231
231
|
}), e.o(t);
|
|
232
232
|
} else o && o();
|
|
233
233
|
}
|
|
234
|
-
function
|
|
234
|
+
function ve(e) {
|
|
235
235
|
return (e == null ? void 0 : e.length) !== void 0 ? e : Array.from(e);
|
|
236
236
|
}
|
|
237
237
|
function ne(e) {
|
|
@@ -248,12 +248,12 @@ function te(e, t) {
|
|
|
248
248
|
const n = e.$$;
|
|
249
249
|
n.fragment !== null && (Mn(n.after_update), ge(n.on_destroy), n.fragment && n.fragment.d(t), n.on_destroy = n.fragment = null, n.ctx = []);
|
|
250
250
|
}
|
|
251
|
-
function
|
|
251
|
+
function Ln(e, t) {
|
|
252
252
|
e.$$.dirty[0] === -1 && (Me.push(e), Sn(), e.$$.dirty.fill(0)), e.$$.dirty[t / 31 | 0] |= 1 << t % 31;
|
|
253
253
|
}
|
|
254
254
|
function oe(e, t, n, o, i, s, r = null, l = [-1]) {
|
|
255
|
-
const a =
|
|
256
|
-
|
|
255
|
+
const a = Ue;
|
|
256
|
+
Re(e);
|
|
257
257
|
const c = e.$$ = {
|
|
258
258
|
fragment: null,
|
|
259
259
|
ctx: [],
|
|
@@ -279,7 +279,7 @@ function oe(e, t, n, o, i, s, r = null, l = [-1]) {
|
|
|
279
279
|
let u = !1;
|
|
280
280
|
if (c.ctx = n ? n(e, t.props || {}, (f, h, ...y) => {
|
|
281
281
|
const g = y.length ? y[0] : h;
|
|
282
|
-
return c.ctx && i(c.ctx[f], c.ctx[f] = g) && (!c.skip_bound && c.bound[f] && c.bound[f](g), u &&
|
|
282
|
+
return c.ctx && i(c.ctx[f], c.ctx[f] = g) && (!c.skip_bound && c.bound[f] && c.bound[f](g), u && Ln(e, f)), h;
|
|
283
283
|
}) : [], c.update(), u = !0, ge(c.before_update), c.fragment = o ? o(c.ctx) : !1, t.target) {
|
|
284
284
|
if (t.hydrate) {
|
|
285
285
|
const f = bn(t.target);
|
|
@@ -288,7 +288,7 @@ function oe(e, t, n, o, i, s, r = null, l = [-1]) {
|
|
|
288
288
|
c.fragment && c.fragment.c();
|
|
289
289
|
t.intro && O(e.$$.fragment), ee(e, t.target, t.anchor), $t();
|
|
290
290
|
}
|
|
291
|
-
|
|
291
|
+
Re(a);
|
|
292
292
|
}
|
|
293
293
|
class ie {
|
|
294
294
|
constructor() {
|
|
@@ -336,10 +336,10 @@ class ie {
|
|
|
336
336
|
this.$$set && !mn(t) && (this.$$.skip_bound = !0, this.$$set(t), this.$$.skip_bound = !1);
|
|
337
337
|
}
|
|
338
338
|
}
|
|
339
|
-
const
|
|
340
|
-
typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(
|
|
339
|
+
const kn = "4";
|
|
340
|
+
typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(kn);
|
|
341
341
|
var F = /* @__PURE__ */ ((e) => (e.ELLIPSE = "ELLIPSE", e.POLYGON = "POLYGON", e.RECTANGLE = "RECTANGLE", e))(F || {});
|
|
342
|
-
const mt = {}, pt = (e, t) => mt[e] = t, ht = (e) => mt[e.type].area(e),
|
|
342
|
+
const mt = {}, pt = (e, t) => mt[e] = t, ht = (e) => mt[e.type].area(e), vn = (e, t, n) => mt[e.type].intersects(e, t, n), qe = (e) => {
|
|
343
343
|
let t = 1 / 0, n = 1 / 0, o = -1 / 0, i = -1 / 0;
|
|
344
344
|
return e.forEach(([s, r]) => {
|
|
345
345
|
t = Math.min(t, s), n = Math.min(n, r), o = Math.max(o, s), i = Math.max(i, r);
|
|
@@ -428,7 +428,7 @@ const Je = (e) => Fe(e.target), Fe = (e) => {
|
|
|
428
428
|
bounds: qe(i)
|
|
429
429
|
}
|
|
430
430
|
};
|
|
431
|
-
},
|
|
431
|
+
}, Rn = (e) => {
|
|
432
432
|
const t = Cn(e), n = parseFloat(t.getAttribute("cx")), o = parseFloat(t.getAttribute("cy")), i = parseFloat(t.getAttribute("rx")), s = parseFloat(t.getAttribute("ry")), r = {
|
|
433
433
|
minX: n - i,
|
|
434
434
|
minY: o - s,
|
|
@@ -445,12 +445,12 @@ const Je = (e) => Fe(e.target), Fe = (e) => {
|
|
|
445
445
|
bounds: r
|
|
446
446
|
}
|
|
447
447
|
};
|
|
448
|
-
},
|
|
448
|
+
}, Un = (e) => {
|
|
449
449
|
const t = typeof e == "string" ? e : e.value;
|
|
450
450
|
if (t.includes("<polygon points="))
|
|
451
451
|
return Xn(t);
|
|
452
452
|
if (t.includes("<ellipse "))
|
|
453
|
-
return
|
|
453
|
+
return Rn(t);
|
|
454
454
|
throw "Unsupported SVG shape: " + t;
|
|
455
455
|
}, Nn = (e) => {
|
|
456
456
|
let t;
|
|
@@ -482,10 +482,13 @@ function jn() {
|
|
|
482
482
|
}
|
|
483
483
|
const zn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), St = { randomUUID: zn };
|
|
484
484
|
function tn(e, t, n) {
|
|
485
|
-
|
|
485
|
+
var i;
|
|
486
|
+
if (St.randomUUID && !e)
|
|
486
487
|
return St.randomUUID();
|
|
487
488
|
e = e || {};
|
|
488
|
-
const o = e.random
|
|
489
|
+
const o = e.random ?? ((i = e.rng) == null ? void 0 : i.call(e)) ?? jn();
|
|
490
|
+
if (o.length < 16)
|
|
491
|
+
throw new Error("Random bytes length must be >= 16");
|
|
489
492
|
return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, Vn(o);
|
|
490
493
|
}
|
|
491
494
|
var Tt = Object.prototype.hasOwnProperty;
|
|
@@ -648,13 +651,16 @@ function Jn() {
|
|
|
648
651
|
}
|
|
649
652
|
return nt(qn);
|
|
650
653
|
}
|
|
651
|
-
const Qn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto),
|
|
654
|
+
const Qn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Lt = { randomUUID: Qn };
|
|
652
655
|
function on(e, t, n) {
|
|
653
|
-
|
|
654
|
-
|
|
656
|
+
var o;
|
|
657
|
+
if (Lt.randomUUID && !e)
|
|
658
|
+
return Lt.randomUUID();
|
|
655
659
|
e = e || {};
|
|
656
|
-
const
|
|
657
|
-
|
|
660
|
+
const i = e.random ?? ((o = e.rng) == null ? void 0 : o.call(e)) ?? Jn();
|
|
661
|
+
if (i.length < 16)
|
|
662
|
+
throw new Error("Random bytes length must be >= 16");
|
|
663
|
+
return i[6] = i[6] & 15 | 64, i[8] = i[8] & 63 | 128, Wn(i);
|
|
658
664
|
}
|
|
659
665
|
const ot = (e) => {
|
|
660
666
|
const t = (n) => {
|
|
@@ -749,55 +755,55 @@ const to = (e, t) => {
|
|
|
749
755
|
}
|
|
750
756
|
};
|
|
751
757
|
}, oo = (e) => e.id !== void 0, io = () => {
|
|
752
|
-
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = [], o = (S,
|
|
753
|
-
n.push({ onChange: S, options:
|
|
758
|
+
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = [], o = (S, L = {}) => {
|
|
759
|
+
n.push({ onChange: S, options: L });
|
|
754
760
|
}, i = (S) => {
|
|
755
|
-
const
|
|
756
|
-
|
|
757
|
-
}, s = (S,
|
|
761
|
+
const L = n.findIndex((b) => b.onChange == S);
|
|
762
|
+
L > -1 && n.splice(L, 1);
|
|
763
|
+
}, s = (S, L) => {
|
|
758
764
|
const b = {
|
|
759
765
|
origin: S,
|
|
760
766
|
changes: {
|
|
761
|
-
created:
|
|
762
|
-
updated:
|
|
763
|
-
deleted:
|
|
767
|
+
created: L.created || [],
|
|
768
|
+
updated: L.updated || [],
|
|
769
|
+
deleted: L.deleted || []
|
|
764
770
|
},
|
|
765
771
|
state: [...e.values()]
|
|
766
772
|
};
|
|
767
773
|
n.forEach((T) => {
|
|
768
774
|
to(T, b) && T.onChange(b);
|
|
769
775
|
});
|
|
770
|
-
}, r = (S,
|
|
776
|
+
}, r = (S, L = G.LOCAL) => {
|
|
771
777
|
if (S.id && e.get(S.id))
|
|
772
778
|
throw Error(`Cannot add annotation ${S.id} - exists already`);
|
|
773
779
|
{
|
|
774
780
|
const b = it(S);
|
|
775
|
-
e.set(b.id, b), b.bodies.forEach((T) => t.set(T.id, b.id)), s(
|
|
781
|
+
e.set(b.id, b), b.bodies.forEach((T) => t.set(T.id, b.id)), s(L, { created: [b] });
|
|
776
782
|
}
|
|
777
|
-
}, l = (S,
|
|
778
|
-
const b = it(typeof S == "string" ?
|
|
783
|
+
}, l = (S, L) => {
|
|
784
|
+
const b = it(typeof S == "string" ? L : S), T = typeof S == "string" ? S : S.id, Y = T && e.get(T);
|
|
779
785
|
if (Y) {
|
|
780
786
|
const D = sn(Y, b);
|
|
781
787
|
return T === b.id ? e.set(T, b) : (e.delete(T), e.set(b.id, b)), Y.bodies.forEach((H) => t.delete(H.id)), b.bodies.forEach((H) => t.set(H.id, b.id)), D;
|
|
782
788
|
} else
|
|
783
789
|
console.warn(`Cannot update annotation ${T} - does not exist`);
|
|
784
|
-
}, a = (S,
|
|
785
|
-
const T = oo(
|
|
790
|
+
}, a = (S, L = G.LOCAL, b = G.LOCAL) => {
|
|
791
|
+
const T = oo(L) ? b : L, Y = l(S, L);
|
|
786
792
|
Y && s(T, { updated: [Y] });
|
|
787
|
-
}, c = (S,
|
|
793
|
+
}, c = (S, L = G.LOCAL) => {
|
|
788
794
|
const b = S.reduce((T, Y) => {
|
|
789
795
|
const D = l(Y);
|
|
790
796
|
return D ? [...T, D] : T;
|
|
791
797
|
}, []);
|
|
792
|
-
b.length > 0 && s(
|
|
793
|
-
}, u = (S,
|
|
798
|
+
b.length > 0 && s(L, { updated: b });
|
|
799
|
+
}, u = (S, L = G.LOCAL) => {
|
|
794
800
|
const b = e.get(S.annotation);
|
|
795
801
|
if (b) {
|
|
796
802
|
const T = {
|
|
797
803
|
...b,
|
|
798
804
|
bodies: [...b.bodies, S]
|
|
799
805
|
};
|
|
800
|
-
e.set(b.id, T), t.set(S.id, T.id), s(
|
|
806
|
+
e.set(b.id, T), t.set(S.id, T.id), s(L, { updated: [{
|
|
801
807
|
oldValue: b,
|
|
802
808
|
newValue: T,
|
|
803
809
|
bodiesCreated: [S]
|
|
@@ -805,11 +811,11 @@ const to = (e, t) => {
|
|
|
805
811
|
} else
|
|
806
812
|
console.warn(`Attempt to add body to missing annotation: ${S.annotation}`);
|
|
807
813
|
}, f = () => [...e.values()], h = (S = G.LOCAL) => {
|
|
808
|
-
const
|
|
809
|
-
e.clear(), t.clear(), s(S, { deleted:
|
|
810
|
-
}, y = (S,
|
|
814
|
+
const L = [...e.values()];
|
|
815
|
+
e.clear(), t.clear(), s(S, { deleted: L });
|
|
816
|
+
}, y = (S, L = !0, b = G.LOCAL) => {
|
|
811
817
|
const T = S.map(it);
|
|
812
|
-
if (
|
|
818
|
+
if (L) {
|
|
813
819
|
const Y = [...e.values()];
|
|
814
820
|
e.clear(), t.clear(), T.forEach((D) => {
|
|
815
821
|
e.set(D.id, D), D.bodies.forEach((H) => t.set(H.id, D.id));
|
|
@@ -826,31 +832,31 @@ const to = (e, t) => {
|
|
|
826
832
|
}), s(b, { created: T });
|
|
827
833
|
}
|
|
828
834
|
}, g = (S) => {
|
|
829
|
-
const
|
|
835
|
+
const L = typeof S == "string" ? S : S.id, b = e.get(L);
|
|
830
836
|
if (b)
|
|
831
|
-
return e.delete(
|
|
832
|
-
console.warn(`Attempt to delete missing annotation: ${
|
|
833
|
-
}, m = (S,
|
|
837
|
+
return e.delete(L), b.bodies.forEach((T) => t.delete(T.id)), b;
|
|
838
|
+
console.warn(`Attempt to delete missing annotation: ${L}`);
|
|
839
|
+
}, m = (S, L = G.LOCAL) => {
|
|
834
840
|
const b = g(S);
|
|
835
|
-
b && s(
|
|
836
|
-
}, A = (S,
|
|
841
|
+
b && s(L, { deleted: [b] });
|
|
842
|
+
}, A = (S, L = G.LOCAL) => {
|
|
837
843
|
const b = S.reduce((T, Y) => {
|
|
838
844
|
const D = g(Y);
|
|
839
845
|
return D ? [...T, D] : T;
|
|
840
846
|
}, []);
|
|
841
|
-
b.length > 0 && s(
|
|
847
|
+
b.length > 0 && s(L, { deleted: b });
|
|
842
848
|
}, p = (S) => {
|
|
843
|
-
const
|
|
844
|
-
if (
|
|
845
|
-
const b =
|
|
849
|
+
const L = e.get(S.annotation);
|
|
850
|
+
if (L) {
|
|
851
|
+
const b = L.bodies.find((T) => T.id === S.id);
|
|
846
852
|
if (b) {
|
|
847
853
|
t.delete(b.id);
|
|
848
854
|
const T = {
|
|
849
|
-
...
|
|
850
|
-
bodies:
|
|
855
|
+
...L,
|
|
856
|
+
bodies: L.bodies.filter((Y) => Y.id !== S.id)
|
|
851
857
|
};
|
|
852
|
-
return e.set(
|
|
853
|
-
oldValue:
|
|
858
|
+
return e.set(L.id, T), {
|
|
859
|
+
oldValue: L,
|
|
854
860
|
newValue: T,
|
|
855
861
|
bodiesDeleted: [b]
|
|
856
862
|
};
|
|
@@ -858,61 +864,61 @@ const to = (e, t) => {
|
|
|
858
864
|
console.warn(`Attempt to delete missing body ${S.id} from annotation ${S.annotation}`);
|
|
859
865
|
} else
|
|
860
866
|
console.warn(`Attempt to delete body from missing annotation ${S.annotation}`);
|
|
861
|
-
}, _ = (S,
|
|
867
|
+
}, _ = (S, L = G.LOCAL) => {
|
|
862
868
|
const b = p(S);
|
|
863
|
-
b && s(
|
|
864
|
-
}, w = (S,
|
|
869
|
+
b && s(L, { updated: [b] });
|
|
870
|
+
}, w = (S, L = G.LOCAL) => {
|
|
865
871
|
const b = S.map((T) => p(T)).filter(Boolean);
|
|
866
|
-
b.length > 0 && s(
|
|
872
|
+
b.length > 0 && s(L, { updated: b });
|
|
867
873
|
}, E = (S) => {
|
|
868
|
-
const
|
|
869
|
-
return
|
|
870
|
-
},
|
|
871
|
-
const
|
|
872
|
-
if (
|
|
873
|
-
const b = E(
|
|
874
|
+
const L = e.get(S);
|
|
875
|
+
return L ? { ...L } : void 0;
|
|
876
|
+
}, v = (S) => {
|
|
877
|
+
const L = t.get(S);
|
|
878
|
+
if (L) {
|
|
879
|
+
const b = E(L).bodies.find((T) => T.id === S);
|
|
874
880
|
if (b)
|
|
875
881
|
return b;
|
|
876
882
|
console.error(`Store integrity error: body ${S} in index, but not in annotation`);
|
|
877
883
|
} else
|
|
878
884
|
console.warn(`Attempt to retrieve missing body: ${S}`);
|
|
879
|
-
}, X = (S,
|
|
880
|
-
if (S.annotation !==
|
|
885
|
+
}, X = (S, L) => {
|
|
886
|
+
if (S.annotation !== L.annotation)
|
|
881
887
|
throw "Annotation integrity violation: annotation ID must be the same when updating bodies";
|
|
882
888
|
const b = e.get(S.annotation);
|
|
883
889
|
if (b) {
|
|
884
890
|
const T = b.bodies.find((D) => D.id === S.id), Y = {
|
|
885
891
|
...b,
|
|
886
|
-
bodies: b.bodies.map((D) => D.id === T.id ?
|
|
892
|
+
bodies: b.bodies.map((D) => D.id === T.id ? L : D)
|
|
887
893
|
};
|
|
888
|
-
return e.set(b.id, Y), T.id !==
|
|
894
|
+
return e.set(b.id, Y), T.id !== L.id && (t.delete(T.id), t.set(L.id, Y.id)), {
|
|
889
895
|
oldValue: b,
|
|
890
896
|
newValue: Y,
|
|
891
|
-
bodiesUpdated: [{ oldBody: T, newBody:
|
|
897
|
+
bodiesUpdated: [{ oldBody: T, newBody: L }]
|
|
892
898
|
};
|
|
893
899
|
} else
|
|
894
900
|
console.warn(`Attempt to add body to missing annotation ${S.annotation}`);
|
|
895
|
-
},
|
|
896
|
-
const T = X(S,
|
|
901
|
+
}, U = (S, L, b = G.LOCAL) => {
|
|
902
|
+
const T = X(S, L);
|
|
897
903
|
T && s(b, { updated: [T] });
|
|
898
|
-
}, V = (S,
|
|
904
|
+
}, V = (S, L = G.LOCAL) => {
|
|
899
905
|
const b = S.map((T) => X({ id: T.id, annotation: T.annotation }, T)).filter(Boolean);
|
|
900
|
-
s(
|
|
906
|
+
s(L, { updated: b });
|
|
901
907
|
}, Z = (S) => {
|
|
902
|
-
const
|
|
903
|
-
if (
|
|
908
|
+
const L = e.get(S.annotation);
|
|
909
|
+
if (L) {
|
|
904
910
|
const b = {
|
|
905
|
-
...
|
|
911
|
+
...L,
|
|
906
912
|
target: {
|
|
907
|
-
...
|
|
913
|
+
...L.target,
|
|
908
914
|
...S
|
|
909
915
|
}
|
|
910
916
|
};
|
|
911
|
-
return e.set(
|
|
912
|
-
oldValue:
|
|
917
|
+
return e.set(L.id, b), {
|
|
918
|
+
oldValue: L,
|
|
913
919
|
newValue: b,
|
|
914
920
|
targetUpdated: {
|
|
915
|
-
oldTarget:
|
|
921
|
+
oldTarget: L.target,
|
|
916
922
|
newTarget: S
|
|
917
923
|
}
|
|
918
924
|
};
|
|
@@ -928,22 +934,22 @@ const to = (e, t) => {
|
|
|
928
934
|
bulkDeleteBodies: w,
|
|
929
935
|
bulkUpdateAnnotation: c,
|
|
930
936
|
bulkUpdateBodies: V,
|
|
931
|
-
bulkUpdateTargets: (S,
|
|
937
|
+
bulkUpdateTargets: (S, L = G.LOCAL) => {
|
|
932
938
|
const b = S.map((T) => Z(T)).filter(Boolean);
|
|
933
|
-
b.length > 0 && s(
|
|
939
|
+
b.length > 0 && s(L, { updated: b });
|
|
934
940
|
},
|
|
935
941
|
clear: h,
|
|
936
942
|
deleteAnnotation: m,
|
|
937
943
|
deleteBody: _,
|
|
938
944
|
getAnnotation: E,
|
|
939
|
-
getBody:
|
|
945
|
+
getBody: v,
|
|
940
946
|
observe: o,
|
|
941
947
|
unobserve: i,
|
|
942
948
|
updateAnnotation: a,
|
|
943
|
-
updateBody:
|
|
944
|
-
updateTarget: (S,
|
|
949
|
+
updateBody: U,
|
|
950
|
+
updateTarget: (S, L = G.LOCAL) => {
|
|
945
951
|
const b = Z(S);
|
|
946
|
-
b && s(
|
|
952
|
+
b && s(L, { updated: [b] });
|
|
947
953
|
}
|
|
948
954
|
};
|
|
949
955
|
}, so = (e) => ({
|
|
@@ -1027,8 +1033,8 @@ const lo = 250, ao = (e, t) => {
|
|
|
1027
1033
|
a.has(p) && setTimeout(() => {
|
|
1028
1034
|
a.get(p).forEach((E) => {
|
|
1029
1035
|
if (n) {
|
|
1030
|
-
const
|
|
1031
|
-
E(
|
|
1036
|
+
const v = Array.isArray(_) ? _.map((U) => n.serialize(U)) : n.serialize(_), X = w ? w instanceof PointerEvent ? w : n.serialize(w) : void 0;
|
|
1037
|
+
E(v, X);
|
|
1032
1038
|
} else
|
|
1033
1039
|
E(_, w);
|
|
1034
1040
|
});
|
|
@@ -1036,9 +1042,9 @@ const lo = 250, ao = (e, t) => {
|
|
|
1036
1042
|
}, m = () => {
|
|
1037
1043
|
const { selected: p } = s, _ = (p || []).map(({ id: w }) => r.getAnnotation(w));
|
|
1038
1044
|
_.forEach((w) => {
|
|
1039
|
-
const E = c.find((
|
|
1045
|
+
const E = c.find((v) => v.id === w.id);
|
|
1040
1046
|
(!E || !_e(E, w)) && g("updateAnnotation", w, E);
|
|
1041
|
-
}), c = c.map((w) => _.find(({ id:
|
|
1047
|
+
}), c = c.map((w) => _.find(({ id: v }) => v === w.id) || w);
|
|
1042
1048
|
};
|
|
1043
1049
|
s.subscribe(({ selected: p }) => {
|
|
1044
1050
|
if (!(c.length === 0 && p.length === 0)) {
|
|
@@ -1052,8 +1058,8 @@ const lo = 250, ao = (e, t) => {
|
|
|
1052
1058
|
else {
|
|
1053
1059
|
const _ = new Set(c.map((E) => E.id)), w = new Set(p.map(({ id: E }) => E));
|
|
1054
1060
|
c.filter((E) => !w.has(E.id)).forEach((E) => {
|
|
1055
|
-
const
|
|
1056
|
-
|
|
1061
|
+
const v = r.getAnnotation(E.id);
|
|
1062
|
+
v && !_e(v, E) && g("updateAnnotation", v, E);
|
|
1057
1063
|
}), c = [
|
|
1058
1064
|
// Remove annotations that were deselected
|
|
1059
1065
|
...c.filter((E) => w.has(E.id)),
|
|
@@ -1072,9 +1078,9 @@ const lo = 250, ao = (e, t) => {
|
|
|
1072
1078
|
...E.bodiesCreated || [],
|
|
1073
1079
|
...E.bodiesDeleted || [],
|
|
1074
1080
|
...E.bodiesUpdated || []
|
|
1075
|
-
].length > 0).forEach(({ oldValue: E, newValue:
|
|
1076
|
-
const X = c.find((
|
|
1077
|
-
c = c.map((
|
|
1081
|
+
].length > 0).forEach(({ oldValue: E, newValue: v }) => {
|
|
1082
|
+
const X = c.find((U) => U.id === E.id) || E;
|
|
1083
|
+
c = c.map((U) => U.id === E.id ? v : U), g("updateAnnotation", v, X);
|
|
1078
1084
|
});
|
|
1079
1085
|
}, { origin: G.LOCAL }), r.observe((p) => {
|
|
1080
1086
|
if (c) {
|
|
@@ -1124,8 +1130,8 @@ const lo = 250, ao = (e, t) => {
|
|
|
1124
1130
|
}
|
|
1125
1131
|
}, y = (p, _ = !0) => {
|
|
1126
1132
|
if (n) {
|
|
1127
|
-
const w = n.parseAll || uo(n), { parsed: E, failed:
|
|
1128
|
-
|
|
1133
|
+
const w = n.parseAll || uo(n), { parsed: E, failed: v } = w(p);
|
|
1134
|
+
v.length > 0 && console.warn(`Discarded ${v.length} invalid annotations`, v), o.bulkAddAnnotation(E, _, G.REMOTE);
|
|
1129
1135
|
} else
|
|
1130
1136
|
o.bulkAddAnnotation(p.map(ot), _, G.REMOTE);
|
|
1131
1137
|
}, g = (p, _) => {
|
|
@@ -1249,7 +1255,7 @@ const Wi = (e, t = { strict: !0, invertY: !1 }) => ({ parse: (i) => To(i, t), se
|
|
|
1249
1255
|
modified: s,
|
|
1250
1256
|
body: r,
|
|
1251
1257
|
...l
|
|
1252
|
-
} = e, a = Eo(r || [], n), c = Array.isArray(e.target) ? e.target[0] : e.target, u = Array.isArray(c.selector) ? c.selector[0] : c.selector, f = (u == null ? void 0 : u.type) === "FragmentSelector" ? Dn(u, t.invertY) : (u == null ? void 0 : u.type) === "SvgSelector" ?
|
|
1258
|
+
} = e, a = Eo(r || [], n), c = Array.isArray(e.target) ? e.target[0] : e.target, u = Array.isArray(c.selector) ? c.selector[0] : c.selector, f = (u == null ? void 0 : u.type) === "FragmentSelector" ? Dn(u, t.invertY) : (u == null ? void 0 : u.type) === "SvgSelector" ? Un(u) : void 0;
|
|
1253
1259
|
return f || !t.strict ? {
|
|
1254
1260
|
parsed: {
|
|
1255
1261
|
...l,
|
|
@@ -1302,11 +1308,11 @@ const Wi = (e, t = { strict: !0, invertY: !1 }) => ({ parse: (i) => To(i, t), se
|
|
|
1302
1308
|
};
|
|
1303
1309
|
return delete u.bodies, "annotation" in u.target && delete u.target.annotation, u;
|
|
1304
1310
|
};
|
|
1305
|
-
function
|
|
1311
|
+
function kt(e, t, n) {
|
|
1306
1312
|
const o = e.slice();
|
|
1307
1313
|
return o[10] = t[n], o[12] = n, o;
|
|
1308
1314
|
}
|
|
1309
|
-
function
|
|
1315
|
+
function vt(e) {
|
|
1310
1316
|
let t, n;
|
|
1311
1317
|
return t = new Pe({
|
|
1312
1318
|
props: {
|
|
@@ -1359,13 +1365,13 @@ function kt(e) {
|
|
|
1359
1365
|
}
|
|
1360
1366
|
};
|
|
1361
1367
|
}
|
|
1362
|
-
function
|
|
1363
|
-
let t, n, o, i, s, r, l, a, c, u, f, h =
|
|
1368
|
+
function Lo(e) {
|
|
1369
|
+
let t, n, o, i, s, r, l, a, c, u, f, h = ve(
|
|
1364
1370
|
/*geom*/
|
|
1365
1371
|
e[4].points
|
|
1366
1372
|
), y = [];
|
|
1367
1373
|
for (let m = 0; m < h.length; m += 1)
|
|
1368
|
-
y[m] = kt(
|
|
1374
|
+
y[m] = vt(kt(e, h, m));
|
|
1369
1375
|
const g = (m) => P(y[m], 1, 1, () => {
|
|
1370
1376
|
y[m] = null;
|
|
1371
1377
|
});
|
|
@@ -1418,14 +1424,14 @@ function vo(e) {
|
|
|
1418
1424
|
16 && r !== (r = /*geom*/
|
|
1419
1425
|
e[4].points.map(Bt).join(" "))) && d(s, "points", r), A & /*geom, viewportScale, grab*/
|
|
1420
1426
|
536) {
|
|
1421
|
-
h =
|
|
1427
|
+
h = ve(
|
|
1422
1428
|
/*geom*/
|
|
1423
1429
|
e[4].points
|
|
1424
1430
|
);
|
|
1425
1431
|
let p;
|
|
1426
1432
|
for (p = 0; p < h.length; p += 1) {
|
|
1427
|
-
const _ =
|
|
1428
|
-
y[p] ? (y[p].p(_, A), O(y[p], 1)) : (y[p] =
|
|
1433
|
+
const _ = kt(e, h, p);
|
|
1434
|
+
y[p] ? (y[p].p(_, A), O(y[p], 1)) : (y[p] = vt(_), y[p].c(), O(y[p], 1), y[p].m(a.parentNode, a));
|
|
1429
1435
|
}
|
|
1430
1436
|
for (re(), p = h.length; p < y.length; p += 1)
|
|
1431
1437
|
g(p);
|
|
@@ -1450,7 +1456,7 @@ function vo(e) {
|
|
|
1450
1456
|
}
|
|
1451
1457
|
};
|
|
1452
1458
|
}
|
|
1453
|
-
function
|
|
1459
|
+
function ko(e) {
|
|
1454
1460
|
let t, n;
|
|
1455
1461
|
return t = new an({
|
|
1456
1462
|
props: {
|
|
@@ -1468,7 +1474,7 @@ function Lo(e) {
|
|
|
1468
1474
|
),
|
|
1469
1475
|
$$slots: {
|
|
1470
1476
|
default: [
|
|
1471
|
-
|
|
1477
|
+
Lo,
|
|
1472
1478
|
({ grab: o }) => ({ 9: o }),
|
|
1473
1479
|
({ grab: o }) => o ? 512 : 0
|
|
1474
1480
|
]
|
|
@@ -1515,7 +1521,7 @@ function Lo(e) {
|
|
|
1515
1521
|
};
|
|
1516
1522
|
}
|
|
1517
1523
|
const It = (e) => e.join(","), Bt = (e) => e.join(",");
|
|
1518
|
-
function
|
|
1524
|
+
function vo(e, t, n) {
|
|
1519
1525
|
let o, { shape: i } = t, { computedStyle: s } = t, { transform: r } = t, { viewportScale: l = 1 } = t;
|
|
1520
1526
|
const a = (h, y, g) => {
|
|
1521
1527
|
let m;
|
|
@@ -1552,7 +1558,7 @@ function ko(e, t, n) {
|
|
|
1552
1558
|
}
|
|
1553
1559
|
class Io extends ie {
|
|
1554
1560
|
constructor(t) {
|
|
1555
|
-
super(), oe(this, t,
|
|
1561
|
+
super(), oe(this, t, vo, ko, Q, {
|
|
1556
1562
|
shape: 0,
|
|
1557
1563
|
computedStyle: 1,
|
|
1558
1564
|
transform: 2,
|
|
@@ -1822,7 +1828,7 @@ function Xo(e) {
|
|
|
1822
1828
|
}
|
|
1823
1829
|
};
|
|
1824
1830
|
}
|
|
1825
|
-
function
|
|
1831
|
+
function Ro(e, t, n) {
|
|
1826
1832
|
let o, { x: i } = t, { y: s } = t, { scale: r } = t, { radius: l = 30 } = t, a = !1;
|
|
1827
1833
|
const c = (g) => {
|
|
1828
1834
|
g.pointerType === "touch" && n(4, a = !0);
|
|
@@ -1858,11 +1864,11 @@ function Uo(e, t, n) {
|
|
|
1858
1864
|
}
|
|
1859
1865
|
class Pe extends ie {
|
|
1860
1866
|
constructor(t) {
|
|
1861
|
-
super(), oe(this, t,
|
|
1867
|
+
super(), oe(this, t, Ro, Xo, Q, { x: 0, y: 1, scale: 2, radius: 3 });
|
|
1862
1868
|
}
|
|
1863
1869
|
}
|
|
1864
|
-
function
|
|
1865
|
-
let t, n, o, i, s, r, l, a, c, u, f, h, y, g, m, A, p, _, w, E,
|
|
1870
|
+
function Uo(e) {
|
|
1871
|
+
let t, n, o, i, s, r, l, a, c, u, f, h, y, g, m, A, p, _, w, E, v, X, U, V, Z, S, L, b, T, Y, D, H, J, $, pe, ce, Be, fe, Oe, ue, R, De, Ve;
|
|
1866
1872
|
return $ = new Pe({
|
|
1867
1873
|
props: {
|
|
1868
1874
|
class: "a9s-corner-handle-topleft",
|
|
@@ -1953,7 +1959,7 @@ function Ro(e) {
|
|
|
1953
1959
|
) && e[9]("BOTTOM_LEFT").apply(this, arguments);
|
|
1954
1960
|
}), {
|
|
1955
1961
|
c() {
|
|
1956
|
-
t = C("rect"), l = se(), a = C("rect"), y = se(), g = C("rect"), _ = se(), w = C("rect"),
|
|
1962
|
+
t = C("rect"), l = se(), a = C("rect"), y = se(), g = C("rect"), _ = se(), w = C("rect"), U = se(), V = C("rect"), b = se(), T = C("rect"), J = se(), ne($.$$.fragment), pe = se(), ne(ce.$$.fragment), Be = se(), ne(fe.$$.fragment), Oe = se(), ne(ue.$$.fragment), d(t, "class", "a9s-outer"), d(t, "style", n = /*computedStyle*/
|
|
1957
1963
|
e[1] ? "display:none;" : void 0), d(t, "x", o = /*geom*/
|
|
1958
1964
|
e[4].x), d(t, "y", i = /*geom*/
|
|
1959
1965
|
e[4].y), d(t, "width", s = /*geom*/
|
|
@@ -1972,19 +1978,19 @@ function Ro(e) {
|
|
|
1972
1978
|
e[4].y), d(g, "height", 1), d(g, "width", p = /*geom*/
|
|
1973
1979
|
e[4].w), d(w, "class", "a9s-edge-handle a9s-edge-handle-right"), d(w, "x", E = /*geom*/
|
|
1974
1980
|
e[4].x + /*geom*/
|
|
1975
|
-
e[4].w), d(w, "y",
|
|
1981
|
+
e[4].w), d(w, "y", v = /*geom*/
|
|
1976
1982
|
e[4].y), d(w, "height", X = /*geom*/
|
|
1977
1983
|
e[4].h), d(w, "width", 1), d(V, "class", "a9s-edge-handle a9s-edge-handle-bottom"), d(V, "x", Z = /*geom*/
|
|
1978
1984
|
e[4].x), d(V, "y", S = /*geom*/
|
|
1979
1985
|
e[4].y + /*geom*/
|
|
1980
|
-
e[4].h), d(V, "height", 1), d(V, "width",
|
|
1986
|
+
e[4].h), d(V, "height", 1), d(V, "width", L = /*geom*/
|
|
1981
1987
|
e[4].w), d(T, "class", "a9s-edge-handle a9s-edge-handle-left"), d(T, "x", Y = /*geom*/
|
|
1982
1988
|
e[4].x), d(T, "y", D = /*geom*/
|
|
1983
1989
|
e[4].y), d(T, "height", H = /*geom*/
|
|
1984
1990
|
e[4].h), d(T, "width", 1);
|
|
1985
1991
|
},
|
|
1986
|
-
m(M,
|
|
1987
|
-
B(M, t,
|
|
1992
|
+
m(M, k) {
|
|
1993
|
+
B(M, t, k), B(M, l, k), B(M, a, k), B(M, y, k), B(M, g, k), B(M, _, k), B(M, w, k), B(M, U, k), B(M, V, k), B(M, b, k), B(M, T, k), B(M, J, k), ee($, M, k), B(M, pe, k), ee(ce, M, k), B(M, Be, k), ee(fe, M, k), B(M, Oe, k), ee(ue, M, k), R = !0, De || (Ve = [
|
|
1988
1994
|
z(t, "pointerdown", function() {
|
|
1989
1995
|
K(
|
|
1990
1996
|
/*grab*/
|
|
@@ -2023,103 +2029,103 @@ function Ro(e) {
|
|
|
2023
2029
|
})
|
|
2024
2030
|
], De = !0);
|
|
2025
2031
|
},
|
|
2026
|
-
p(M,
|
|
2027
|
-
e = M, (!
|
|
2032
|
+
p(M, k) {
|
|
2033
|
+
e = M, (!R || k & /*computedStyle*/
|
|
2028
2034
|
2 && n !== (n = /*computedStyle*/
|
|
2029
|
-
e[1] ? "display:none;" : void 0)) && d(t, "style", n), (!
|
|
2035
|
+
e[1] ? "display:none;" : void 0)) && d(t, "style", n), (!R || k & /*geom*/
|
|
2030
2036
|
16 && o !== (o = /*geom*/
|
|
2031
|
-
e[4].x)) && d(t, "x", o), (!
|
|
2037
|
+
e[4].x)) && d(t, "x", o), (!R || k & /*geom*/
|
|
2032
2038
|
16 && i !== (i = /*geom*/
|
|
2033
|
-
e[4].y)) && d(t, "y", i), (!
|
|
2039
|
+
e[4].y)) && d(t, "y", i), (!R || k & /*geom*/
|
|
2034
2040
|
16 && s !== (s = /*geom*/
|
|
2035
|
-
e[4].w)) && d(t, "width", s), (!
|
|
2041
|
+
e[4].w)) && d(t, "width", s), (!R || k & /*geom*/
|
|
2036
2042
|
16 && r !== (r = /*geom*/
|
|
2037
|
-
e[4].h)) && d(t, "height", r), (!
|
|
2043
|
+
e[4].h)) && d(t, "height", r), (!R || k & /*computedStyle*/
|
|
2038
2044
|
2) && d(
|
|
2039
2045
|
a,
|
|
2040
2046
|
"style",
|
|
2041
2047
|
/*computedStyle*/
|
|
2042
2048
|
e[1]
|
|
2043
|
-
), (!
|
|
2049
|
+
), (!R || k & /*geom*/
|
|
2044
2050
|
16 && c !== (c = /*geom*/
|
|
2045
|
-
e[4].x)) && d(a, "x", c), (!
|
|
2051
|
+
e[4].x)) && d(a, "x", c), (!R || k & /*geom*/
|
|
2046
2052
|
16 && u !== (u = /*geom*/
|
|
2047
|
-
e[4].y)) && d(a, "y", u), (!
|
|
2053
|
+
e[4].y)) && d(a, "y", u), (!R || k & /*geom*/
|
|
2048
2054
|
16 && f !== (f = /*geom*/
|
|
2049
|
-
e[4].w)) && d(a, "width", f), (!
|
|
2055
|
+
e[4].w)) && d(a, "width", f), (!R || k & /*geom*/
|
|
2050
2056
|
16 && h !== (h = /*geom*/
|
|
2051
|
-
e[4].h)) && d(a, "height", h), (!
|
|
2057
|
+
e[4].h)) && d(a, "height", h), (!R || k & /*geom*/
|
|
2052
2058
|
16 && m !== (m = /*geom*/
|
|
2053
|
-
e[4].x)) && d(g, "x", m), (!
|
|
2059
|
+
e[4].x)) && d(g, "x", m), (!R || k & /*geom*/
|
|
2054
2060
|
16 && A !== (A = /*geom*/
|
|
2055
|
-
e[4].y)) && d(g, "y", A), (!
|
|
2061
|
+
e[4].y)) && d(g, "y", A), (!R || k & /*geom*/
|
|
2056
2062
|
16 && p !== (p = /*geom*/
|
|
2057
|
-
e[4].w)) && d(g, "width", p), (!
|
|
2063
|
+
e[4].w)) && d(g, "width", p), (!R || k & /*geom*/
|
|
2058
2064
|
16 && E !== (E = /*geom*/
|
|
2059
2065
|
e[4].x + /*geom*/
|
|
2060
|
-
e[4].w)) && d(w, "x", E), (!
|
|
2061
|
-
16 &&
|
|
2062
|
-
e[4].y)) && d(w, "y",
|
|
2066
|
+
e[4].w)) && d(w, "x", E), (!R || k & /*geom*/
|
|
2067
|
+
16 && v !== (v = /*geom*/
|
|
2068
|
+
e[4].y)) && d(w, "y", v), (!R || k & /*geom*/
|
|
2063
2069
|
16 && X !== (X = /*geom*/
|
|
2064
|
-
e[4].h)) && d(w, "height", X), (!
|
|
2070
|
+
e[4].h)) && d(w, "height", X), (!R || k & /*geom*/
|
|
2065
2071
|
16 && Z !== (Z = /*geom*/
|
|
2066
|
-
e[4].x)) && d(V, "x", Z), (!
|
|
2072
|
+
e[4].x)) && d(V, "x", Z), (!R || k & /*geom*/
|
|
2067
2073
|
16 && S !== (S = /*geom*/
|
|
2068
2074
|
e[4].y + /*geom*/
|
|
2069
|
-
e[4].h)) && d(V, "y", S), (!
|
|
2070
|
-
16 &&
|
|
2071
|
-
e[4].w)) && d(V, "width",
|
|
2075
|
+
e[4].h)) && d(V, "y", S), (!R || k & /*geom*/
|
|
2076
|
+
16 && L !== (L = /*geom*/
|
|
2077
|
+
e[4].w)) && d(V, "width", L), (!R || k & /*geom*/
|
|
2072
2078
|
16 && Y !== (Y = /*geom*/
|
|
2073
|
-
e[4].x)) && d(T, "x", Y), (!
|
|
2079
|
+
e[4].x)) && d(T, "x", Y), (!R || k & /*geom*/
|
|
2074
2080
|
16 && D !== (D = /*geom*/
|
|
2075
|
-
e[4].y)) && d(T, "y", D), (!
|
|
2081
|
+
e[4].y)) && d(T, "y", D), (!R || k & /*geom*/
|
|
2076
2082
|
16 && H !== (H = /*geom*/
|
|
2077
2083
|
e[4].h)) && d(T, "height", H);
|
|
2078
2084
|
const N = {};
|
|
2079
|
-
|
|
2085
|
+
k & /*geom*/
|
|
2080
2086
|
16 && (N.x = /*geom*/
|
|
2081
|
-
e[4].x),
|
|
2087
|
+
e[4].x), k & /*geom*/
|
|
2082
2088
|
16 && (N.y = /*geom*/
|
|
2083
|
-
e[4].y),
|
|
2089
|
+
e[4].y), k & /*viewportScale*/
|
|
2084
2090
|
8 && (N.scale = /*viewportScale*/
|
|
2085
2091
|
e[3]), $.$set(N);
|
|
2086
2092
|
const x = {};
|
|
2087
|
-
|
|
2093
|
+
k & /*geom*/
|
|
2088
2094
|
16 && (x.x = /*geom*/
|
|
2089
2095
|
e[4].x + /*geom*/
|
|
2090
|
-
e[4].w),
|
|
2096
|
+
e[4].w), k & /*geom*/
|
|
2091
2097
|
16 && (x.y = /*geom*/
|
|
2092
|
-
e[4].y),
|
|
2098
|
+
e[4].y), k & /*viewportScale*/
|
|
2093
2099
|
8 && (x.scale = /*viewportScale*/
|
|
2094
2100
|
e[3]), ce.$set(x);
|
|
2095
2101
|
const de = {};
|
|
2096
|
-
|
|
2102
|
+
k & /*geom*/
|
|
2097
2103
|
16 && (de.x = /*geom*/
|
|
2098
2104
|
e[4].x + /*geom*/
|
|
2099
|
-
e[4].w),
|
|
2105
|
+
e[4].w), k & /*geom*/
|
|
2100
2106
|
16 && (de.y = /*geom*/
|
|
2101
2107
|
e[4].y + /*geom*/
|
|
2102
|
-
e[4].h),
|
|
2108
|
+
e[4].h), k & /*viewportScale*/
|
|
2103
2109
|
8 && (de.scale = /*viewportScale*/
|
|
2104
2110
|
e[3]), fe.$set(de);
|
|
2105
2111
|
const we = {};
|
|
2106
|
-
|
|
2112
|
+
k & /*geom*/
|
|
2107
2113
|
16 && (we.x = /*geom*/
|
|
2108
|
-
e[4].x),
|
|
2114
|
+
e[4].x), k & /*geom*/
|
|
2109
2115
|
16 && (we.y = /*geom*/
|
|
2110
2116
|
e[4].y + /*geom*/
|
|
2111
|
-
e[4].h),
|
|
2117
|
+
e[4].h), k & /*viewportScale*/
|
|
2112
2118
|
8 && (we.scale = /*viewportScale*/
|
|
2113
2119
|
e[3]), ue.$set(we);
|
|
2114
2120
|
},
|
|
2115
2121
|
i(M) {
|
|
2116
|
-
|
|
2122
|
+
R || (O($.$$.fragment, M), O(ce.$$.fragment, M), O(fe.$$.fragment, M), O(ue.$$.fragment, M), R = !0);
|
|
2117
2123
|
},
|
|
2118
2124
|
o(M) {
|
|
2119
|
-
P($.$$.fragment, M), P(ce.$$.fragment, M), P(fe.$$.fragment, M), P(ue.$$.fragment, M),
|
|
2125
|
+
P($.$$.fragment, M), P(ce.$$.fragment, M), P(fe.$$.fragment, M), P(ue.$$.fragment, M), R = !1;
|
|
2120
2126
|
},
|
|
2121
2127
|
d(M) {
|
|
2122
|
-
M && (I(t), I(l), I(a), I(y), I(g), I(_), I(w), I(
|
|
2128
|
+
M && (I(t), I(l), I(a), I(y), I(g), I(_), I(w), I(U), I(V), I(b), I(T), I(J), I(pe), I(Be), I(Oe)), te($, M), te(ce, M), te(fe, M), te(ue, M), De = !1, ge(Ve);
|
|
2123
2129
|
}
|
|
2124
2130
|
};
|
|
2125
2131
|
}
|
|
@@ -2141,7 +2147,7 @@ function No(e) {
|
|
|
2141
2147
|
),
|
|
2142
2148
|
$$slots: {
|
|
2143
2149
|
default: [
|
|
2144
|
-
|
|
2150
|
+
Uo,
|
|
2145
2151
|
({ grab: o }) => ({ 9: o }),
|
|
2146
2152
|
({ grab: o }) => o ? 512 : 0
|
|
2147
2153
|
]
|
|
@@ -2192,21 +2198,21 @@ function Vo(e, t, n) {
|
|
|
2192
2198
|
const a = (h, y, g) => {
|
|
2193
2199
|
const m = h.geometry.bounds;
|
|
2194
2200
|
let [A, p] = [m.minX, m.minY], [_, w] = [m.maxX, m.maxY];
|
|
2195
|
-
const [E,
|
|
2201
|
+
const [E, v] = g;
|
|
2196
2202
|
if (y === "SHAPE")
|
|
2197
|
-
A += E, _ += E, p +=
|
|
2203
|
+
A += E, _ += E, p += v, w += v;
|
|
2198
2204
|
else {
|
|
2199
2205
|
switch (y) {
|
|
2200
2206
|
case "TOP":
|
|
2201
2207
|
case "TOP_LEFT":
|
|
2202
2208
|
case "TOP_RIGHT": {
|
|
2203
|
-
p +=
|
|
2209
|
+
p += v;
|
|
2204
2210
|
break;
|
|
2205
2211
|
}
|
|
2206
2212
|
case "BOTTOM":
|
|
2207
2213
|
case "BOTTOM_LEFT":
|
|
2208
2214
|
case "BOTTOM_RIGHT": {
|
|
2209
|
-
w +=
|
|
2215
|
+
w += v;
|
|
2210
2216
|
break;
|
|
2211
2217
|
}
|
|
2212
2218
|
}
|
|
@@ -2225,19 +2231,19 @@ function Vo(e, t, n) {
|
|
|
2225
2231
|
}
|
|
2226
2232
|
}
|
|
2227
2233
|
}
|
|
2228
|
-
const X = Math.min(A, _),
|
|
2234
|
+
const X = Math.min(A, _), U = Math.min(p, w), V = Math.abs(_ - A), Z = Math.abs(w - p);
|
|
2229
2235
|
return {
|
|
2230
2236
|
...h,
|
|
2231
2237
|
geometry: {
|
|
2232
2238
|
x: X,
|
|
2233
|
-
y:
|
|
2239
|
+
y: U,
|
|
2234
2240
|
w: V,
|
|
2235
2241
|
h: Z,
|
|
2236
2242
|
bounds: {
|
|
2237
2243
|
minX: X,
|
|
2238
|
-
minY:
|
|
2244
|
+
minY: U,
|
|
2239
2245
|
maxX: X + V,
|
|
2240
|
-
maxY:
|
|
2246
|
+
maxY: U + Z
|
|
2241
2247
|
}
|
|
2242
2248
|
}
|
|
2243
2249
|
};
|
|
@@ -2764,8 +2770,8 @@ function oi(e, t, n) {
|
|
|
2764
2770
|
const i = Ie();
|
|
2765
2771
|
let { addEventListener: s } = t, { drawingMode: r } = t, { transform: l } = t, { viewportScale: a = 1 } = t, c, u = [], f, h, y = !1;
|
|
2766
2772
|
const g = (w) => {
|
|
2767
|
-
const E = w, { timeStamp:
|
|
2768
|
-
if (c = { timeStamp:
|
|
2773
|
+
const E = w, { timeStamp: v, offsetX: X, offsetY: U } = E;
|
|
2774
|
+
if (c = { timeStamp: v, offsetX: X, offsetY: U }, r === "drag" && u.length === 0) {
|
|
2769
2775
|
const V = l.elementToImage(E.offsetX, E.offsetY);
|
|
2770
2776
|
u.push(V), n(1, f = V);
|
|
2771
2777
|
}
|
|
@@ -2773,8 +2779,8 @@ function oi(e, t, n) {
|
|
|
2773
2779
|
const E = w;
|
|
2774
2780
|
if (h && clearTimeout(h), u.length > 0) {
|
|
2775
2781
|
if (n(1, f = l.elementToImage(E.offsetX, E.offsetY)), u.length > 2) {
|
|
2776
|
-
const
|
|
2777
|
-
n(2, y =
|
|
2782
|
+
const v = st(f, u[0]) * a;
|
|
2783
|
+
n(2, y = v < ti);
|
|
2778
2784
|
}
|
|
2779
2785
|
E.pointerType === "touch" && (h = setTimeout(
|
|
2780
2786
|
() => {
|
|
@@ -2786,13 +2792,13 @@ function oi(e, t, n) {
|
|
|
2786
2792
|
}, A = (w) => {
|
|
2787
2793
|
const E = w;
|
|
2788
2794
|
if (h && clearTimeout(h), r === "click") {
|
|
2789
|
-
const
|
|
2790
|
-
if (
|
|
2795
|
+
const v = E.timeStamp - c.timeStamp, X = st([c.offsetX, c.offsetY], [E.offsetX, E.offsetY]);
|
|
2796
|
+
if (v > 300 || X > 15) return;
|
|
2791
2797
|
if (y)
|
|
2792
2798
|
_();
|
|
2793
2799
|
else if (u.length === 0) {
|
|
2794
|
-
const
|
|
2795
|
-
u.push(
|
|
2800
|
+
const U = l.elementToImage(E.offsetX, E.offsetY);
|
|
2801
|
+
u.push(U), n(1, f = U);
|
|
2796
2802
|
} else
|
|
2797
2803
|
u.push(f);
|
|
2798
2804
|
} else {
|
|
@@ -3188,11 +3194,11 @@ function lt(e) {
|
|
|
3188
3194
|
);
|
|
3189
3195
|
return t[46] = n, t;
|
|
3190
3196
|
}
|
|
3191
|
-
function
|
|
3197
|
+
function Rt(e) {
|
|
3192
3198
|
let t = (
|
|
3193
3199
|
/*annotation*/
|
|
3194
3200
|
e[43].id
|
|
3195
|
-
), n, o, i =
|
|
3201
|
+
), n, o, i = Ut(e);
|
|
3196
3202
|
return {
|
|
3197
3203
|
c() {
|
|
3198
3204
|
i.c(), n = ae();
|
|
@@ -3203,7 +3209,7 @@ function Ut(e) {
|
|
|
3203
3209
|
p(s, r) {
|
|
3204
3210
|
r[0] & /*$store*/
|
|
3205
3211
|
65536 && Q(t, t = /*annotation*/
|
|
3206
|
-
s[43].id) ? (re(), P(i, 1, 1, j), le(), i =
|
|
3212
|
+
s[43].id) ? (re(), P(i, 1, 1, j), le(), i = Ut(s), i.c(), O(i, 1), i.m(n.parentNode, n)) : i.p(s, r);
|
|
3207
3213
|
},
|
|
3208
3214
|
i(s) {
|
|
3209
3215
|
o || (O(i), o = !0);
|
|
@@ -3353,7 +3359,7 @@ function Ai(e) {
|
|
|
3353
3359
|
}
|
|
3354
3360
|
};
|
|
3355
3361
|
}
|
|
3356
|
-
function
|
|
3362
|
+
function Ut(e) {
|
|
3357
3363
|
let t, n, o, i;
|
|
3358
3364
|
const s = [Ai, Ei, bi], r = [];
|
|
3359
3365
|
function l(a, c) {
|
|
@@ -3401,7 +3407,7 @@ function Nt(e) {
|
|
|
3401
3407
|
e[9](
|
|
3402
3408
|
/*annotation*/
|
|
3403
3409
|
e[43]
|
|
3404
|
-
), n, o, i = t &&
|
|
3410
|
+
), n, o, i = t && Rt(lt(e));
|
|
3405
3411
|
return {
|
|
3406
3412
|
c() {
|
|
3407
3413
|
i && i.c(), n = ae();
|
|
@@ -3419,7 +3425,7 @@ function Nt(e) {
|
|
|
3419
3425
|
/*annotation*/
|
|
3420
3426
|
s[43]
|
|
3421
3427
|
)), t ? i ? (i.p(lt(s), r), r[0] & /*$store, isEditable*/
|
|
3422
|
-
66048 && O(i, 1)) : (i =
|
|
3428
|
+
66048 && O(i, 1)) : (i = Rt(lt(s)), i.c(), O(i, 1), i.m(n.parentNode, n)) : i && (re(), P(i, 1, 1, () => {
|
|
3423
3429
|
i = null;
|
|
3424
3430
|
}), le());
|
|
3425
3431
|
},
|
|
@@ -3500,7 +3506,7 @@ function Si(e) {
|
|
|
3500
3506
|
};
|
|
3501
3507
|
}
|
|
3502
3508
|
function Ti(e) {
|
|
3503
|
-
let t, n, o =
|
|
3509
|
+
let t, n, o = ve(
|
|
3504
3510
|
/*editableAnnotations*/
|
|
3505
3511
|
e[8]
|
|
3506
3512
|
), i = [];
|
|
@@ -3523,7 +3529,7 @@ function Ti(e) {
|
|
|
3523
3529
|
p(r, l) {
|
|
3524
3530
|
if (l[0] & /*editableAnnotations, drawingEl, getEditor, style, transform, $scale, onChangeSelected*/
|
|
3525
3531
|
21107010) {
|
|
3526
|
-
o =
|
|
3532
|
+
o = ve(
|
|
3527
3533
|
/*editableAnnotations*/
|
|
3528
3534
|
r[8]
|
|
3529
3535
|
);
|
|
@@ -3756,7 +3762,7 @@ function Ht(e) {
|
|
|
3756
3762
|
};
|
|
3757
3763
|
}
|
|
3758
3764
|
function Mi(e) {
|
|
3759
|
-
let t, n, o, i, s, r, l =
|
|
3765
|
+
let t, n, o, i, s, r, l = ve(
|
|
3760
3766
|
/*$store*/
|
|
3761
3767
|
e[16].filter(
|
|
3762
3768
|
/*func*/
|
|
@@ -3818,7 +3824,7 @@ function Mi(e) {
|
|
|
3818
3824
|
p(f, h) {
|
|
3819
3825
|
if (e = f, h[0] & /*$store, style, isEditable*/
|
|
3820
3826
|
66050) {
|
|
3821
|
-
l =
|
|
3827
|
+
l = ve(
|
|
3822
3828
|
/*$store*/
|
|
3823
3829
|
e[16].filter(
|
|
3824
3830
|
/*func*/
|
|
@@ -3872,11 +3878,11 @@ function Mi(e) {
|
|
|
3872
3878
|
}
|
|
3873
3879
|
};
|
|
3874
3880
|
}
|
|
3875
|
-
function
|
|
3881
|
+
function Li(e, t, n) {
|
|
3876
3882
|
let o, i, s, r, l, a, c, u, f, h, y, g = j, m = () => (g(), g = Jt(Y, (M) => n(17, y = M)), Y);
|
|
3877
3883
|
e.$$.on_destroy.push(() => g());
|
|
3878
|
-
let { drawingEnabled: A } = t, { image: p } = t, { preferredDrawingMode: _ } = t, { state: w } = t, { style: E = void 0 } = t, { toolName:
|
|
3879
|
-
const Z = () => n(5, V += 1), S = () =>
|
|
3884
|
+
let { drawingEnabled: A } = t, { image: p } = t, { preferredDrawingMode: _ } = t, { state: w } = t, { style: E = void 0 } = t, { toolName: v = cn()[0] } = t, { user: X } = t, { visible: U = !0 } = t, V = 0;
|
|
3885
|
+
const Z = () => n(5, V += 1), S = () => v, L = () => A;
|
|
3880
3886
|
let b, T, Y;
|
|
3881
3887
|
Ne(() => m(n(7, Y = Do(p, T))));
|
|
3882
3888
|
const { hover: D, selection: H, store: J } = w;
|
|
@@ -3884,37 +3890,37 @@ function vi(e, t, n) {
|
|
|
3884
3890
|
let $, pe;
|
|
3885
3891
|
const ce = (M) => {
|
|
3886
3892
|
$ && J.unobserve($);
|
|
3887
|
-
const
|
|
3888
|
-
|
|
3893
|
+
const k = M.filter(({ editable: N }) => N).map(({ id: N }) => N);
|
|
3894
|
+
k.length > 0 ? (n(8, pe = k.map((N) => J.getAnnotation(N)).filter((N) => N && Je(N))), $ = (N) => {
|
|
3889
3895
|
const { updated: x } = N.changes;
|
|
3890
3896
|
n(8, pe = x == null ? void 0 : x.map((de) => de.newValue));
|
|
3891
|
-
}, J.observe($, { annotations:
|
|
3897
|
+
}, J.observe($, { annotations: k })) : n(8, pe = void 0);
|
|
3892
3898
|
}, Be = (M) => {
|
|
3893
|
-
const
|
|
3894
|
-
id:
|
|
3899
|
+
const k = tn(), N = {
|
|
3900
|
+
id: k,
|
|
3895
3901
|
bodies: [],
|
|
3896
3902
|
target: {
|
|
3897
|
-
annotation:
|
|
3903
|
+
annotation: k,
|
|
3898
3904
|
selector: M.detail,
|
|
3899
3905
|
creator: X,
|
|
3900
3906
|
created: /* @__PURE__ */ new Date()
|
|
3901
3907
|
}
|
|
3902
3908
|
};
|
|
3903
3909
|
J.addAnnotation(N), H.setSelected(N.id);
|
|
3904
|
-
}, fe = (M) => (
|
|
3910
|
+
}, fe = (M) => (k) => {
|
|
3905
3911
|
var we;
|
|
3906
3912
|
const { target: N } = M, x = 10 * 60 * 1e3, de = ((we = N.creator) == null ? void 0 : we.id) !== X.id || !N.created || (/* @__PURE__ */ new Date()).getTime() - N.created.getTime() > x;
|
|
3907
3913
|
J.updateTarget({
|
|
3908
3914
|
...N,
|
|
3909
|
-
selector:
|
|
3915
|
+
selector: k.detail,
|
|
3910
3916
|
created: de ? N.created : /* @__PURE__ */ new Date(),
|
|
3911
3917
|
updated: de ? /* @__PURE__ */ new Date() : void 0,
|
|
3912
3918
|
updatedBy: de ? X : void 0
|
|
3913
3919
|
});
|
|
3914
3920
|
}, Oe = (M) => {
|
|
3915
|
-
const { x:
|
|
3921
|
+
const { x: k, y: N } = un(M, T), x = J.getAt(k, N);
|
|
3916
3922
|
x ? u !== x.id && D.set(x.id) : D.set(void 0);
|
|
3917
|
-
}, ue = (M) => jo(M),
|
|
3923
|
+
}, ue = (M) => jo(M), R = (M) => Je(M);
|
|
3918
3924
|
function De(M) {
|
|
3919
3925
|
We[M ? "unshift" : "push"](() => {
|
|
3920
3926
|
b = M, n(6, b);
|
|
@@ -3926,21 +3932,21 @@ function vi(e, t, n) {
|
|
|
3926
3932
|
});
|
|
3927
3933
|
}
|
|
3928
3934
|
return e.$$set = (M) => {
|
|
3929
|
-
"drawingEnabled" in M && n(0, A = M.drawingEnabled), "image" in M && n(25, p = M.image), "preferredDrawingMode" in M && n(26, _ = M.preferredDrawingMode), "state" in M && n(27, w = M.state), "style" in M && n(1, E = M.style), "toolName" in M && n(2,
|
|
3935
|
+
"drawingEnabled" in M && n(0, A = M.drawingEnabled), "image" in M && n(25, p = M.image), "preferredDrawingMode" in M && n(26, _ = M.preferredDrawingMode), "state" in M && n(27, w = M.state), "style" in M && n(1, E = M.style), "toolName" in M && n(2, v = M.toolName), "user" in M && n(28, X = M.user), "visible" in M && n(3, U = M.visible);
|
|
3930
3936
|
}, e.$$.update = () => {
|
|
3931
3937
|
e.$$.dirty[0] & /*toolName*/
|
|
3932
|
-
4 && n(14, { tool: o, opts: i } = fn(
|
|
3938
|
+
4 && n(14, { tool: o, opts: i } = fn(v) || { tool: void 0, opts: void 0 }, o, (n(32, i), n(2, v))), e.$$.dirty[0] & /*preferredDrawingMode*/
|
|
3933
3939
|
67108864 | e.$$.dirty[1] & /*opts*/
|
|
3934
3940
|
2 && n(13, s = (i == null ? void 0 : i.drawingMode) || _), e.$$.dirty[0] & /*svgEl*/
|
|
3935
3941
|
16 && n(12, r = yi(T)), e.$$.dirty[0] & /*svgEl*/
|
|
3936
3942
|
16 && n(11, { onPointerDown: l, onPointerUp: a } = wi(T, J), l, (n(10, a), n(4, T))), e.$$.dirty[1] & /*$selection*/
|
|
3937
|
-
4 && n(9, c = (M) => f.selected.find((
|
|
3943
|
+
4 && n(9, c = (M) => f.selected.find((k) => k.id === M.id && k.editable)), e.$$.dirty[1] & /*$selection*/
|
|
3938
3944
|
4 && ce(f.selected);
|
|
3939
3945
|
}, [
|
|
3940
3946
|
A,
|
|
3941
3947
|
E,
|
|
3942
|
-
|
|
3943
|
-
|
|
3948
|
+
v,
|
|
3949
|
+
U,
|
|
3944
3950
|
T,
|
|
3945
3951
|
V,
|
|
3946
3952
|
b,
|
|
@@ -3968,20 +3974,20 @@ function vi(e, t, n) {
|
|
|
3968
3974
|
X,
|
|
3969
3975
|
Z,
|
|
3970
3976
|
S,
|
|
3971
|
-
|
|
3977
|
+
L,
|
|
3972
3978
|
i,
|
|
3973
3979
|
f,
|
|
3974
|
-
|
|
3980
|
+
R,
|
|
3975
3981
|
De,
|
|
3976
3982
|
Ve
|
|
3977
3983
|
];
|
|
3978
3984
|
}
|
|
3979
|
-
class
|
|
3985
|
+
class ki extends ie {
|
|
3980
3986
|
constructor(t) {
|
|
3981
3987
|
super(), oe(
|
|
3982
3988
|
this,
|
|
3983
3989
|
t,
|
|
3984
|
-
|
|
3990
|
+
Li,
|
|
3985
3991
|
Mi,
|
|
3986
3992
|
Q,
|
|
3987
3993
|
{
|
|
@@ -4011,7 +4017,7 @@ class Li extends ie {
|
|
|
4011
4017
|
return this.$$.ctx[31];
|
|
4012
4018
|
}
|
|
4013
4019
|
}
|
|
4014
|
-
function dn(e, t, n = 0, o = e.length - 1, i =
|
|
4020
|
+
function dn(e, t, n = 0, o = e.length - 1, i = vi) {
|
|
4015
4021
|
for (; o > n; ) {
|
|
4016
4022
|
if (o - n > 600) {
|
|
4017
4023
|
const a = o - n + 1, c = t - n + 1, u = Math.log(a), f = 0.5 * Math.exp(2 * u / 3), h = 0.5 * Math.sqrt(u * f * (a - f) / a) * (c - a / 2 < 0 ? -1 : 1), y = Math.max(n, Math.floor(t - c * f / a + h)), g = Math.min(o, Math.floor(t + (a - c) * f / a + h));
|
|
@@ -4030,7 +4036,7 @@ function Ye(e, t, n) {
|
|
|
4030
4036
|
const o = e[t];
|
|
4031
4037
|
e[t] = e[n], e[n] = o;
|
|
4032
4038
|
}
|
|
4033
|
-
function
|
|
4039
|
+
function vi(e, t) {
|
|
4034
4040
|
return e < t ? -1 : e > t ? 1 : 0;
|
|
4035
4041
|
}
|
|
4036
4042
|
class Ii {
|
|
@@ -4095,7 +4101,7 @@ class Ii {
|
|
|
4095
4101
|
return t && this._insert(t, this.data.height - 1), this;
|
|
4096
4102
|
}
|
|
4097
4103
|
clear() {
|
|
4098
|
-
return this.data =
|
|
4104
|
+
return this.data = Le([]), this;
|
|
4099
4105
|
}
|
|
4100
4106
|
remove(t, n) {
|
|
4101
4107
|
if (!t) return this;
|
|
@@ -4137,8 +4143,8 @@ class Ii {
|
|
|
4137
4143
|
const s = o - n + 1;
|
|
4138
4144
|
let r = this._maxEntries, l;
|
|
4139
4145
|
if (s <= r)
|
|
4140
|
-
return l =
|
|
4141
|
-
i || (i = Math.ceil(Math.log(s) / Math.log(r)), r = Math.ceil(s / Math.pow(r, i - 1))), l =
|
|
4146
|
+
return l = Le(t.slice(n, o + 1)), Te(l, this.toBBox), l;
|
|
4147
|
+
i || (i = Math.ceil(Math.log(s) / Math.log(r)), r = Math.ceil(s / Math.pow(r, i - 1))), l = Le([]), l.leaf = !1, l.height = i;
|
|
4142
4148
|
const a = Math.ceil(s / r), c = a * Math.ceil(Math.sqrt(r));
|
|
4143
4149
|
Ft(t, n, o, c, this.compareMinX);
|
|
4144
4150
|
for (let u = n; u <= o; u += c) {
|
|
@@ -4172,11 +4178,11 @@ class Ii {
|
|
|
4172
4178
|
_split(t, n) {
|
|
4173
4179
|
const o = t[n], i = o.children.length, s = this._minEntries;
|
|
4174
4180
|
this._chooseSplitAxis(o, s, i);
|
|
4175
|
-
const r = this._chooseSplitIndex(o, s, i), l =
|
|
4181
|
+
const r = this._chooseSplitIndex(o, s, i), l = Le(o.children.splice(r, o.children.length - r));
|
|
4176
4182
|
l.height = o.height, l.leaf = o.leaf, Te(o, this.toBBox), Te(l, this.toBBox), n ? t[n - 1].children.push(l) : this._splitRoot(o, l);
|
|
4177
4183
|
}
|
|
4178
4184
|
_splitRoot(t, n) {
|
|
4179
|
-
this.data =
|
|
4185
|
+
this.data = Le([t, n]), this.data.height = t.height + 1, this.data.leaf = !1, Te(this.data, this.toBBox);
|
|
4180
4186
|
}
|
|
4181
4187
|
_chooseSplitIndex(t, n, o) {
|
|
4182
4188
|
let i, s = 1 / 0, r = 1 / 0;
|
|
@@ -4225,7 +4231,7 @@ function Te(e, t) {
|
|
|
4225
4231
|
Ce(e, 0, e.children.length, t, e);
|
|
4226
4232
|
}
|
|
4227
4233
|
function Ce(e, t, n, o, i) {
|
|
4228
|
-
i || (i =
|
|
4234
|
+
i || (i = Le(null)), i.minX = 1 / 0, i.minY = 1 / 0, i.maxX = -1 / 0, i.maxY = -1 / 0;
|
|
4229
4235
|
for (let s = t; s < n; s++) {
|
|
4230
4236
|
const r = e.children[s];
|
|
4231
4237
|
Xe(i, e.leaf ? o(r) : r);
|
|
@@ -4260,7 +4266,7 @@ function ct(e, t) {
|
|
|
4260
4266
|
function ze(e, t) {
|
|
4261
4267
|
return t.minX <= e.maxX && t.minY <= e.maxY && t.maxX >= e.minX && t.maxY >= e.minY;
|
|
4262
4268
|
}
|
|
4263
|
-
function
|
|
4269
|
+
function Le(e) {
|
|
4264
4270
|
return {
|
|
4265
4271
|
children: e,
|
|
4266
4272
|
height: 1,
|
|
@@ -4300,7 +4306,7 @@ const Ci = () => {
|
|
|
4300
4306
|
minY: h,
|
|
4301
4307
|
maxX: f,
|
|
4302
4308
|
maxY: h
|
|
4303
|
-
}).map((m) => m.target).filter((m) => m.selector.type === F.RECTANGLE ||
|
|
4309
|
+
}).map((m) => m.target).filter((m) => m.selector.type === F.RECTANGLE || vn(m.selector, f, h));
|
|
4304
4310
|
if (g.length > 0)
|
|
4305
4311
|
return g.sort((m, A) => ht(m.selector) - ht(A.selector)), g[0];
|
|
4306
4312
|
},
|
|
@@ -4345,13 +4351,13 @@ const Ci = () => {
|
|
|
4345
4351
|
hover: i,
|
|
4346
4352
|
viewport: s
|
|
4347
4353
|
};
|
|
4348
|
-
},
|
|
4354
|
+
}, Ri = (e) => {
|
|
4349
4355
|
const t = Xi(e);
|
|
4350
4356
|
return {
|
|
4351
4357
|
...t,
|
|
4352
4358
|
store: so(t.store)
|
|
4353
4359
|
};
|
|
4354
|
-
},
|
|
4360
|
+
}, Ui = (e) => {
|
|
4355
4361
|
let t, n;
|
|
4356
4362
|
if (e.nodeName === "CANVAS")
|
|
4357
4363
|
t = e, n = t.getContext("2d", { willReadFrequently: !0 });
|
|
@@ -4367,7 +4373,7 @@ const Ci = () => {
|
|
|
4367
4373
|
}
|
|
4368
4374
|
return o / 81;
|
|
4369
4375
|
}, Ni = (e) => {
|
|
4370
|
-
const t =
|
|
4376
|
+
const t = Ui(e), n = t > 0.6 ? "dark" : "light";
|
|
4371
4377
|
return console.log(`[Annotorious] Image brightness: ${t.toFixed(1)}. Setting ${n} theme.`), n;
|
|
4372
4378
|
}, Kt = (e, t, n) => t.setAttribute("data-theme", n === "auto" ? Ni(e) : n), Vi = (e, t) => ({
|
|
4373
4379
|
...e,
|
|
@@ -4396,7 +4402,7 @@ const Ci = () => {
|
|
|
4396
4402
|
drawingMode: "drag",
|
|
4397
4403
|
userSelectAction: nn.EDIT,
|
|
4398
4404
|
theme: "light"
|
|
4399
|
-
}), i =
|
|
4405
|
+
}), i = Ri(o), { selection: s, store: r } = i, l = ao(r, o.initialHistory), a = fo(
|
|
4400
4406
|
i,
|
|
4401
4407
|
l,
|
|
4402
4408
|
o.adapter,
|
|
@@ -4406,7 +4412,7 @@ const Ci = () => {
|
|
|
4406
4412
|
const u = Gi(l);
|
|
4407
4413
|
let f = wo();
|
|
4408
4414
|
Kt(n, c, o.theme);
|
|
4409
|
-
const h = new
|
|
4415
|
+
const h = new ki({
|
|
4410
4416
|
target: c,
|
|
4411
4417
|
props: {
|
|
4412
4418
|
drawingEnabled: !!o.drawingEnabled,
|
|
@@ -4423,15 +4429,15 @@ const Ci = () => {
|
|
|
4423
4429
|
});
|
|
4424
4430
|
const y = ho(i, l, o.adapter), g = () => h.cancelDrawing(), m = () => {
|
|
4425
4431
|
h.$destroy(), c.parentNode.insertBefore(n, c), c.parentNode.removeChild(c), u.destroy(), l.destroy();
|
|
4426
|
-
}, A = () => h.getDrawingTool(), p = () => f, _ = () => h.isDrawingEnabled(), w = (b, T, Y) => si(b, T, Y), E = (b, T) => zo(b, T),
|
|
4432
|
+
}, A = () => h.getDrawingTool(), p = () => f, _ = () => h.isDrawingEnabled(), w = (b, T, Y) => si(b, T, Y), E = (b, T) => zo(b, T), v = (b) => {
|
|
4427
4433
|
if (!fn(b))
|
|
4428
4434
|
throw `No drawing tool named ${b}`;
|
|
4429
4435
|
h.$set({ toolName: b });
|
|
4430
|
-
}, X = (b) => h.$set({ drawingEnabled: b }),
|
|
4436
|
+
}, X = (b) => h.$set({ drawingEnabled: b }), U = (b) => {
|
|
4431
4437
|
console.warn("Filter not implemented yet");
|
|
4432
4438
|
}, V = (b) => h.$set({ style: b }), Z = (b) => Kt(n, c, b), S = (b) => {
|
|
4433
4439
|
f = b, h.$set({ user: b });
|
|
4434
|
-
},
|
|
4440
|
+
}, L = (b) => (
|
|
4435
4441
|
// @ts-ignore
|
|
4436
4442
|
h.$set({ visible: b })
|
|
4437
4443
|
);
|
|
@@ -4448,12 +4454,12 @@ const Ci = () => {
|
|
|
4448
4454
|
registerDrawingTool: w,
|
|
4449
4455
|
registerShapeEditor: E,
|
|
4450
4456
|
setDrawingEnabled: X,
|
|
4451
|
-
setDrawingTool:
|
|
4452
|
-
setFilter:
|
|
4457
|
+
setDrawingTool: v,
|
|
4458
|
+
setFilter: U,
|
|
4453
4459
|
setStyle: V,
|
|
4454
4460
|
setTheme: Z,
|
|
4455
4461
|
setUser: S,
|
|
4456
|
-
setVisible:
|
|
4462
|
+
setVisible: L,
|
|
4457
4463
|
element: c,
|
|
4458
4464
|
state: i
|
|
4459
4465
|
};
|
|
@@ -4467,7 +4473,7 @@ export {
|
|
|
4467
4473
|
Go as RectangleEditor,
|
|
4468
4474
|
On as RectangleUtil,
|
|
4469
4475
|
$o as RubberbandRectangle,
|
|
4470
|
-
|
|
4476
|
+
ki as SVGAnnotationLayer,
|
|
4471
4477
|
F as ShapeType,
|
|
4472
4478
|
Qo as ToolMount,
|
|
4473
4479
|
nn as UserSelectAction,
|
|
@@ -4481,7 +4487,7 @@ export {
|
|
|
4481
4487
|
Ji as createImageAnnotator,
|
|
4482
4488
|
Xi as createImageAnnotatorState,
|
|
4483
4489
|
yi as createSVGTransform,
|
|
4484
|
-
|
|
4490
|
+
Ri as createSvelteImageAnnotatorState,
|
|
4485
4491
|
Ki as defaultColorProvider,
|
|
4486
4492
|
Ni as detectTheme,
|
|
4487
4493
|
st as distance,
|
|
@@ -4491,19 +4497,19 @@ export {
|
|
|
4491
4497
|
un as getSVGPoint,
|
|
4492
4498
|
fn as getTool,
|
|
4493
4499
|
Gi as initKeyboardCommands,
|
|
4494
|
-
|
|
4500
|
+
vn as intersects,
|
|
4495
4501
|
Je as isImageAnnotation,
|
|
4496
4502
|
Fe as isImageAnnotationTarget,
|
|
4497
4503
|
Wt as isMac,
|
|
4498
4504
|
Yo as isTouch,
|
|
4499
4505
|
cn as listDrawingTools,
|
|
4500
4506
|
Dn as parseFragmentSelector,
|
|
4501
|
-
|
|
4507
|
+
Un as parseSVGSelector,
|
|
4502
4508
|
To as parseW3CImageAnnotation,
|
|
4503
4509
|
zo as registerEditor,
|
|
4504
4510
|
pt as registerShapeUtil,
|
|
4505
4511
|
si as registerTool,
|
|
4506
|
-
|
|
4512
|
+
Ui as sampleBrightness,
|
|
4507
4513
|
Yn as serializeFragmentSelector,
|
|
4508
4514
|
Nn as serializeSVGSelector,
|
|
4509
4515
|
Mo as serializeW3CImageAnnotation,
|