@annotorious/annotorious 3.1.3 → 3.1.5
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 +205 -200
- package/dist/annotorious.es.js.map +1 -1
- package/dist/annotorious.js +1 -1
- package/dist/annotorious.js.map +1 -1
- package/package.json +5 -5
- package/src/annotation/SVGAnnotationLayer.svelte +1 -1
- package/src/annotation/tools/polygon/RubberbandPolygon.svelte +9 -8
package/dist/annotorious.es.js
CHANGED
|
@@ -161,14 +161,14 @@ 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 Le = [];
|
|
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
|
+
Le.push(e);
|
|
172
172
|
}
|
|
173
173
|
const $e = /* @__PURE__ */ new Set();
|
|
174
174
|
let Ee = 0;
|
|
@@ -186,11 +186,11 @@ function $t() {
|
|
|
186
186
|
throw Me.length = 0, Ee = 0, t;
|
|
187
187
|
}
|
|
188
188
|
for (Re(null), Me.length = 0, Ee = 0; We.length; ) We.pop()();
|
|
189
|
-
for (let t = 0; t <
|
|
190
|
-
const n =
|
|
189
|
+
for (let t = 0; t < Le.length; t += 1) {
|
|
190
|
+
const n = Le[t];
|
|
191
191
|
$e.has(n) || ($e.add(n), n());
|
|
192
192
|
}
|
|
193
|
-
|
|
193
|
+
Le.length = 0;
|
|
194
194
|
} while (Me.length);
|
|
195
195
|
for (; Et.length; )
|
|
196
196
|
Et.pop()();
|
|
@@ -205,7 +205,7 @@ function Tn(e) {
|
|
|
205
205
|
}
|
|
206
206
|
function Mn(e) {
|
|
207
207
|
const t = [], n = [];
|
|
208
|
-
|
|
208
|
+
Le.forEach((o) => e.indexOf(o) === -1 ? t.push(o) : n.push(o)), n.forEach((o) => o()), Le = 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 ke(e) {
|
|
235
235
|
return (e == null ? void 0 : e.length) !== void 0 ? e : Array.from(e);
|
|
236
236
|
}
|
|
237
237
|
function ne(e) {
|
|
@@ -248,7 +248,7 @@ 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 vn(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]) {
|
|
@@ -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 && vn(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);
|
|
@@ -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 Ln = "4";
|
|
340
|
+
typeof window < "u" && (window.__svelte || (window.__svelte = { v: /* @__PURE__ */ new Set() })).v.add(Ln);
|
|
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), kn = (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);
|
|
@@ -651,11 +651,11 @@ function Jn() {
|
|
|
651
651
|
}
|
|
652
652
|
return nt(qn);
|
|
653
653
|
}
|
|
654
|
-
const Qn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto),
|
|
654
|
+
const Qn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), vt = { randomUUID: Qn };
|
|
655
655
|
function on(e, t, n) {
|
|
656
656
|
var o;
|
|
657
|
-
if (
|
|
658
|
-
return
|
|
657
|
+
if (vt.randomUUID && !e)
|
|
658
|
+
return vt.randomUUID();
|
|
659
659
|
e = e || {};
|
|
660
660
|
const i = e.random ?? ((o = e.rng) == null ? void 0 : o.call(e)) ?? Jn();
|
|
661
661
|
if (i.length < 16)
|
|
@@ -755,55 +755,55 @@ const to = (e, t) => {
|
|
|
755
755
|
}
|
|
756
756
|
};
|
|
757
757
|
}, oo = (e) => e.id !== void 0, io = () => {
|
|
758
|
-
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = [], o = (S,
|
|
759
|
-
n.push({ onChange: S, options:
|
|
758
|
+
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = [], o = (S, v = {}) => {
|
|
759
|
+
n.push({ onChange: S, options: v });
|
|
760
760
|
}, i = (S) => {
|
|
761
|
-
const
|
|
762
|
-
|
|
763
|
-
}, s = (S,
|
|
761
|
+
const v = n.findIndex((b) => b.onChange == S);
|
|
762
|
+
v > -1 && n.splice(v, 1);
|
|
763
|
+
}, s = (S, v) => {
|
|
764
764
|
const b = {
|
|
765
765
|
origin: S,
|
|
766
766
|
changes: {
|
|
767
|
-
created:
|
|
768
|
-
updated:
|
|
769
|
-
deleted:
|
|
767
|
+
created: v.created || [],
|
|
768
|
+
updated: v.updated || [],
|
|
769
|
+
deleted: v.deleted || []
|
|
770
770
|
},
|
|
771
771
|
state: [...e.values()]
|
|
772
772
|
};
|
|
773
773
|
n.forEach((T) => {
|
|
774
774
|
to(T, b) && T.onChange(b);
|
|
775
775
|
});
|
|
776
|
-
}, r = (S,
|
|
776
|
+
}, r = (S, v = G.LOCAL) => {
|
|
777
777
|
if (S.id && e.get(S.id))
|
|
778
778
|
throw Error(`Cannot add annotation ${S.id} - exists already`);
|
|
779
779
|
{
|
|
780
780
|
const b = it(S);
|
|
781
|
-
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(v, { created: [b] });
|
|
782
782
|
}
|
|
783
|
-
}, l = (S,
|
|
784
|
-
const b = it(typeof S == "string" ?
|
|
783
|
+
}, l = (S, v) => {
|
|
784
|
+
const b = it(typeof S == "string" ? v : S), T = typeof S == "string" ? S : S.id, Y = T && e.get(T);
|
|
785
785
|
if (Y) {
|
|
786
786
|
const D = sn(Y, b);
|
|
787
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;
|
|
788
788
|
} else
|
|
789
789
|
console.warn(`Cannot update annotation ${T} - does not exist`);
|
|
790
|
-
}, a = (S,
|
|
791
|
-
const T = oo(
|
|
790
|
+
}, a = (S, v = G.LOCAL, b = G.LOCAL) => {
|
|
791
|
+
const T = oo(v) ? b : v, Y = l(S, v);
|
|
792
792
|
Y && s(T, { updated: [Y] });
|
|
793
|
-
}, c = (S,
|
|
793
|
+
}, c = (S, v = G.LOCAL) => {
|
|
794
794
|
const b = S.reduce((T, Y) => {
|
|
795
795
|
const D = l(Y);
|
|
796
796
|
return D ? [...T, D] : T;
|
|
797
797
|
}, []);
|
|
798
|
-
b.length > 0 && s(
|
|
799
|
-
}, u = (S,
|
|
798
|
+
b.length > 0 && s(v, { updated: b });
|
|
799
|
+
}, u = (S, v = G.LOCAL) => {
|
|
800
800
|
const b = e.get(S.annotation);
|
|
801
801
|
if (b) {
|
|
802
802
|
const T = {
|
|
803
803
|
...b,
|
|
804
804
|
bodies: [...b.bodies, S]
|
|
805
805
|
};
|
|
806
|
-
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(v, { updated: [{
|
|
807
807
|
oldValue: b,
|
|
808
808
|
newValue: T,
|
|
809
809
|
bodiesCreated: [S]
|
|
@@ -811,11 +811,11 @@ const to = (e, t) => {
|
|
|
811
811
|
} else
|
|
812
812
|
console.warn(`Attempt to add body to missing annotation: ${S.annotation}`);
|
|
813
813
|
}, f = () => [...e.values()], h = (S = G.LOCAL) => {
|
|
814
|
-
const
|
|
815
|
-
e.clear(), t.clear(), s(S, { deleted:
|
|
816
|
-
}, y = (S,
|
|
814
|
+
const v = [...e.values()];
|
|
815
|
+
e.clear(), t.clear(), s(S, { deleted: v });
|
|
816
|
+
}, y = (S, v = !0, b = G.LOCAL) => {
|
|
817
817
|
const T = S.map(it);
|
|
818
|
-
if (
|
|
818
|
+
if (v) {
|
|
819
819
|
const Y = [...e.values()];
|
|
820
820
|
e.clear(), t.clear(), T.forEach((D) => {
|
|
821
821
|
e.set(D.id, D), D.bodies.forEach((H) => t.set(H.id, D.id));
|
|
@@ -832,31 +832,31 @@ const to = (e, t) => {
|
|
|
832
832
|
}), s(b, { created: T });
|
|
833
833
|
}
|
|
834
834
|
}, g = (S) => {
|
|
835
|
-
const
|
|
835
|
+
const v = typeof S == "string" ? S : S.id, b = e.get(v);
|
|
836
836
|
if (b)
|
|
837
|
-
return e.delete(
|
|
838
|
-
console.warn(`Attempt to delete missing annotation: ${
|
|
839
|
-
}, m = (S,
|
|
837
|
+
return e.delete(v), b.bodies.forEach((T) => t.delete(T.id)), b;
|
|
838
|
+
console.warn(`Attempt to delete missing annotation: ${v}`);
|
|
839
|
+
}, m = (S, v = G.LOCAL) => {
|
|
840
840
|
const b = g(S);
|
|
841
|
-
b && s(
|
|
842
|
-
}, A = (S,
|
|
841
|
+
b && s(v, { deleted: [b] });
|
|
842
|
+
}, A = (S, v = G.LOCAL) => {
|
|
843
843
|
const b = S.reduce((T, Y) => {
|
|
844
844
|
const D = g(Y);
|
|
845
845
|
return D ? [...T, D] : T;
|
|
846
846
|
}, []);
|
|
847
|
-
b.length > 0 && s(
|
|
847
|
+
b.length > 0 && s(v, { deleted: b });
|
|
848
848
|
}, p = (S) => {
|
|
849
|
-
const
|
|
850
|
-
if (
|
|
851
|
-
const b =
|
|
849
|
+
const v = e.get(S.annotation);
|
|
850
|
+
if (v) {
|
|
851
|
+
const b = v.bodies.find((T) => T.id === S.id);
|
|
852
852
|
if (b) {
|
|
853
853
|
t.delete(b.id);
|
|
854
854
|
const T = {
|
|
855
|
-
...
|
|
856
|
-
bodies:
|
|
855
|
+
...v,
|
|
856
|
+
bodies: v.bodies.filter((Y) => Y.id !== S.id)
|
|
857
857
|
};
|
|
858
|
-
return e.set(
|
|
859
|
-
oldValue:
|
|
858
|
+
return e.set(v.id, T), {
|
|
859
|
+
oldValue: v,
|
|
860
860
|
newValue: T,
|
|
861
861
|
bodiesDeleted: [b]
|
|
862
862
|
};
|
|
@@ -864,61 +864,61 @@ const to = (e, t) => {
|
|
|
864
864
|
console.warn(`Attempt to delete missing body ${S.id} from annotation ${S.annotation}`);
|
|
865
865
|
} else
|
|
866
866
|
console.warn(`Attempt to delete body from missing annotation ${S.annotation}`);
|
|
867
|
-
}, _ = (S,
|
|
867
|
+
}, _ = (S, v = G.LOCAL) => {
|
|
868
868
|
const b = p(S);
|
|
869
|
-
b && s(
|
|
870
|
-
}, w = (S,
|
|
869
|
+
b && s(v, { updated: [b] });
|
|
870
|
+
}, w = (S, v = G.LOCAL) => {
|
|
871
871
|
const b = S.map((T) => p(T)).filter(Boolean);
|
|
872
|
-
b.length > 0 && s(
|
|
872
|
+
b.length > 0 && s(v, { updated: b });
|
|
873
873
|
}, E = (S) => {
|
|
874
|
-
const
|
|
875
|
-
return
|
|
876
|
-
},
|
|
877
|
-
const
|
|
878
|
-
if (
|
|
879
|
-
const b = E(
|
|
874
|
+
const v = e.get(S);
|
|
875
|
+
return v ? { ...v } : void 0;
|
|
876
|
+
}, k = (S) => {
|
|
877
|
+
const v = t.get(S);
|
|
878
|
+
if (v) {
|
|
879
|
+
const b = E(v).bodies.find((T) => T.id === S);
|
|
880
880
|
if (b)
|
|
881
881
|
return b;
|
|
882
882
|
console.error(`Store integrity error: body ${S} in index, but not in annotation`);
|
|
883
883
|
} else
|
|
884
884
|
console.warn(`Attempt to retrieve missing body: ${S}`);
|
|
885
|
-
}, X = (S,
|
|
886
|
-
if (S.annotation !==
|
|
885
|
+
}, X = (S, v) => {
|
|
886
|
+
if (S.annotation !== v.annotation)
|
|
887
887
|
throw "Annotation integrity violation: annotation ID must be the same when updating bodies";
|
|
888
888
|
const b = e.get(S.annotation);
|
|
889
889
|
if (b) {
|
|
890
890
|
const T = b.bodies.find((D) => D.id === S.id), Y = {
|
|
891
891
|
...b,
|
|
892
|
-
bodies: b.bodies.map((D) => D.id === T.id ?
|
|
892
|
+
bodies: b.bodies.map((D) => D.id === T.id ? v : D)
|
|
893
893
|
};
|
|
894
|
-
return e.set(b.id, Y), T.id !==
|
|
894
|
+
return e.set(b.id, Y), T.id !== v.id && (t.delete(T.id), t.set(v.id, Y.id)), {
|
|
895
895
|
oldValue: b,
|
|
896
896
|
newValue: Y,
|
|
897
|
-
bodiesUpdated: [{ oldBody: T, newBody:
|
|
897
|
+
bodiesUpdated: [{ oldBody: T, newBody: v }]
|
|
898
898
|
};
|
|
899
899
|
} else
|
|
900
900
|
console.warn(`Attempt to add body to missing annotation ${S.annotation}`);
|
|
901
|
-
}, U = (S,
|
|
902
|
-
const T = X(S,
|
|
901
|
+
}, U = (S, v, b = G.LOCAL) => {
|
|
902
|
+
const T = X(S, v);
|
|
903
903
|
T && s(b, { updated: [T] });
|
|
904
|
-
}, V = (S,
|
|
904
|
+
}, V = (S, v = G.LOCAL) => {
|
|
905
905
|
const b = S.map((T) => X({ id: T.id, annotation: T.annotation }, T)).filter(Boolean);
|
|
906
|
-
s(
|
|
906
|
+
s(v, { updated: b });
|
|
907
907
|
}, Z = (S) => {
|
|
908
|
-
const
|
|
909
|
-
if (
|
|
908
|
+
const v = e.get(S.annotation);
|
|
909
|
+
if (v) {
|
|
910
910
|
const b = {
|
|
911
|
-
...
|
|
911
|
+
...v,
|
|
912
912
|
target: {
|
|
913
|
-
...
|
|
913
|
+
...v.target,
|
|
914
914
|
...S
|
|
915
915
|
}
|
|
916
916
|
};
|
|
917
|
-
return e.set(
|
|
918
|
-
oldValue:
|
|
917
|
+
return e.set(v.id, b), {
|
|
918
|
+
oldValue: v,
|
|
919
919
|
newValue: b,
|
|
920
920
|
targetUpdated: {
|
|
921
|
-
oldTarget:
|
|
921
|
+
oldTarget: v.target,
|
|
922
922
|
newTarget: S
|
|
923
923
|
}
|
|
924
924
|
};
|
|
@@ -934,22 +934,22 @@ const to = (e, t) => {
|
|
|
934
934
|
bulkDeleteBodies: w,
|
|
935
935
|
bulkUpdateAnnotation: c,
|
|
936
936
|
bulkUpdateBodies: V,
|
|
937
|
-
bulkUpdateTargets: (S,
|
|
937
|
+
bulkUpdateTargets: (S, v = G.LOCAL) => {
|
|
938
938
|
const b = S.map((T) => Z(T)).filter(Boolean);
|
|
939
|
-
b.length > 0 && s(
|
|
939
|
+
b.length > 0 && s(v, { updated: b });
|
|
940
940
|
},
|
|
941
941
|
clear: h,
|
|
942
942
|
deleteAnnotation: m,
|
|
943
943
|
deleteBody: _,
|
|
944
944
|
getAnnotation: E,
|
|
945
|
-
getBody:
|
|
945
|
+
getBody: k,
|
|
946
946
|
observe: o,
|
|
947
947
|
unobserve: i,
|
|
948
948
|
updateAnnotation: a,
|
|
949
949
|
updateBody: U,
|
|
950
|
-
updateTarget: (S,
|
|
950
|
+
updateTarget: (S, v = G.LOCAL) => {
|
|
951
951
|
const b = Z(S);
|
|
952
|
-
b && s(
|
|
952
|
+
b && s(v, { updated: [b] });
|
|
953
953
|
}
|
|
954
954
|
};
|
|
955
955
|
}, so = (e) => ({
|
|
@@ -1033,8 +1033,8 @@ const lo = 250, ao = (e, t) => {
|
|
|
1033
1033
|
a.has(p) && setTimeout(() => {
|
|
1034
1034
|
a.get(p).forEach((E) => {
|
|
1035
1035
|
if (n) {
|
|
1036
|
-
const
|
|
1037
|
-
E(
|
|
1036
|
+
const k = Array.isArray(_) ? _.map((U) => n.serialize(U)) : n.serialize(_), X = w ? w instanceof PointerEvent ? w : n.serialize(w) : void 0;
|
|
1037
|
+
E(k, X);
|
|
1038
1038
|
} else
|
|
1039
1039
|
E(_, w);
|
|
1040
1040
|
});
|
|
@@ -1042,9 +1042,9 @@ const lo = 250, ao = (e, t) => {
|
|
|
1042
1042
|
}, m = () => {
|
|
1043
1043
|
const { selected: p } = s, _ = (p || []).map(({ id: w }) => r.getAnnotation(w));
|
|
1044
1044
|
_.forEach((w) => {
|
|
1045
|
-
const E = c.find((
|
|
1045
|
+
const E = c.find((k) => k.id === w.id);
|
|
1046
1046
|
(!E || !_e(E, w)) && g("updateAnnotation", w, E);
|
|
1047
|
-
}), c = c.map((w) => _.find(({ id:
|
|
1047
|
+
}), c = c.map((w) => _.find(({ id: k }) => k === w.id) || w);
|
|
1048
1048
|
};
|
|
1049
1049
|
s.subscribe(({ selected: p }) => {
|
|
1050
1050
|
if (!(c.length === 0 && p.length === 0)) {
|
|
@@ -1058,8 +1058,8 @@ const lo = 250, ao = (e, t) => {
|
|
|
1058
1058
|
else {
|
|
1059
1059
|
const _ = new Set(c.map((E) => E.id)), w = new Set(p.map(({ id: E }) => E));
|
|
1060
1060
|
c.filter((E) => !w.has(E.id)).forEach((E) => {
|
|
1061
|
-
const
|
|
1062
|
-
|
|
1061
|
+
const k = r.getAnnotation(E.id);
|
|
1062
|
+
k && !_e(k, E) && g("updateAnnotation", k, E);
|
|
1063
1063
|
}), c = [
|
|
1064
1064
|
// Remove annotations that were deselected
|
|
1065
1065
|
...c.filter((E) => w.has(E.id)),
|
|
@@ -1078,9 +1078,9 @@ const lo = 250, ao = (e, t) => {
|
|
|
1078
1078
|
...E.bodiesCreated || [],
|
|
1079
1079
|
...E.bodiesDeleted || [],
|
|
1080
1080
|
...E.bodiesUpdated || []
|
|
1081
|
-
].length > 0).forEach(({ oldValue: E, newValue:
|
|
1081
|
+
].length > 0).forEach(({ oldValue: E, newValue: k }) => {
|
|
1082
1082
|
const X = c.find((U) => U.id === E.id) || E;
|
|
1083
|
-
c = c.map((U) => U.id === E.id ?
|
|
1083
|
+
c = c.map((U) => U.id === E.id ? k : U), g("updateAnnotation", k, X);
|
|
1084
1084
|
});
|
|
1085
1085
|
}, { origin: G.LOCAL }), r.observe((p) => {
|
|
1086
1086
|
if (c) {
|
|
@@ -1130,8 +1130,8 @@ const lo = 250, ao = (e, t) => {
|
|
|
1130
1130
|
}
|
|
1131
1131
|
}, y = (p, _ = !0) => {
|
|
1132
1132
|
if (n) {
|
|
1133
|
-
const w = n.parseAll || uo(n), { parsed: E, failed:
|
|
1134
|
-
|
|
1133
|
+
const w = n.parseAll || uo(n), { parsed: E, failed: k } = w(p);
|
|
1134
|
+
k.length > 0 && console.warn(`Discarded ${k.length} invalid annotations`, k), o.bulkAddAnnotation(E, _, G.REMOTE);
|
|
1135
1135
|
} else
|
|
1136
1136
|
o.bulkAddAnnotation(p.map(ot), _, G.REMOTE);
|
|
1137
1137
|
}, g = (p, _) => {
|
|
@@ -1308,11 +1308,11 @@ const Wi = (e, t = { strict: !0, invertY: !1 }) => ({ parse: (i) => To(i, t), se
|
|
|
1308
1308
|
};
|
|
1309
1309
|
return delete u.bodies, "annotation" in u.target && delete u.target.annotation, u;
|
|
1310
1310
|
};
|
|
1311
|
-
function
|
|
1311
|
+
function Lt(e, t, n) {
|
|
1312
1312
|
const o = e.slice();
|
|
1313
1313
|
return o[10] = t[n], o[12] = n, o;
|
|
1314
1314
|
}
|
|
1315
|
-
function
|
|
1315
|
+
function kt(e) {
|
|
1316
1316
|
let t, n;
|
|
1317
1317
|
return t = new Pe({
|
|
1318
1318
|
props: {
|
|
@@ -1365,13 +1365,13 @@ function vt(e) {
|
|
|
1365
1365
|
}
|
|
1366
1366
|
};
|
|
1367
1367
|
}
|
|
1368
|
-
function
|
|
1369
|
-
let t, n, o, i, s, r, l, a, c, u, f, h =
|
|
1368
|
+
function vo(e) {
|
|
1369
|
+
let t, n, o, i, s, r, l, a, c, u, f, h = ke(
|
|
1370
1370
|
/*geom*/
|
|
1371
1371
|
e[4].points
|
|
1372
1372
|
), y = [];
|
|
1373
1373
|
for (let m = 0; m < h.length; m += 1)
|
|
1374
|
-
y[m] =
|
|
1374
|
+
y[m] = kt(Lt(e, h, m));
|
|
1375
1375
|
const g = (m) => P(y[m], 1, 1, () => {
|
|
1376
1376
|
y[m] = null;
|
|
1377
1377
|
});
|
|
@@ -1424,14 +1424,14 @@ function Lo(e) {
|
|
|
1424
1424
|
16 && r !== (r = /*geom*/
|
|
1425
1425
|
e[4].points.map(Bt).join(" "))) && d(s, "points", r), A & /*geom, viewportScale, grab*/
|
|
1426
1426
|
536) {
|
|
1427
|
-
h =
|
|
1427
|
+
h = ke(
|
|
1428
1428
|
/*geom*/
|
|
1429
1429
|
e[4].points
|
|
1430
1430
|
);
|
|
1431
1431
|
let p;
|
|
1432
1432
|
for (p = 0; p < h.length; p += 1) {
|
|
1433
|
-
const _ =
|
|
1434
|
-
y[p] ? (y[p].p(_, A), O(y[p], 1)) : (y[p] =
|
|
1433
|
+
const _ = Lt(e, h, p);
|
|
1434
|
+
y[p] ? (y[p].p(_, A), O(y[p], 1)) : (y[p] = kt(_), y[p].c(), O(y[p], 1), y[p].m(a.parentNode, a));
|
|
1435
1435
|
}
|
|
1436
1436
|
for (re(), p = h.length; p < y.length; p += 1)
|
|
1437
1437
|
g(p);
|
|
@@ -1456,7 +1456,7 @@ function Lo(e) {
|
|
|
1456
1456
|
}
|
|
1457
1457
|
};
|
|
1458
1458
|
}
|
|
1459
|
-
function
|
|
1459
|
+
function Lo(e) {
|
|
1460
1460
|
let t, n;
|
|
1461
1461
|
return t = new an({
|
|
1462
1462
|
props: {
|
|
@@ -1474,7 +1474,7 @@ function ko(e) {
|
|
|
1474
1474
|
),
|
|
1475
1475
|
$$slots: {
|
|
1476
1476
|
default: [
|
|
1477
|
-
|
|
1477
|
+
vo,
|
|
1478
1478
|
({ grab: o }) => ({ 9: o }),
|
|
1479
1479
|
({ grab: o }) => o ? 512 : 0
|
|
1480
1480
|
]
|
|
@@ -1521,7 +1521,7 @@ function ko(e) {
|
|
|
1521
1521
|
};
|
|
1522
1522
|
}
|
|
1523
1523
|
const It = (e) => e.join(","), Bt = (e) => e.join(",");
|
|
1524
|
-
function
|
|
1524
|
+
function ko(e, t, n) {
|
|
1525
1525
|
let o, { shape: i } = t, { computedStyle: s } = t, { transform: r } = t, { viewportScale: l = 1 } = t;
|
|
1526
1526
|
const a = (h, y, g) => {
|
|
1527
1527
|
let m;
|
|
@@ -1558,7 +1558,7 @@ function vo(e, t, n) {
|
|
|
1558
1558
|
}
|
|
1559
1559
|
class Io extends ie {
|
|
1560
1560
|
constructor(t) {
|
|
1561
|
-
super(), oe(this, t,
|
|
1561
|
+
super(), oe(this, t, ko, Lo, Q, {
|
|
1562
1562
|
shape: 0,
|
|
1563
1563
|
computedStyle: 1,
|
|
1564
1564
|
transform: 2,
|
|
@@ -1868,7 +1868,7 @@ class Pe extends ie {
|
|
|
1868
1868
|
}
|
|
1869
1869
|
}
|
|
1870
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,
|
|
1871
|
+
let t, n, o, i, s, r, l, a, c, u, f, h, y, g, m, A, p, _, w, E, k, X, U, V, Z, S, v, b, T, Y, D, H, J, $, pe, ce, Be, fe, Oe, ue, R, De, Ve;
|
|
1872
1872
|
return $ = new Pe({
|
|
1873
1873
|
props: {
|
|
1874
1874
|
class: "a9s-corner-handle-topleft",
|
|
@@ -1978,19 +1978,19 @@ function Uo(e) {
|
|
|
1978
1978
|
e[4].y), d(g, "height", 1), d(g, "width", p = /*geom*/
|
|
1979
1979
|
e[4].w), d(w, "class", "a9s-edge-handle a9s-edge-handle-right"), d(w, "x", E = /*geom*/
|
|
1980
1980
|
e[4].x + /*geom*/
|
|
1981
|
-
e[4].w), d(w, "y",
|
|
1981
|
+
e[4].w), d(w, "y", k = /*geom*/
|
|
1982
1982
|
e[4].y), d(w, "height", X = /*geom*/
|
|
1983
1983
|
e[4].h), d(w, "width", 1), d(V, "class", "a9s-edge-handle a9s-edge-handle-bottom"), d(V, "x", Z = /*geom*/
|
|
1984
1984
|
e[4].x), d(V, "y", S = /*geom*/
|
|
1985
1985
|
e[4].y + /*geom*/
|
|
1986
|
-
e[4].h), d(V, "height", 1), d(V, "width",
|
|
1986
|
+
e[4].h), d(V, "height", 1), d(V, "width", v = /*geom*/
|
|
1987
1987
|
e[4].w), d(T, "class", "a9s-edge-handle a9s-edge-handle-left"), d(T, "x", Y = /*geom*/
|
|
1988
1988
|
e[4].x), d(T, "y", D = /*geom*/
|
|
1989
1989
|
e[4].y), d(T, "height", H = /*geom*/
|
|
1990
1990
|
e[4].h), d(T, "width", 1);
|
|
1991
1991
|
},
|
|
1992
|
-
m(M,
|
|
1993
|
-
B(M, t,
|
|
1992
|
+
m(M, L) {
|
|
1993
|
+
B(M, t, L), B(M, l, L), B(M, a, L), B(M, y, L), B(M, g, L), B(M, _, L), B(M, w, L), B(M, U, L), B(M, V, L), B(M, b, L), B(M, T, L), B(M, J, L), ee($, M, L), B(M, pe, L), ee(ce, M, L), B(M, Be, L), ee(fe, M, L), B(M, Oe, L), ee(ue, M, L), R = !0, De || (Ve = [
|
|
1994
1994
|
z(t, "pointerdown", function() {
|
|
1995
1995
|
K(
|
|
1996
1996
|
/*grab*/
|
|
@@ -2029,92 +2029,92 @@ function Uo(e) {
|
|
|
2029
2029
|
})
|
|
2030
2030
|
], De = !0);
|
|
2031
2031
|
},
|
|
2032
|
-
p(M,
|
|
2033
|
-
e = M, (!R ||
|
|
2032
|
+
p(M, L) {
|
|
2033
|
+
e = M, (!R || L & /*computedStyle*/
|
|
2034
2034
|
2 && n !== (n = /*computedStyle*/
|
|
2035
|
-
e[1] ? "display:none;" : void 0)) && d(t, "style", n), (!R ||
|
|
2035
|
+
e[1] ? "display:none;" : void 0)) && d(t, "style", n), (!R || L & /*geom*/
|
|
2036
2036
|
16 && o !== (o = /*geom*/
|
|
2037
|
-
e[4].x)) && d(t, "x", o), (!R ||
|
|
2037
|
+
e[4].x)) && d(t, "x", o), (!R || L & /*geom*/
|
|
2038
2038
|
16 && i !== (i = /*geom*/
|
|
2039
|
-
e[4].y)) && d(t, "y", i), (!R ||
|
|
2039
|
+
e[4].y)) && d(t, "y", i), (!R || L & /*geom*/
|
|
2040
2040
|
16 && s !== (s = /*geom*/
|
|
2041
|
-
e[4].w)) && d(t, "width", s), (!R ||
|
|
2041
|
+
e[4].w)) && d(t, "width", s), (!R || L & /*geom*/
|
|
2042
2042
|
16 && r !== (r = /*geom*/
|
|
2043
|
-
e[4].h)) && d(t, "height", r), (!R ||
|
|
2043
|
+
e[4].h)) && d(t, "height", r), (!R || L & /*computedStyle*/
|
|
2044
2044
|
2) && d(
|
|
2045
2045
|
a,
|
|
2046
2046
|
"style",
|
|
2047
2047
|
/*computedStyle*/
|
|
2048
2048
|
e[1]
|
|
2049
|
-
), (!R ||
|
|
2049
|
+
), (!R || L & /*geom*/
|
|
2050
2050
|
16 && c !== (c = /*geom*/
|
|
2051
|
-
e[4].x)) && d(a, "x", c), (!R ||
|
|
2051
|
+
e[4].x)) && d(a, "x", c), (!R || L & /*geom*/
|
|
2052
2052
|
16 && u !== (u = /*geom*/
|
|
2053
|
-
e[4].y)) && d(a, "y", u), (!R ||
|
|
2053
|
+
e[4].y)) && d(a, "y", u), (!R || L & /*geom*/
|
|
2054
2054
|
16 && f !== (f = /*geom*/
|
|
2055
|
-
e[4].w)) && d(a, "width", f), (!R ||
|
|
2055
|
+
e[4].w)) && d(a, "width", f), (!R || L & /*geom*/
|
|
2056
2056
|
16 && h !== (h = /*geom*/
|
|
2057
|
-
e[4].h)) && d(a, "height", h), (!R ||
|
|
2057
|
+
e[4].h)) && d(a, "height", h), (!R || L & /*geom*/
|
|
2058
2058
|
16 && m !== (m = /*geom*/
|
|
2059
|
-
e[4].x)) && d(g, "x", m), (!R ||
|
|
2059
|
+
e[4].x)) && d(g, "x", m), (!R || L & /*geom*/
|
|
2060
2060
|
16 && A !== (A = /*geom*/
|
|
2061
|
-
e[4].y)) && d(g, "y", A), (!R ||
|
|
2061
|
+
e[4].y)) && d(g, "y", A), (!R || L & /*geom*/
|
|
2062
2062
|
16 && p !== (p = /*geom*/
|
|
2063
|
-
e[4].w)) && d(g, "width", p), (!R ||
|
|
2063
|
+
e[4].w)) && d(g, "width", p), (!R || L & /*geom*/
|
|
2064
2064
|
16 && E !== (E = /*geom*/
|
|
2065
2065
|
e[4].x + /*geom*/
|
|
2066
|
-
e[4].w)) && d(w, "x", E), (!R ||
|
|
2067
|
-
16 &&
|
|
2068
|
-
e[4].y)) && d(w, "y",
|
|
2066
|
+
e[4].w)) && d(w, "x", E), (!R || L & /*geom*/
|
|
2067
|
+
16 && k !== (k = /*geom*/
|
|
2068
|
+
e[4].y)) && d(w, "y", k), (!R || L & /*geom*/
|
|
2069
2069
|
16 && X !== (X = /*geom*/
|
|
2070
|
-
e[4].h)) && d(w, "height", X), (!R ||
|
|
2070
|
+
e[4].h)) && d(w, "height", X), (!R || L & /*geom*/
|
|
2071
2071
|
16 && Z !== (Z = /*geom*/
|
|
2072
|
-
e[4].x)) && d(V, "x", Z), (!R ||
|
|
2072
|
+
e[4].x)) && d(V, "x", Z), (!R || L & /*geom*/
|
|
2073
2073
|
16 && S !== (S = /*geom*/
|
|
2074
2074
|
e[4].y + /*geom*/
|
|
2075
|
-
e[4].h)) && d(V, "y", S), (!R ||
|
|
2076
|
-
16 &&
|
|
2077
|
-
e[4].w)) && d(V, "width",
|
|
2075
|
+
e[4].h)) && d(V, "y", S), (!R || L & /*geom*/
|
|
2076
|
+
16 && v !== (v = /*geom*/
|
|
2077
|
+
e[4].w)) && d(V, "width", v), (!R || L & /*geom*/
|
|
2078
2078
|
16 && Y !== (Y = /*geom*/
|
|
2079
|
-
e[4].x)) && d(T, "x", Y), (!R ||
|
|
2079
|
+
e[4].x)) && d(T, "x", Y), (!R || L & /*geom*/
|
|
2080
2080
|
16 && D !== (D = /*geom*/
|
|
2081
|
-
e[4].y)) && d(T, "y", D), (!R ||
|
|
2081
|
+
e[4].y)) && d(T, "y", D), (!R || L & /*geom*/
|
|
2082
2082
|
16 && H !== (H = /*geom*/
|
|
2083
2083
|
e[4].h)) && d(T, "height", H);
|
|
2084
2084
|
const N = {};
|
|
2085
|
-
|
|
2085
|
+
L & /*geom*/
|
|
2086
2086
|
16 && (N.x = /*geom*/
|
|
2087
|
-
e[4].x),
|
|
2087
|
+
e[4].x), L & /*geom*/
|
|
2088
2088
|
16 && (N.y = /*geom*/
|
|
2089
|
-
e[4].y),
|
|
2089
|
+
e[4].y), L & /*viewportScale*/
|
|
2090
2090
|
8 && (N.scale = /*viewportScale*/
|
|
2091
2091
|
e[3]), $.$set(N);
|
|
2092
2092
|
const x = {};
|
|
2093
|
-
|
|
2093
|
+
L & /*geom*/
|
|
2094
2094
|
16 && (x.x = /*geom*/
|
|
2095
2095
|
e[4].x + /*geom*/
|
|
2096
|
-
e[4].w),
|
|
2096
|
+
e[4].w), L & /*geom*/
|
|
2097
2097
|
16 && (x.y = /*geom*/
|
|
2098
|
-
e[4].y),
|
|
2098
|
+
e[4].y), L & /*viewportScale*/
|
|
2099
2099
|
8 && (x.scale = /*viewportScale*/
|
|
2100
2100
|
e[3]), ce.$set(x);
|
|
2101
2101
|
const de = {};
|
|
2102
|
-
|
|
2102
|
+
L & /*geom*/
|
|
2103
2103
|
16 && (de.x = /*geom*/
|
|
2104
2104
|
e[4].x + /*geom*/
|
|
2105
|
-
e[4].w),
|
|
2105
|
+
e[4].w), L & /*geom*/
|
|
2106
2106
|
16 && (de.y = /*geom*/
|
|
2107
2107
|
e[4].y + /*geom*/
|
|
2108
|
-
e[4].h),
|
|
2108
|
+
e[4].h), L & /*viewportScale*/
|
|
2109
2109
|
8 && (de.scale = /*viewportScale*/
|
|
2110
2110
|
e[3]), fe.$set(de);
|
|
2111
2111
|
const we = {};
|
|
2112
|
-
|
|
2112
|
+
L & /*geom*/
|
|
2113
2113
|
16 && (we.x = /*geom*/
|
|
2114
|
-
e[4].x),
|
|
2114
|
+
e[4].x), L & /*geom*/
|
|
2115
2115
|
16 && (we.y = /*geom*/
|
|
2116
2116
|
e[4].y + /*geom*/
|
|
2117
|
-
e[4].h),
|
|
2117
|
+
e[4].h), L & /*viewportScale*/
|
|
2118
2118
|
8 && (we.scale = /*viewportScale*/
|
|
2119
2119
|
e[3]), ue.$set(we);
|
|
2120
2120
|
},
|
|
@@ -2198,21 +2198,21 @@ function Vo(e, t, n) {
|
|
|
2198
2198
|
const a = (h, y, g) => {
|
|
2199
2199
|
const m = h.geometry.bounds;
|
|
2200
2200
|
let [A, p] = [m.minX, m.minY], [_, w] = [m.maxX, m.maxY];
|
|
2201
|
-
const [E,
|
|
2201
|
+
const [E, k] = g;
|
|
2202
2202
|
if (y === "SHAPE")
|
|
2203
|
-
A += E, _ += E, p +=
|
|
2203
|
+
A += E, _ += E, p += k, w += k;
|
|
2204
2204
|
else {
|
|
2205
2205
|
switch (y) {
|
|
2206
2206
|
case "TOP":
|
|
2207
2207
|
case "TOP_LEFT":
|
|
2208
2208
|
case "TOP_RIGHT": {
|
|
2209
|
-
p +=
|
|
2209
|
+
p += k;
|
|
2210
2210
|
break;
|
|
2211
2211
|
}
|
|
2212
2212
|
case "BOTTOM":
|
|
2213
2213
|
case "BOTTOM_LEFT":
|
|
2214
2214
|
case "BOTTOM_RIGHT": {
|
|
2215
|
-
w +=
|
|
2215
|
+
w += k;
|
|
2216
2216
|
break;
|
|
2217
2217
|
}
|
|
2218
2218
|
}
|
|
@@ -2770,8 +2770,8 @@ function oi(e, t, n) {
|
|
|
2770
2770
|
const i = Ie();
|
|
2771
2771
|
let { addEventListener: s } = t, { drawingMode: r } = t, { transform: l } = t, { viewportScale: a = 1 } = t, c, u = [], f, h, y = !1;
|
|
2772
2772
|
const g = (w) => {
|
|
2773
|
-
const E = w, { timeStamp:
|
|
2774
|
-
if (c = { timeStamp:
|
|
2773
|
+
const E = w, { timeStamp: k, offsetX: X, offsetY: U } = E;
|
|
2774
|
+
if (c = { timeStamp: k, offsetX: X, offsetY: U }, r === "drag" && u.length === 0) {
|
|
2775
2775
|
const V = l.elementToImage(E.offsetX, E.offsetY);
|
|
2776
2776
|
u.push(V), n(1, f = V);
|
|
2777
2777
|
}
|
|
@@ -2779,8 +2779,8 @@ function oi(e, t, n) {
|
|
|
2779
2779
|
const E = w;
|
|
2780
2780
|
if (h && clearTimeout(h), u.length > 0) {
|
|
2781
2781
|
if (n(1, f = l.elementToImage(E.offsetX, E.offsetY)), u.length > 2) {
|
|
2782
|
-
const
|
|
2783
|
-
n(2, y =
|
|
2782
|
+
const k = st(f, u[0]) * a;
|
|
2783
|
+
n(2, y = k < ti);
|
|
2784
2784
|
}
|
|
2785
2785
|
E.pointerType === "touch" && (h = setTimeout(
|
|
2786
2786
|
() => {
|
|
@@ -2792,8 +2792,8 @@ function oi(e, t, n) {
|
|
|
2792
2792
|
}, A = (w) => {
|
|
2793
2793
|
const E = w;
|
|
2794
2794
|
if (h && clearTimeout(h), r === "click") {
|
|
2795
|
-
const
|
|
2796
|
-
if (
|
|
2795
|
+
const k = E.timeStamp - c.timeStamp, X = st([c.offsetX, c.offsetY], [E.offsetX, E.offsetY]);
|
|
2796
|
+
if (k > 300 || X > 15) return;
|
|
2797
2797
|
if (y)
|
|
2798
2798
|
_();
|
|
2799
2799
|
else if (u.length === 0) {
|
|
@@ -2810,9 +2810,14 @@ function oi(e, t, n) {
|
|
|
2810
2810
|
}
|
|
2811
2811
|
}, p = () => {
|
|
2812
2812
|
if (!f) return;
|
|
2813
|
-
const w =
|
|
2813
|
+
const w = u.slice(0, -1);
|
|
2814
|
+
if (w.length < 3) return;
|
|
2815
|
+
const E = {
|
|
2814
2816
|
type: F.POLYGON,
|
|
2815
|
-
geometry: {
|
|
2817
|
+
geometry: {
|
|
2818
|
+
bounds: qe(u),
|
|
2819
|
+
points: w
|
|
2820
|
+
}
|
|
2816
2821
|
};
|
|
2817
2822
|
ht(E) > 4 && (n(0, u = []), n(1, f = void 0), i("create", E));
|
|
2818
2823
|
}, _ = () => {
|
|
@@ -3197,7 +3202,7 @@ function lt(e) {
|
|
|
3197
3202
|
function Rt(e) {
|
|
3198
3203
|
let t = (
|
|
3199
3204
|
/*annotation*/
|
|
3200
|
-
e[43]
|
|
3205
|
+
e[43]
|
|
3201
3206
|
), n, o, i = Ut(e);
|
|
3202
3207
|
return {
|
|
3203
3208
|
c() {
|
|
@@ -3209,7 +3214,7 @@ function Rt(e) {
|
|
|
3209
3214
|
p(s, r) {
|
|
3210
3215
|
r[0] & /*$store*/
|
|
3211
3216
|
65536 && Q(t, t = /*annotation*/
|
|
3212
|
-
s[43]
|
|
3217
|
+
s[43]) ? (re(), P(i, 1, 1, j), le(), i = Ut(s), i.c(), O(i, 1), i.m(n.parentNode, n)) : i.p(s, r);
|
|
3213
3218
|
},
|
|
3214
3219
|
i(s) {
|
|
3215
3220
|
o || (O(i), o = !0);
|
|
@@ -3506,7 +3511,7 @@ function Si(e) {
|
|
|
3506
3511
|
};
|
|
3507
3512
|
}
|
|
3508
3513
|
function Ti(e) {
|
|
3509
|
-
let t, n, o =
|
|
3514
|
+
let t, n, o = ke(
|
|
3510
3515
|
/*editableAnnotations*/
|
|
3511
3516
|
e[8]
|
|
3512
3517
|
), i = [];
|
|
@@ -3529,7 +3534,7 @@ function Ti(e) {
|
|
|
3529
3534
|
p(r, l) {
|
|
3530
3535
|
if (l[0] & /*editableAnnotations, drawingEl, getEditor, style, transform, $scale, onChangeSelected*/
|
|
3531
3536
|
21107010) {
|
|
3532
|
-
o =
|
|
3537
|
+
o = ke(
|
|
3533
3538
|
/*editableAnnotations*/
|
|
3534
3539
|
r[8]
|
|
3535
3540
|
);
|
|
@@ -3762,7 +3767,7 @@ function Ht(e) {
|
|
|
3762
3767
|
};
|
|
3763
3768
|
}
|
|
3764
3769
|
function Mi(e) {
|
|
3765
|
-
let t, n, o, i, s, r, l =
|
|
3770
|
+
let t, n, o, i, s, r, l = ke(
|
|
3766
3771
|
/*$store*/
|
|
3767
3772
|
e[16].filter(
|
|
3768
3773
|
/*func*/
|
|
@@ -3824,7 +3829,7 @@ function Mi(e) {
|
|
|
3824
3829
|
p(f, h) {
|
|
3825
3830
|
if (e = f, h[0] & /*$store, style, isEditable*/
|
|
3826
3831
|
66050) {
|
|
3827
|
-
l =
|
|
3832
|
+
l = ke(
|
|
3828
3833
|
/*$store*/
|
|
3829
3834
|
e[16].filter(
|
|
3830
3835
|
/*func*/
|
|
@@ -3878,11 +3883,11 @@ function Mi(e) {
|
|
|
3878
3883
|
}
|
|
3879
3884
|
};
|
|
3880
3885
|
}
|
|
3881
|
-
function
|
|
3886
|
+
function vi(e, t, n) {
|
|
3882
3887
|
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);
|
|
3883
3888
|
e.$$.on_destroy.push(() => g());
|
|
3884
|
-
let { drawingEnabled: A } = t, { image: p } = t, { preferredDrawingMode: _ } = t, { state: w } = t, { style: E = void 0 } = t, { toolName:
|
|
3885
|
-
const Z = () => n(5, V += 1), S = () =>
|
|
3889
|
+
let { drawingEnabled: A } = t, { image: p } = t, { preferredDrawingMode: _ } = t, { state: w } = t, { style: E = void 0 } = t, { toolName: k = cn()[0] } = t, { user: X } = t, { visible: U = !0 } = t, V = 0;
|
|
3890
|
+
const Z = () => n(5, V += 1), S = () => k, v = () => A;
|
|
3886
3891
|
let b, T, Y;
|
|
3887
3892
|
Ne(() => m(n(7, Y = Do(p, T))));
|
|
3888
3893
|
const { hover: D, selection: H, store: J } = w;
|
|
@@ -3890,35 +3895,35 @@ function Li(e, t, n) {
|
|
|
3890
3895
|
let $, pe;
|
|
3891
3896
|
const ce = (M) => {
|
|
3892
3897
|
$ && J.unobserve($);
|
|
3893
|
-
const
|
|
3894
|
-
|
|
3898
|
+
const L = M.filter(({ editable: N }) => N).map(({ id: N }) => N);
|
|
3899
|
+
L.length > 0 ? (n(8, pe = L.map((N) => J.getAnnotation(N)).filter((N) => N && Je(N))), $ = (N) => {
|
|
3895
3900
|
const { updated: x } = N.changes;
|
|
3896
3901
|
n(8, pe = x == null ? void 0 : x.map((de) => de.newValue));
|
|
3897
|
-
}, J.observe($, { annotations:
|
|
3902
|
+
}, J.observe($, { annotations: L })) : n(8, pe = void 0);
|
|
3898
3903
|
}, Be = (M) => {
|
|
3899
|
-
const
|
|
3900
|
-
id:
|
|
3904
|
+
const L = tn(), N = {
|
|
3905
|
+
id: L,
|
|
3901
3906
|
bodies: [],
|
|
3902
3907
|
target: {
|
|
3903
|
-
annotation:
|
|
3908
|
+
annotation: L,
|
|
3904
3909
|
selector: M.detail,
|
|
3905
3910
|
creator: X,
|
|
3906
3911
|
created: /* @__PURE__ */ new Date()
|
|
3907
3912
|
}
|
|
3908
3913
|
};
|
|
3909
3914
|
J.addAnnotation(N), H.setSelected(N.id);
|
|
3910
|
-
}, fe = (M) => (
|
|
3915
|
+
}, fe = (M) => (L) => {
|
|
3911
3916
|
var we;
|
|
3912
3917
|
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;
|
|
3913
3918
|
J.updateTarget({
|
|
3914
3919
|
...N,
|
|
3915
|
-
selector:
|
|
3920
|
+
selector: L.detail,
|
|
3916
3921
|
created: de ? N.created : /* @__PURE__ */ new Date(),
|
|
3917
3922
|
updated: de ? /* @__PURE__ */ new Date() : void 0,
|
|
3918
3923
|
updatedBy: de ? X : void 0
|
|
3919
3924
|
});
|
|
3920
3925
|
}, Oe = (M) => {
|
|
3921
|
-
const { x:
|
|
3926
|
+
const { x: L, y: N } = un(M, T), x = J.getAt(L, N);
|
|
3922
3927
|
x ? u !== x.id && D.set(x.id) : D.set(void 0);
|
|
3923
3928
|
}, ue = (M) => jo(M), R = (M) => Je(M);
|
|
3924
3929
|
function De(M) {
|
|
@@ -3932,20 +3937,20 @@ function Li(e, t, n) {
|
|
|
3932
3937
|
});
|
|
3933
3938
|
}
|
|
3934
3939
|
return e.$$set = (M) => {
|
|
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,
|
|
3940
|
+
"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, k = M.toolName), "user" in M && n(28, X = M.user), "visible" in M && n(3, U = M.visible);
|
|
3936
3941
|
}, e.$$.update = () => {
|
|
3937
3942
|
e.$$.dirty[0] & /*toolName*/
|
|
3938
|
-
4 && n(14, { tool: o, opts: i } = fn(
|
|
3943
|
+
4 && n(14, { tool: o, opts: i } = fn(k) || { tool: void 0, opts: void 0 }, o, (n(32, i), n(2, k))), e.$$.dirty[0] & /*preferredDrawingMode*/
|
|
3939
3944
|
67108864 | e.$$.dirty[1] & /*opts*/
|
|
3940
3945
|
2 && n(13, s = (i == null ? void 0 : i.drawingMode) || _), e.$$.dirty[0] & /*svgEl*/
|
|
3941
3946
|
16 && n(12, r = yi(T)), e.$$.dirty[0] & /*svgEl*/
|
|
3942
3947
|
16 && n(11, { onPointerDown: l, onPointerUp: a } = wi(T, J), l, (n(10, a), n(4, T))), e.$$.dirty[1] & /*$selection*/
|
|
3943
|
-
4 && n(9, c = (M) => f.selected.find((
|
|
3948
|
+
4 && n(9, c = (M) => f.selected.find((L) => L.id === M.id && L.editable)), e.$$.dirty[1] & /*$selection*/
|
|
3944
3949
|
4 && ce(f.selected);
|
|
3945
3950
|
}, [
|
|
3946
3951
|
A,
|
|
3947
3952
|
E,
|
|
3948
|
-
|
|
3953
|
+
k,
|
|
3949
3954
|
U,
|
|
3950
3955
|
T,
|
|
3951
3956
|
V,
|
|
@@ -3974,7 +3979,7 @@ function Li(e, t, n) {
|
|
|
3974
3979
|
X,
|
|
3975
3980
|
Z,
|
|
3976
3981
|
S,
|
|
3977
|
-
|
|
3982
|
+
v,
|
|
3978
3983
|
i,
|
|
3979
3984
|
f,
|
|
3980
3985
|
R,
|
|
@@ -3982,12 +3987,12 @@ function Li(e, t, n) {
|
|
|
3982
3987
|
Ve
|
|
3983
3988
|
];
|
|
3984
3989
|
}
|
|
3985
|
-
class
|
|
3990
|
+
class Li extends ie {
|
|
3986
3991
|
constructor(t) {
|
|
3987
3992
|
super(), oe(
|
|
3988
3993
|
this,
|
|
3989
3994
|
t,
|
|
3990
|
-
|
|
3995
|
+
vi,
|
|
3991
3996
|
Mi,
|
|
3992
3997
|
Q,
|
|
3993
3998
|
{
|
|
@@ -4017,7 +4022,7 @@ class ki extends ie {
|
|
|
4017
4022
|
return this.$$.ctx[31];
|
|
4018
4023
|
}
|
|
4019
4024
|
}
|
|
4020
|
-
function dn(e, t, n = 0, o = e.length - 1, i =
|
|
4025
|
+
function dn(e, t, n = 0, o = e.length - 1, i = ki) {
|
|
4021
4026
|
for (; o > n; ) {
|
|
4022
4027
|
if (o - n > 600) {
|
|
4023
4028
|
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));
|
|
@@ -4036,7 +4041,7 @@ function Ye(e, t, n) {
|
|
|
4036
4041
|
const o = e[t];
|
|
4037
4042
|
e[t] = e[n], e[n] = o;
|
|
4038
4043
|
}
|
|
4039
|
-
function
|
|
4044
|
+
function ki(e, t) {
|
|
4040
4045
|
return e < t ? -1 : e > t ? 1 : 0;
|
|
4041
4046
|
}
|
|
4042
4047
|
class Ii {
|
|
@@ -4101,7 +4106,7 @@ class Ii {
|
|
|
4101
4106
|
return t && this._insert(t, this.data.height - 1), this;
|
|
4102
4107
|
}
|
|
4103
4108
|
clear() {
|
|
4104
|
-
return this.data =
|
|
4109
|
+
return this.data = ve([]), this;
|
|
4105
4110
|
}
|
|
4106
4111
|
remove(t, n) {
|
|
4107
4112
|
if (!t) return this;
|
|
@@ -4143,8 +4148,8 @@ class Ii {
|
|
|
4143
4148
|
const s = o - n + 1;
|
|
4144
4149
|
let r = this._maxEntries, l;
|
|
4145
4150
|
if (s <= r)
|
|
4146
|
-
return l =
|
|
4147
|
-
i || (i = Math.ceil(Math.log(s) / Math.log(r)), r = Math.ceil(s / Math.pow(r, i - 1))), l =
|
|
4151
|
+
return l = ve(t.slice(n, o + 1)), Te(l, this.toBBox), l;
|
|
4152
|
+
i || (i = Math.ceil(Math.log(s) / Math.log(r)), r = Math.ceil(s / Math.pow(r, i - 1))), l = ve([]), l.leaf = !1, l.height = i;
|
|
4148
4153
|
const a = Math.ceil(s / r), c = a * Math.ceil(Math.sqrt(r));
|
|
4149
4154
|
Ft(t, n, o, c, this.compareMinX);
|
|
4150
4155
|
for (let u = n; u <= o; u += c) {
|
|
@@ -4178,11 +4183,11 @@ class Ii {
|
|
|
4178
4183
|
_split(t, n) {
|
|
4179
4184
|
const o = t[n], i = o.children.length, s = this._minEntries;
|
|
4180
4185
|
this._chooseSplitAxis(o, s, i);
|
|
4181
|
-
const r = this._chooseSplitIndex(o, s, i), l =
|
|
4186
|
+
const r = this._chooseSplitIndex(o, s, i), l = ve(o.children.splice(r, o.children.length - r));
|
|
4182
4187
|
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);
|
|
4183
4188
|
}
|
|
4184
4189
|
_splitRoot(t, n) {
|
|
4185
|
-
this.data =
|
|
4190
|
+
this.data = ve([t, n]), this.data.height = t.height + 1, this.data.leaf = !1, Te(this.data, this.toBBox);
|
|
4186
4191
|
}
|
|
4187
4192
|
_chooseSplitIndex(t, n, o) {
|
|
4188
4193
|
let i, s = 1 / 0, r = 1 / 0;
|
|
@@ -4231,7 +4236,7 @@ function Te(e, t) {
|
|
|
4231
4236
|
Ce(e, 0, e.children.length, t, e);
|
|
4232
4237
|
}
|
|
4233
4238
|
function Ce(e, t, n, o, i) {
|
|
4234
|
-
i || (i =
|
|
4239
|
+
i || (i = ve(null)), i.minX = 1 / 0, i.minY = 1 / 0, i.maxX = -1 / 0, i.maxY = -1 / 0;
|
|
4235
4240
|
for (let s = t; s < n; s++) {
|
|
4236
4241
|
const r = e.children[s];
|
|
4237
4242
|
Xe(i, e.leaf ? o(r) : r);
|
|
@@ -4266,7 +4271,7 @@ function ct(e, t) {
|
|
|
4266
4271
|
function ze(e, t) {
|
|
4267
4272
|
return t.minX <= e.maxX && t.minY <= e.maxY && t.maxX >= e.minX && t.maxY >= e.minY;
|
|
4268
4273
|
}
|
|
4269
|
-
function
|
|
4274
|
+
function ve(e) {
|
|
4270
4275
|
return {
|
|
4271
4276
|
children: e,
|
|
4272
4277
|
height: 1,
|
|
@@ -4306,7 +4311,7 @@ const Ci = () => {
|
|
|
4306
4311
|
minY: h,
|
|
4307
4312
|
maxX: f,
|
|
4308
4313
|
maxY: h
|
|
4309
|
-
}).map((m) => m.target).filter((m) => m.selector.type === F.RECTANGLE ||
|
|
4314
|
+
}).map((m) => m.target).filter((m) => m.selector.type === F.RECTANGLE || kn(m.selector, f, h));
|
|
4310
4315
|
if (g.length > 0)
|
|
4311
4316
|
return g.sort((m, A) => ht(m.selector) - ht(A.selector)), g[0];
|
|
4312
4317
|
},
|
|
@@ -4412,7 +4417,7 @@ const Ci = () => {
|
|
|
4412
4417
|
const u = Gi(l);
|
|
4413
4418
|
let f = wo();
|
|
4414
4419
|
Kt(n, c, o.theme);
|
|
4415
|
-
const h = new
|
|
4420
|
+
const h = new Li({
|
|
4416
4421
|
target: c,
|
|
4417
4422
|
props: {
|
|
4418
4423
|
drawingEnabled: !!o.drawingEnabled,
|
|
@@ -4429,7 +4434,7 @@ const Ci = () => {
|
|
|
4429
4434
|
});
|
|
4430
4435
|
const y = ho(i, l, o.adapter), g = () => h.cancelDrawing(), m = () => {
|
|
4431
4436
|
h.$destroy(), c.parentNode.insertBefore(n, c), c.parentNode.removeChild(c), u.destroy(), l.destroy();
|
|
4432
|
-
}, A = () => h.getDrawingTool(), p = () => f, _ = () => h.isDrawingEnabled(), w = (b, T, Y) => si(b, T, Y), E = (b, T) => zo(b, T),
|
|
4437
|
+
}, A = () => h.getDrawingTool(), p = () => f, _ = () => h.isDrawingEnabled(), w = (b, T, Y) => si(b, T, Y), E = (b, T) => zo(b, T), k = (b) => {
|
|
4433
4438
|
if (!fn(b))
|
|
4434
4439
|
throw `No drawing tool named ${b}`;
|
|
4435
4440
|
h.$set({ toolName: b });
|
|
@@ -4437,7 +4442,7 @@ const Ci = () => {
|
|
|
4437
4442
|
console.warn("Filter not implemented yet");
|
|
4438
4443
|
}, V = (b) => h.$set({ style: b }), Z = (b) => Kt(n, c, b), S = (b) => {
|
|
4439
4444
|
f = b, h.$set({ user: b });
|
|
4440
|
-
},
|
|
4445
|
+
}, v = (b) => (
|
|
4441
4446
|
// @ts-ignore
|
|
4442
4447
|
h.$set({ visible: b })
|
|
4443
4448
|
);
|
|
@@ -4454,12 +4459,12 @@ const Ci = () => {
|
|
|
4454
4459
|
registerDrawingTool: w,
|
|
4455
4460
|
registerShapeEditor: E,
|
|
4456
4461
|
setDrawingEnabled: X,
|
|
4457
|
-
setDrawingTool:
|
|
4462
|
+
setDrawingTool: k,
|
|
4458
4463
|
setFilter: U,
|
|
4459
4464
|
setStyle: V,
|
|
4460
4465
|
setTheme: Z,
|
|
4461
4466
|
setUser: S,
|
|
4462
|
-
setVisible:
|
|
4467
|
+
setVisible: v,
|
|
4463
4468
|
element: c,
|
|
4464
4469
|
state: i
|
|
4465
4470
|
};
|
|
@@ -4473,7 +4478,7 @@ export {
|
|
|
4473
4478
|
Go as RectangleEditor,
|
|
4474
4479
|
On as RectangleUtil,
|
|
4475
4480
|
$o as RubberbandRectangle,
|
|
4476
|
-
|
|
4481
|
+
Li as SVGAnnotationLayer,
|
|
4477
4482
|
F as ShapeType,
|
|
4478
4483
|
Qo as ToolMount,
|
|
4479
4484
|
nn as UserSelectAction,
|
|
@@ -4497,7 +4502,7 @@ export {
|
|
|
4497
4502
|
un as getSVGPoint,
|
|
4498
4503
|
fn as getTool,
|
|
4499
4504
|
Gi as initKeyboardCommands,
|
|
4500
|
-
|
|
4505
|
+
kn as intersects,
|
|
4501
4506
|
Je as isImageAnnotation,
|
|
4502
4507
|
Fe as isImageAnnotationTarget,
|
|
4503
4508
|
Wt as isMac,
|