@annotorious/annotorious 3.0.20 → 3.0.22
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 +197 -197
- package/dist/annotorious.es.js.map +1 -1
- package/dist/annotorious.js +1 -1
- package/dist/annotorious.js.map +1 -1
- package/package.json +13 -13
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 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;
|
|
@@ -186,11 +186,11 @@ function $t() {
|
|
|
186
186
|
throw Me.length = 0, Ee = 0, t;
|
|
187
187
|
}
|
|
188
188
|
for (Ue(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 < 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()();
|
|
@@ -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,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 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]) {
|
|
@@ -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);
|
|
@@ -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);
|
|
@@ -482,7 +482,7 @@ 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
|
-
if (St.randomUUID && !
|
|
485
|
+
if (St.randomUUID && !e)
|
|
486
486
|
return St.randomUUID();
|
|
487
487
|
e = e || {};
|
|
488
488
|
const o = e.random || (e.rng || jn)();
|
|
@@ -648,10 +648,10 @@ function Jn() {
|
|
|
648
648
|
}
|
|
649
649
|
return nt(qn);
|
|
650
650
|
}
|
|
651
|
-
const Qn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto),
|
|
651
|
+
const Qn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Lt = { randomUUID: Qn };
|
|
652
652
|
function on(e, t, n) {
|
|
653
|
-
if (
|
|
654
|
-
return
|
|
653
|
+
if (Lt.randomUUID && !e)
|
|
654
|
+
return Lt.randomUUID();
|
|
655
655
|
e = e || {};
|
|
656
656
|
const o = e.random || (e.rng || Jn)();
|
|
657
657
|
return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, Wn(o);
|
|
@@ -749,55 +749,55 @@ const to = (e, t) => {
|
|
|
749
749
|
}
|
|
750
750
|
};
|
|
751
751
|
}, 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:
|
|
752
|
+
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = [], o = (S, L = {}) => {
|
|
753
|
+
n.push({ onChange: S, options: L });
|
|
754
754
|
}, i = (S) => {
|
|
755
|
-
const
|
|
756
|
-
|
|
757
|
-
}, s = (S,
|
|
755
|
+
const L = n.findIndex((b) => b.onChange == S);
|
|
756
|
+
L > -1 && n.splice(L, 1);
|
|
757
|
+
}, s = (S, L) => {
|
|
758
758
|
const b = {
|
|
759
759
|
origin: S,
|
|
760
760
|
changes: {
|
|
761
|
-
created:
|
|
762
|
-
updated:
|
|
763
|
-
deleted:
|
|
761
|
+
created: L.created || [],
|
|
762
|
+
updated: L.updated || [],
|
|
763
|
+
deleted: L.deleted || []
|
|
764
764
|
},
|
|
765
765
|
state: [...e.values()]
|
|
766
766
|
};
|
|
767
767
|
n.forEach((T) => {
|
|
768
768
|
to(T, b) && T.onChange(b);
|
|
769
769
|
});
|
|
770
|
-
}, r = (S,
|
|
770
|
+
}, r = (S, L = G.LOCAL) => {
|
|
771
771
|
if (S.id && e.get(S.id))
|
|
772
772
|
throw Error(`Cannot add annotation ${S.id} - exists already`);
|
|
773
773
|
{
|
|
774
774
|
const b = it(S);
|
|
775
|
-
e.set(b.id, b), b.bodies.forEach((T) => t.set(T.id, b.id)), s(
|
|
775
|
+
e.set(b.id, b), b.bodies.forEach((T) => t.set(T.id, b.id)), s(L, { created: [b] });
|
|
776
776
|
}
|
|
777
|
-
}, l = (S,
|
|
778
|
-
const b = it(typeof S == "string" ?
|
|
777
|
+
}, l = (S, L) => {
|
|
778
|
+
const b = it(typeof S == "string" ? L : S), T = typeof S == "string" ? S : S.id, Y = T && e.get(T);
|
|
779
779
|
if (Y) {
|
|
780
780
|
const D = sn(Y, b);
|
|
781
781
|
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
782
|
} else
|
|
783
783
|
console.warn(`Cannot update annotation ${T} - does not exist`);
|
|
784
|
-
}, a = (S,
|
|
785
|
-
const T = oo(
|
|
784
|
+
}, a = (S, L = G.LOCAL, b = G.LOCAL) => {
|
|
785
|
+
const T = oo(L) ? b : L, Y = l(S, L);
|
|
786
786
|
Y && s(T, { updated: [Y] });
|
|
787
|
-
}, c = (S,
|
|
787
|
+
}, c = (S, L = G.LOCAL) => {
|
|
788
788
|
const b = S.reduce((T, Y) => {
|
|
789
789
|
const D = l(Y);
|
|
790
790
|
return D ? [...T, D] : T;
|
|
791
791
|
}, []);
|
|
792
|
-
b.length > 0 && s(
|
|
793
|
-
}, u = (S,
|
|
792
|
+
b.length > 0 && s(L, { updated: b });
|
|
793
|
+
}, u = (S, L = G.LOCAL) => {
|
|
794
794
|
const b = e.get(S.annotation);
|
|
795
795
|
if (b) {
|
|
796
796
|
const T = {
|
|
797
797
|
...b,
|
|
798
798
|
bodies: [...b.bodies, S]
|
|
799
799
|
};
|
|
800
|
-
e.set(b.id, T), t.set(S.id, T.id), s(
|
|
800
|
+
e.set(b.id, T), t.set(S.id, T.id), s(L, { updated: [{
|
|
801
801
|
oldValue: b,
|
|
802
802
|
newValue: T,
|
|
803
803
|
bodiesCreated: [S]
|
|
@@ -805,11 +805,11 @@ const to = (e, t) => {
|
|
|
805
805
|
} else
|
|
806
806
|
console.warn(`Attempt to add body to missing annotation: ${S.annotation}`);
|
|
807
807
|
}, f = () => [...e.values()], h = (S = G.LOCAL) => {
|
|
808
|
-
const
|
|
809
|
-
e.clear(), t.clear(), s(S, { deleted:
|
|
810
|
-
}, y = (S,
|
|
808
|
+
const L = [...e.values()];
|
|
809
|
+
e.clear(), t.clear(), s(S, { deleted: L });
|
|
810
|
+
}, y = (S, L = !0, b = G.LOCAL) => {
|
|
811
811
|
const T = S.map(it);
|
|
812
|
-
if (
|
|
812
|
+
if (L) {
|
|
813
813
|
const Y = [...e.values()];
|
|
814
814
|
e.clear(), t.clear(), T.forEach((D) => {
|
|
815
815
|
e.set(D.id, D), D.bodies.forEach((H) => t.set(H.id, D.id));
|
|
@@ -826,31 +826,31 @@ const to = (e, t) => {
|
|
|
826
826
|
}), s(b, { created: T });
|
|
827
827
|
}
|
|
828
828
|
}, g = (S) => {
|
|
829
|
-
const
|
|
829
|
+
const L = typeof S == "string" ? S : S.id, b = e.get(L);
|
|
830
830
|
if (b)
|
|
831
|
-
return e.delete(
|
|
832
|
-
console.warn(`Attempt to delete missing annotation: ${
|
|
833
|
-
}, m = (S,
|
|
831
|
+
return e.delete(L), b.bodies.forEach((T) => t.delete(T.id)), b;
|
|
832
|
+
console.warn(`Attempt to delete missing annotation: ${L}`);
|
|
833
|
+
}, m = (S, L = G.LOCAL) => {
|
|
834
834
|
const b = g(S);
|
|
835
|
-
b && s(
|
|
836
|
-
}, A = (S,
|
|
835
|
+
b && s(L, { deleted: [b] });
|
|
836
|
+
}, A = (S, L = G.LOCAL) => {
|
|
837
837
|
const b = S.reduce((T, Y) => {
|
|
838
838
|
const D = g(Y);
|
|
839
839
|
return D ? [...T, D] : T;
|
|
840
840
|
}, []);
|
|
841
|
-
b.length > 0 && s(
|
|
841
|
+
b.length > 0 && s(L, { deleted: b });
|
|
842
842
|
}, p = (S) => {
|
|
843
|
-
const
|
|
844
|
-
if (
|
|
845
|
-
const b =
|
|
843
|
+
const L = e.get(S.annotation);
|
|
844
|
+
if (L) {
|
|
845
|
+
const b = L.bodies.find((T) => T.id === S.id);
|
|
846
846
|
if (b) {
|
|
847
847
|
t.delete(b.id);
|
|
848
848
|
const T = {
|
|
849
|
-
...
|
|
850
|
-
bodies:
|
|
849
|
+
...L,
|
|
850
|
+
bodies: L.bodies.filter((Y) => Y.id !== S.id)
|
|
851
851
|
};
|
|
852
|
-
return e.set(
|
|
853
|
-
oldValue:
|
|
852
|
+
return e.set(L.id, T), {
|
|
853
|
+
oldValue: L,
|
|
854
854
|
newValue: T,
|
|
855
855
|
bodiesDeleted: [b]
|
|
856
856
|
};
|
|
@@ -858,61 +858,61 @@ const to = (e, t) => {
|
|
|
858
858
|
console.warn(`Attempt to delete missing body ${S.id} from annotation ${S.annotation}`);
|
|
859
859
|
} else
|
|
860
860
|
console.warn(`Attempt to delete body from missing annotation ${S.annotation}`);
|
|
861
|
-
}, _ = (S,
|
|
861
|
+
}, _ = (S, L = G.LOCAL) => {
|
|
862
862
|
const b = p(S);
|
|
863
|
-
b && s(
|
|
864
|
-
}, w = (S,
|
|
863
|
+
b && s(L, { updated: [b] });
|
|
864
|
+
}, w = (S, L = G.LOCAL) => {
|
|
865
865
|
const b = S.map((T) => p(T)).filter(Boolean);
|
|
866
|
-
b.length > 0 && s(
|
|
866
|
+
b.length > 0 && s(L, { updated: b });
|
|
867
867
|
}, E = (S) => {
|
|
868
|
-
const
|
|
869
|
-
return
|
|
870
|
-
},
|
|
871
|
-
const
|
|
872
|
-
if (
|
|
873
|
-
const b = E(
|
|
868
|
+
const L = e.get(S);
|
|
869
|
+
return L ? { ...L } : void 0;
|
|
870
|
+
}, v = (S) => {
|
|
871
|
+
const L = t.get(S);
|
|
872
|
+
if (L) {
|
|
873
|
+
const b = E(L).bodies.find((T) => T.id === S);
|
|
874
874
|
if (b)
|
|
875
875
|
return b;
|
|
876
876
|
console.error(`Store integrity error: body ${S} in index, but not in annotation`);
|
|
877
877
|
} else
|
|
878
878
|
console.warn(`Attempt to retrieve missing body: ${S}`);
|
|
879
|
-
}, X = (S,
|
|
880
|
-
if (S.annotation !==
|
|
879
|
+
}, X = (S, L) => {
|
|
880
|
+
if (S.annotation !== L.annotation)
|
|
881
881
|
throw "Annotation integrity violation: annotation ID must be the same when updating bodies";
|
|
882
882
|
const b = e.get(S.annotation);
|
|
883
883
|
if (b) {
|
|
884
884
|
const T = b.bodies.find((D) => D.id === S.id), Y = {
|
|
885
885
|
...b,
|
|
886
|
-
bodies: b.bodies.map((D) => D.id === T.id ?
|
|
886
|
+
bodies: b.bodies.map((D) => D.id === T.id ? L : D)
|
|
887
887
|
};
|
|
888
|
-
return e.set(b.id, Y), T.id !==
|
|
888
|
+
return e.set(b.id, Y), T.id !== L.id && (t.delete(T.id), t.set(L.id, Y.id)), {
|
|
889
889
|
oldValue: b,
|
|
890
890
|
newValue: Y,
|
|
891
|
-
bodiesUpdated: [{ oldBody: T, newBody:
|
|
891
|
+
bodiesUpdated: [{ oldBody: T, newBody: L }]
|
|
892
892
|
};
|
|
893
893
|
} else
|
|
894
894
|
console.warn(`Attempt to add body to missing annotation ${S.annotation}`);
|
|
895
|
-
}, R = (S,
|
|
896
|
-
const T = X(S,
|
|
895
|
+
}, R = (S, L, b = G.LOCAL) => {
|
|
896
|
+
const T = X(S, L);
|
|
897
897
|
T && s(b, { updated: [T] });
|
|
898
|
-
}, V = (S,
|
|
898
|
+
}, V = (S, L = G.LOCAL) => {
|
|
899
899
|
const b = S.map((T) => X({ id: T.id, annotation: T.annotation }, T)).filter(Boolean);
|
|
900
|
-
s(
|
|
900
|
+
s(L, { updated: b });
|
|
901
901
|
}, Z = (S) => {
|
|
902
|
-
const
|
|
903
|
-
if (
|
|
902
|
+
const L = e.get(S.annotation);
|
|
903
|
+
if (L) {
|
|
904
904
|
const b = {
|
|
905
|
-
...
|
|
905
|
+
...L,
|
|
906
906
|
target: {
|
|
907
|
-
...
|
|
907
|
+
...L.target,
|
|
908
908
|
...S
|
|
909
909
|
}
|
|
910
910
|
};
|
|
911
|
-
return e.set(
|
|
912
|
-
oldValue:
|
|
911
|
+
return e.set(L.id, b), {
|
|
912
|
+
oldValue: L,
|
|
913
913
|
newValue: b,
|
|
914
914
|
targetUpdated: {
|
|
915
|
-
oldTarget:
|
|
915
|
+
oldTarget: L.target,
|
|
916
916
|
newTarget: S
|
|
917
917
|
}
|
|
918
918
|
};
|
|
@@ -928,22 +928,22 @@ const to = (e, t) => {
|
|
|
928
928
|
bulkDeleteBodies: w,
|
|
929
929
|
bulkUpdateAnnotation: c,
|
|
930
930
|
bulkUpdateBodies: V,
|
|
931
|
-
bulkUpdateTargets: (S,
|
|
931
|
+
bulkUpdateTargets: (S, L = G.LOCAL) => {
|
|
932
932
|
const b = S.map((T) => Z(T)).filter(Boolean);
|
|
933
|
-
b.length > 0 && s(
|
|
933
|
+
b.length > 0 && s(L, { updated: b });
|
|
934
934
|
},
|
|
935
935
|
clear: h,
|
|
936
936
|
deleteAnnotation: m,
|
|
937
937
|
deleteBody: _,
|
|
938
938
|
getAnnotation: E,
|
|
939
|
-
getBody:
|
|
939
|
+
getBody: v,
|
|
940
940
|
observe: o,
|
|
941
941
|
unobserve: i,
|
|
942
942
|
updateAnnotation: a,
|
|
943
943
|
updateBody: R,
|
|
944
|
-
updateTarget: (S,
|
|
944
|
+
updateTarget: (S, L = G.LOCAL) => {
|
|
945
945
|
const b = Z(S);
|
|
946
|
-
b && s(
|
|
946
|
+
b && s(L, { updated: [b] });
|
|
947
947
|
}
|
|
948
948
|
};
|
|
949
949
|
}, so = (e) => ({
|
|
@@ -1027,8 +1027,8 @@ const lo = 250, ao = (e, t) => {
|
|
|
1027
1027
|
a.has(p) && setTimeout(() => {
|
|
1028
1028
|
a.get(p).forEach((E) => {
|
|
1029
1029
|
if (n) {
|
|
1030
|
-
const
|
|
1031
|
-
E(
|
|
1030
|
+
const v = Array.isArray(_) ? _.map((R) => n.serialize(R)) : n.serialize(_), X = w ? w instanceof PointerEvent ? w : n.serialize(w) : void 0;
|
|
1031
|
+
E(v, X);
|
|
1032
1032
|
} else
|
|
1033
1033
|
E(_, w);
|
|
1034
1034
|
});
|
|
@@ -1036,9 +1036,9 @@ const lo = 250, ao = (e, t) => {
|
|
|
1036
1036
|
}, m = () => {
|
|
1037
1037
|
const { selected: p } = s, _ = (p || []).map(({ id: w }) => r.getAnnotation(w));
|
|
1038
1038
|
_.forEach((w) => {
|
|
1039
|
-
const E = c.find((
|
|
1039
|
+
const E = c.find((v) => v.id === w.id);
|
|
1040
1040
|
(!E || !_e(E, w)) && g("updateAnnotation", w, E);
|
|
1041
|
-
}), c = c.map((w) => _.find(({ id:
|
|
1041
|
+
}), c = c.map((w) => _.find(({ id: v }) => v === w.id) || w);
|
|
1042
1042
|
};
|
|
1043
1043
|
s.subscribe(({ selected: p }) => {
|
|
1044
1044
|
if (!(c.length === 0 && p.length === 0)) {
|
|
@@ -1052,8 +1052,8 @@ const lo = 250, ao = (e, t) => {
|
|
|
1052
1052
|
else {
|
|
1053
1053
|
const _ = new Set(c.map((E) => E.id)), w = new Set(p.map(({ id: E }) => E));
|
|
1054
1054
|
c.filter((E) => !w.has(E.id)).forEach((E) => {
|
|
1055
|
-
const
|
|
1056
|
-
|
|
1055
|
+
const v = r.getAnnotation(E.id);
|
|
1056
|
+
v && !_e(v, E) && g("updateAnnotation", v, E);
|
|
1057
1057
|
}), c = [
|
|
1058
1058
|
// Remove annotations that were deselected
|
|
1059
1059
|
...c.filter((E) => w.has(E.id)),
|
|
@@ -1072,9 +1072,9 @@ const lo = 250, ao = (e, t) => {
|
|
|
1072
1072
|
...E.bodiesCreated || [],
|
|
1073
1073
|
...E.bodiesDeleted || [],
|
|
1074
1074
|
...E.bodiesUpdated || []
|
|
1075
|
-
].length > 0).forEach(({ oldValue: E, newValue:
|
|
1075
|
+
].length > 0).forEach(({ oldValue: E, newValue: v }) => {
|
|
1076
1076
|
const X = c.find((R) => R.id === E.id) || E;
|
|
1077
|
-
c = c.map((R) => R.id === E.id ?
|
|
1077
|
+
c = c.map((R) => R.id === E.id ? v : R), g("updateAnnotation", v, X);
|
|
1078
1078
|
});
|
|
1079
1079
|
}, { origin: G.LOCAL }), r.observe((p) => {
|
|
1080
1080
|
if (c) {
|
|
@@ -1124,8 +1124,8 @@ const lo = 250, ao = (e, t) => {
|
|
|
1124
1124
|
}
|
|
1125
1125
|
}, y = (p, _ = !0) => {
|
|
1126
1126
|
if (n) {
|
|
1127
|
-
const w = n.parseAll || uo(n), { parsed: E, failed:
|
|
1128
|
-
|
|
1127
|
+
const w = n.parseAll || uo(n), { parsed: E, failed: v } = w(p);
|
|
1128
|
+
v.length > 0 && console.warn(`Discarded ${v.length} invalid annotations`, v), o.bulkAddAnnotation(E, _, G.REMOTE);
|
|
1129
1129
|
} else
|
|
1130
1130
|
o.bulkAddAnnotation(p.map(ot), _, G.REMOTE);
|
|
1131
1131
|
}, g = (p, _) => {
|
|
@@ -1302,11 +1302,11 @@ const Wi = (e, t = { strict: !0, invertY: !1 }) => ({ parse: (i) => To(i, t), se
|
|
|
1302
1302
|
};
|
|
1303
1303
|
return delete u.bodies, "annotation" in u.target && delete u.target.annotation, u;
|
|
1304
1304
|
};
|
|
1305
|
-
function
|
|
1305
|
+
function kt(e, t, n) {
|
|
1306
1306
|
const o = e.slice();
|
|
1307
1307
|
return o[10] = t[n], o[12] = n, o;
|
|
1308
1308
|
}
|
|
1309
|
-
function
|
|
1309
|
+
function vt(e) {
|
|
1310
1310
|
let t, n;
|
|
1311
1311
|
return t = new Pe({
|
|
1312
1312
|
props: {
|
|
@@ -1359,13 +1359,13 @@ function kt(e) {
|
|
|
1359
1359
|
}
|
|
1360
1360
|
};
|
|
1361
1361
|
}
|
|
1362
|
-
function
|
|
1363
|
-
let t, n, o, i, s, r, l, a, c, u, f, h =
|
|
1362
|
+
function Lo(e) {
|
|
1363
|
+
let t, n, o, i, s, r, l, a, c, u, f, h = ve(
|
|
1364
1364
|
/*geom*/
|
|
1365
1365
|
e[4].points
|
|
1366
1366
|
), y = [];
|
|
1367
1367
|
for (let m = 0; m < h.length; m += 1)
|
|
1368
|
-
y[m] = kt(
|
|
1368
|
+
y[m] = vt(kt(e, h, m));
|
|
1369
1369
|
const g = (m) => P(y[m], 1, 1, () => {
|
|
1370
1370
|
y[m] = null;
|
|
1371
1371
|
});
|
|
@@ -1418,14 +1418,14 @@ function vo(e) {
|
|
|
1418
1418
|
16 && r !== (r = /*geom*/
|
|
1419
1419
|
e[4].points.map(Bt).join(" "))) && d(s, "points", r), A & /*geom, viewportScale, grab*/
|
|
1420
1420
|
536) {
|
|
1421
|
-
h =
|
|
1421
|
+
h = ve(
|
|
1422
1422
|
/*geom*/
|
|
1423
1423
|
e[4].points
|
|
1424
1424
|
);
|
|
1425
1425
|
let p;
|
|
1426
1426
|
for (p = 0; p < h.length; p += 1) {
|
|
1427
|
-
const _ =
|
|
1428
|
-
y[p] ? (y[p].p(_, A), O(y[p], 1)) : (y[p] =
|
|
1427
|
+
const _ = kt(e, h, p);
|
|
1428
|
+
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
1429
|
}
|
|
1430
1430
|
for (re(), p = h.length; p < y.length; p += 1)
|
|
1431
1431
|
g(p);
|
|
@@ -1450,7 +1450,7 @@ function vo(e) {
|
|
|
1450
1450
|
}
|
|
1451
1451
|
};
|
|
1452
1452
|
}
|
|
1453
|
-
function
|
|
1453
|
+
function ko(e) {
|
|
1454
1454
|
let t, n;
|
|
1455
1455
|
return t = new an({
|
|
1456
1456
|
props: {
|
|
@@ -1468,7 +1468,7 @@ function Lo(e) {
|
|
|
1468
1468
|
),
|
|
1469
1469
|
$$slots: {
|
|
1470
1470
|
default: [
|
|
1471
|
-
|
|
1471
|
+
Lo,
|
|
1472
1472
|
({ grab: o }) => ({ 9: o }),
|
|
1473
1473
|
({ grab: o }) => o ? 512 : 0
|
|
1474
1474
|
]
|
|
@@ -1515,7 +1515,7 @@ function Lo(e) {
|
|
|
1515
1515
|
};
|
|
1516
1516
|
}
|
|
1517
1517
|
const It = (e) => e.join(","), Bt = (e) => e.join(",");
|
|
1518
|
-
function
|
|
1518
|
+
function vo(e, t, n) {
|
|
1519
1519
|
let o, { shape: i } = t, { computedStyle: s } = t, { transform: r } = t, { viewportScale: l = 1 } = t;
|
|
1520
1520
|
const a = (h, y, g) => {
|
|
1521
1521
|
let m;
|
|
@@ -1552,7 +1552,7 @@ function ko(e, t, n) {
|
|
|
1552
1552
|
}
|
|
1553
1553
|
class Io extends ie {
|
|
1554
1554
|
constructor(t) {
|
|
1555
|
-
super(), oe(this, t,
|
|
1555
|
+
super(), oe(this, t, vo, ko, Q, {
|
|
1556
1556
|
shape: 0,
|
|
1557
1557
|
computedStyle: 1,
|
|
1558
1558
|
transform: 2,
|
|
@@ -1862,7 +1862,7 @@ class Pe extends ie {
|
|
|
1862
1862
|
}
|
|
1863
1863
|
}
|
|
1864
1864
|
function Ro(e) {
|
|
1865
|
-
let t, n, o, i, s, r, l, a, c, u, f, h, y, g, m, A, p, _, w, E,
|
|
1865
|
+
let t, n, o, i, s, r, l, a, c, u, f, h, y, g, m, A, p, _, w, E, v, X, R, V, Z, S, L, b, T, Y, D, H, J, $, pe, ce, Be, fe, Oe, ue, U, De, Ve;
|
|
1866
1866
|
return $ = new Pe({
|
|
1867
1867
|
props: {
|
|
1868
1868
|
class: "a9s-corner-handle-topleft",
|
|
@@ -1972,19 +1972,19 @@ function Ro(e) {
|
|
|
1972
1972
|
e[4].y), d(g, "height", 1), d(g, "width", p = /*geom*/
|
|
1973
1973
|
e[4].w), d(w, "class", "a9s-edge-handle a9s-edge-handle-right"), d(w, "x", E = /*geom*/
|
|
1974
1974
|
e[4].x + /*geom*/
|
|
1975
|
-
e[4].w), d(w, "y",
|
|
1975
|
+
e[4].w), d(w, "y", v = /*geom*/
|
|
1976
1976
|
e[4].y), d(w, "height", X = /*geom*/
|
|
1977
1977
|
e[4].h), d(w, "width", 1), d(V, "class", "a9s-edge-handle a9s-edge-handle-bottom"), d(V, "x", Z = /*geom*/
|
|
1978
1978
|
e[4].x), d(V, "y", S = /*geom*/
|
|
1979
1979
|
e[4].y + /*geom*/
|
|
1980
|
-
e[4].h), d(V, "height", 1), d(V, "width",
|
|
1980
|
+
e[4].h), d(V, "height", 1), d(V, "width", L = /*geom*/
|
|
1981
1981
|
e[4].w), d(T, "class", "a9s-edge-handle a9s-edge-handle-left"), d(T, "x", Y = /*geom*/
|
|
1982
1982
|
e[4].x), d(T, "y", D = /*geom*/
|
|
1983
1983
|
e[4].y), d(T, "height", H = /*geom*/
|
|
1984
1984
|
e[4].h), d(T, "width", 1);
|
|
1985
1985
|
},
|
|
1986
|
-
m(M,
|
|
1987
|
-
B(M, t,
|
|
1986
|
+
m(M, k) {
|
|
1987
|
+
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, R, 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), U = !0, De || (Ve = [
|
|
1988
1988
|
z(t, "pointerdown", function() {
|
|
1989
1989
|
K(
|
|
1990
1990
|
/*grab*/
|
|
@@ -2023,92 +2023,92 @@ function Ro(e) {
|
|
|
2023
2023
|
})
|
|
2024
2024
|
], De = !0);
|
|
2025
2025
|
},
|
|
2026
|
-
p(M,
|
|
2027
|
-
e = M, (!U ||
|
|
2026
|
+
p(M, k) {
|
|
2027
|
+
e = M, (!U || k & /*computedStyle*/
|
|
2028
2028
|
2 && n !== (n = /*computedStyle*/
|
|
2029
|
-
e[1] ? "display:none;" : void 0)) && d(t, "style", n), (!U ||
|
|
2029
|
+
e[1] ? "display:none;" : void 0)) && d(t, "style", n), (!U || k & /*geom*/
|
|
2030
2030
|
16 && o !== (o = /*geom*/
|
|
2031
|
-
e[4].x)) && d(t, "x", o), (!U ||
|
|
2031
|
+
e[4].x)) && d(t, "x", o), (!U || k & /*geom*/
|
|
2032
2032
|
16 && i !== (i = /*geom*/
|
|
2033
|
-
e[4].y)) && d(t, "y", i), (!U ||
|
|
2033
|
+
e[4].y)) && d(t, "y", i), (!U || k & /*geom*/
|
|
2034
2034
|
16 && s !== (s = /*geom*/
|
|
2035
|
-
e[4].w)) && d(t, "width", s), (!U ||
|
|
2035
|
+
e[4].w)) && d(t, "width", s), (!U || k & /*geom*/
|
|
2036
2036
|
16 && r !== (r = /*geom*/
|
|
2037
|
-
e[4].h)) && d(t, "height", r), (!U ||
|
|
2037
|
+
e[4].h)) && d(t, "height", r), (!U || k & /*computedStyle*/
|
|
2038
2038
|
2) && d(
|
|
2039
2039
|
a,
|
|
2040
2040
|
"style",
|
|
2041
2041
|
/*computedStyle*/
|
|
2042
2042
|
e[1]
|
|
2043
|
-
), (!U ||
|
|
2043
|
+
), (!U || k & /*geom*/
|
|
2044
2044
|
16 && c !== (c = /*geom*/
|
|
2045
|
-
e[4].x)) && d(a, "x", c), (!U ||
|
|
2045
|
+
e[4].x)) && d(a, "x", c), (!U || k & /*geom*/
|
|
2046
2046
|
16 && u !== (u = /*geom*/
|
|
2047
|
-
e[4].y)) && d(a, "y", u), (!U ||
|
|
2047
|
+
e[4].y)) && d(a, "y", u), (!U || k & /*geom*/
|
|
2048
2048
|
16 && f !== (f = /*geom*/
|
|
2049
|
-
e[4].w)) && d(a, "width", f), (!U ||
|
|
2049
|
+
e[4].w)) && d(a, "width", f), (!U || k & /*geom*/
|
|
2050
2050
|
16 && h !== (h = /*geom*/
|
|
2051
|
-
e[4].h)) && d(a, "height", h), (!U ||
|
|
2051
|
+
e[4].h)) && d(a, "height", h), (!U || k & /*geom*/
|
|
2052
2052
|
16 && m !== (m = /*geom*/
|
|
2053
|
-
e[4].x)) && d(g, "x", m), (!U ||
|
|
2053
|
+
e[4].x)) && d(g, "x", m), (!U || k & /*geom*/
|
|
2054
2054
|
16 && A !== (A = /*geom*/
|
|
2055
|
-
e[4].y)) && d(g, "y", A), (!U ||
|
|
2055
|
+
e[4].y)) && d(g, "y", A), (!U || k & /*geom*/
|
|
2056
2056
|
16 && p !== (p = /*geom*/
|
|
2057
|
-
e[4].w)) && d(g, "width", p), (!U ||
|
|
2057
|
+
e[4].w)) && d(g, "width", p), (!U || k & /*geom*/
|
|
2058
2058
|
16 && E !== (E = /*geom*/
|
|
2059
2059
|
e[4].x + /*geom*/
|
|
2060
|
-
e[4].w)) && d(w, "x", E), (!U ||
|
|
2061
|
-
16 &&
|
|
2062
|
-
e[4].y)) && d(w, "y",
|
|
2060
|
+
e[4].w)) && d(w, "x", E), (!U || k & /*geom*/
|
|
2061
|
+
16 && v !== (v = /*geom*/
|
|
2062
|
+
e[4].y)) && d(w, "y", v), (!U || k & /*geom*/
|
|
2063
2063
|
16 && X !== (X = /*geom*/
|
|
2064
|
-
e[4].h)) && d(w, "height", X), (!U ||
|
|
2064
|
+
e[4].h)) && d(w, "height", X), (!U || k & /*geom*/
|
|
2065
2065
|
16 && Z !== (Z = /*geom*/
|
|
2066
|
-
e[4].x)) && d(V, "x", Z), (!U ||
|
|
2066
|
+
e[4].x)) && d(V, "x", Z), (!U || k & /*geom*/
|
|
2067
2067
|
16 && S !== (S = /*geom*/
|
|
2068
2068
|
e[4].y + /*geom*/
|
|
2069
|
-
e[4].h)) && d(V, "y", S), (!U ||
|
|
2070
|
-
16 &&
|
|
2071
|
-
e[4].w)) && d(V, "width",
|
|
2069
|
+
e[4].h)) && d(V, "y", S), (!U || k & /*geom*/
|
|
2070
|
+
16 && L !== (L = /*geom*/
|
|
2071
|
+
e[4].w)) && d(V, "width", L), (!U || k & /*geom*/
|
|
2072
2072
|
16 && Y !== (Y = /*geom*/
|
|
2073
|
-
e[4].x)) && d(T, "x", Y), (!U ||
|
|
2073
|
+
e[4].x)) && d(T, "x", Y), (!U || k & /*geom*/
|
|
2074
2074
|
16 && D !== (D = /*geom*/
|
|
2075
|
-
e[4].y)) && d(T, "y", D), (!U ||
|
|
2075
|
+
e[4].y)) && d(T, "y", D), (!U || k & /*geom*/
|
|
2076
2076
|
16 && H !== (H = /*geom*/
|
|
2077
2077
|
e[4].h)) && d(T, "height", H);
|
|
2078
2078
|
const N = {};
|
|
2079
|
-
|
|
2079
|
+
k & /*geom*/
|
|
2080
2080
|
16 && (N.x = /*geom*/
|
|
2081
|
-
e[4].x),
|
|
2081
|
+
e[4].x), k & /*geom*/
|
|
2082
2082
|
16 && (N.y = /*geom*/
|
|
2083
|
-
e[4].y),
|
|
2083
|
+
e[4].y), k & /*viewportScale*/
|
|
2084
2084
|
8 && (N.scale = /*viewportScale*/
|
|
2085
2085
|
e[3]), $.$set(N);
|
|
2086
2086
|
const x = {};
|
|
2087
|
-
|
|
2087
|
+
k & /*geom*/
|
|
2088
2088
|
16 && (x.x = /*geom*/
|
|
2089
2089
|
e[4].x + /*geom*/
|
|
2090
|
-
e[4].w),
|
|
2090
|
+
e[4].w), k & /*geom*/
|
|
2091
2091
|
16 && (x.y = /*geom*/
|
|
2092
|
-
e[4].y),
|
|
2092
|
+
e[4].y), k & /*viewportScale*/
|
|
2093
2093
|
8 && (x.scale = /*viewportScale*/
|
|
2094
2094
|
e[3]), ce.$set(x);
|
|
2095
2095
|
const de = {};
|
|
2096
|
-
|
|
2096
|
+
k & /*geom*/
|
|
2097
2097
|
16 && (de.x = /*geom*/
|
|
2098
2098
|
e[4].x + /*geom*/
|
|
2099
|
-
e[4].w),
|
|
2099
|
+
e[4].w), k & /*geom*/
|
|
2100
2100
|
16 && (de.y = /*geom*/
|
|
2101
2101
|
e[4].y + /*geom*/
|
|
2102
|
-
e[4].h),
|
|
2102
|
+
e[4].h), k & /*viewportScale*/
|
|
2103
2103
|
8 && (de.scale = /*viewportScale*/
|
|
2104
2104
|
e[3]), fe.$set(de);
|
|
2105
2105
|
const we = {};
|
|
2106
|
-
|
|
2106
|
+
k & /*geom*/
|
|
2107
2107
|
16 && (we.x = /*geom*/
|
|
2108
|
-
e[4].x),
|
|
2108
|
+
e[4].x), k & /*geom*/
|
|
2109
2109
|
16 && (we.y = /*geom*/
|
|
2110
2110
|
e[4].y + /*geom*/
|
|
2111
|
-
e[4].h),
|
|
2111
|
+
e[4].h), k & /*viewportScale*/
|
|
2112
2112
|
8 && (we.scale = /*viewportScale*/
|
|
2113
2113
|
e[3]), ue.$set(we);
|
|
2114
2114
|
},
|
|
@@ -2192,21 +2192,21 @@ function Vo(e, t, n) {
|
|
|
2192
2192
|
const a = (h, y, g) => {
|
|
2193
2193
|
const m = h.geometry.bounds;
|
|
2194
2194
|
let [A, p] = [m.minX, m.minY], [_, w] = [m.maxX, m.maxY];
|
|
2195
|
-
const [E,
|
|
2195
|
+
const [E, v] = g;
|
|
2196
2196
|
if (y === "SHAPE")
|
|
2197
|
-
A += E, _ += E, p +=
|
|
2197
|
+
A += E, _ += E, p += v, w += v;
|
|
2198
2198
|
else {
|
|
2199
2199
|
switch (y) {
|
|
2200
2200
|
case "TOP":
|
|
2201
2201
|
case "TOP_LEFT":
|
|
2202
2202
|
case "TOP_RIGHT": {
|
|
2203
|
-
p +=
|
|
2203
|
+
p += v;
|
|
2204
2204
|
break;
|
|
2205
2205
|
}
|
|
2206
2206
|
case "BOTTOM":
|
|
2207
2207
|
case "BOTTOM_LEFT":
|
|
2208
2208
|
case "BOTTOM_RIGHT": {
|
|
2209
|
-
w +=
|
|
2209
|
+
w += v;
|
|
2210
2210
|
break;
|
|
2211
2211
|
}
|
|
2212
2212
|
}
|
|
@@ -2764,8 +2764,8 @@ function oi(e, t, n) {
|
|
|
2764
2764
|
const i = Ie();
|
|
2765
2765
|
let { addEventListener: s } = t, { drawingMode: r } = t, { transform: l } = t, { viewportScale: a = 1 } = t, c, u = [], f, h, y = !1;
|
|
2766
2766
|
const g = (w) => {
|
|
2767
|
-
const E = w, { timeStamp:
|
|
2768
|
-
if (c = { timeStamp:
|
|
2767
|
+
const E = w, { timeStamp: v, offsetX: X, offsetY: R } = E;
|
|
2768
|
+
if (c = { timeStamp: v, offsetX: X, offsetY: R }, r === "drag" && u.length === 0) {
|
|
2769
2769
|
const V = l.elementToImage(E.offsetX, E.offsetY);
|
|
2770
2770
|
u.push(V), n(1, f = V);
|
|
2771
2771
|
}
|
|
@@ -2773,8 +2773,8 @@ function oi(e, t, n) {
|
|
|
2773
2773
|
const E = w;
|
|
2774
2774
|
if (h && clearTimeout(h), u.length > 0) {
|
|
2775
2775
|
if (n(1, f = l.elementToImage(E.offsetX, E.offsetY)), u.length > 2) {
|
|
2776
|
-
const
|
|
2777
|
-
n(2, y =
|
|
2776
|
+
const v = st(f, u[0]) * a;
|
|
2777
|
+
n(2, y = v < ti);
|
|
2778
2778
|
}
|
|
2779
2779
|
E.pointerType === "touch" && (h = setTimeout(
|
|
2780
2780
|
() => {
|
|
@@ -2786,8 +2786,8 @@ function oi(e, t, n) {
|
|
|
2786
2786
|
}, A = (w) => {
|
|
2787
2787
|
const E = w;
|
|
2788
2788
|
if (h && clearTimeout(h), r === "click") {
|
|
2789
|
-
const
|
|
2790
|
-
if (
|
|
2789
|
+
const v = E.timeStamp - c.timeStamp, X = st([c.offsetX, c.offsetY], [E.offsetX, E.offsetY]);
|
|
2790
|
+
if (v > 300 || X > 15) return;
|
|
2791
2791
|
if (y)
|
|
2792
2792
|
_();
|
|
2793
2793
|
else if (u.length === 0) {
|
|
@@ -3500,7 +3500,7 @@ function Si(e) {
|
|
|
3500
3500
|
};
|
|
3501
3501
|
}
|
|
3502
3502
|
function Ti(e) {
|
|
3503
|
-
let t, n, o =
|
|
3503
|
+
let t, n, o = ve(
|
|
3504
3504
|
/*editableAnnotations*/
|
|
3505
3505
|
e[8]
|
|
3506
3506
|
), i = [];
|
|
@@ -3523,7 +3523,7 @@ function Ti(e) {
|
|
|
3523
3523
|
p(r, l) {
|
|
3524
3524
|
if (l[0] & /*editableAnnotations, drawingEl, getEditor, style, transform, $scale, onChangeSelected*/
|
|
3525
3525
|
21107010) {
|
|
3526
|
-
o =
|
|
3526
|
+
o = ve(
|
|
3527
3527
|
/*editableAnnotations*/
|
|
3528
3528
|
r[8]
|
|
3529
3529
|
);
|
|
@@ -3756,7 +3756,7 @@ function Ht(e) {
|
|
|
3756
3756
|
};
|
|
3757
3757
|
}
|
|
3758
3758
|
function Mi(e) {
|
|
3759
|
-
let t, n, o, i, s, r, l =
|
|
3759
|
+
let t, n, o, i, s, r, l = ve(
|
|
3760
3760
|
/*$store*/
|
|
3761
3761
|
e[16].filter(
|
|
3762
3762
|
/*func*/
|
|
@@ -3818,7 +3818,7 @@ function Mi(e) {
|
|
|
3818
3818
|
p(f, h) {
|
|
3819
3819
|
if (e = f, h[0] & /*$store, style, isEditable*/
|
|
3820
3820
|
66050) {
|
|
3821
|
-
l =
|
|
3821
|
+
l = ve(
|
|
3822
3822
|
/*$store*/
|
|
3823
3823
|
e[16].filter(
|
|
3824
3824
|
/*func*/
|
|
@@ -3872,11 +3872,11 @@ function Mi(e) {
|
|
|
3872
3872
|
}
|
|
3873
3873
|
};
|
|
3874
3874
|
}
|
|
3875
|
-
function
|
|
3875
|
+
function Li(e, t, n) {
|
|
3876
3876
|
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
3877
|
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 = () =>
|
|
3878
|
+
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: R = !0 } = t, V = 0;
|
|
3879
|
+
const Z = () => n(5, V += 1), S = () => v, L = () => A;
|
|
3880
3880
|
let b, T, Y;
|
|
3881
3881
|
Ne(() => m(n(7, Y = Do(p, T))));
|
|
3882
3882
|
const { hover: D, selection: H, store: J } = w;
|
|
@@ -3884,35 +3884,35 @@ function vi(e, t, n) {
|
|
|
3884
3884
|
let $, pe;
|
|
3885
3885
|
const ce = (M) => {
|
|
3886
3886
|
$ && J.unobserve($);
|
|
3887
|
-
const
|
|
3888
|
-
|
|
3887
|
+
const k = M.filter(({ editable: N }) => N).map(({ id: N }) => N);
|
|
3888
|
+
k.length > 0 ? (n(8, pe = k.map((N) => J.getAnnotation(N)).filter((N) => N && Je(N))), $ = (N) => {
|
|
3889
3889
|
const { updated: x } = N.changes;
|
|
3890
3890
|
n(8, pe = x == null ? void 0 : x.map((de) => de.newValue));
|
|
3891
|
-
}, J.observe($, { annotations:
|
|
3891
|
+
}, J.observe($, { annotations: k })) : n(8, pe = void 0);
|
|
3892
3892
|
}, Be = (M) => {
|
|
3893
|
-
const
|
|
3894
|
-
id:
|
|
3893
|
+
const k = tn(), N = {
|
|
3894
|
+
id: k,
|
|
3895
3895
|
bodies: [],
|
|
3896
3896
|
target: {
|
|
3897
|
-
annotation:
|
|
3897
|
+
annotation: k,
|
|
3898
3898
|
selector: M.detail,
|
|
3899
3899
|
creator: X,
|
|
3900
3900
|
created: /* @__PURE__ */ new Date()
|
|
3901
3901
|
}
|
|
3902
3902
|
};
|
|
3903
3903
|
J.addAnnotation(N), H.setSelected(N.id);
|
|
3904
|
-
}, fe = (M) => (
|
|
3904
|
+
}, fe = (M) => (k) => {
|
|
3905
3905
|
var we;
|
|
3906
3906
|
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
3907
|
J.updateTarget({
|
|
3908
3908
|
...N,
|
|
3909
|
-
selector:
|
|
3909
|
+
selector: k.detail,
|
|
3910
3910
|
created: de ? N.created : /* @__PURE__ */ new Date(),
|
|
3911
3911
|
updated: de ? /* @__PURE__ */ new Date() : void 0,
|
|
3912
3912
|
updatedBy: de ? X : void 0
|
|
3913
3913
|
});
|
|
3914
3914
|
}, Oe = (M) => {
|
|
3915
|
-
const { x:
|
|
3915
|
+
const { x: k, y: N } = un(M, T), x = J.getAt(k, N);
|
|
3916
3916
|
x ? u !== x.id && D.set(x.id) : D.set(void 0);
|
|
3917
3917
|
}, ue = (M) => jo(M), U = (M) => Je(M);
|
|
3918
3918
|
function De(M) {
|
|
@@ -3926,20 +3926,20 @@ function vi(e, t, n) {
|
|
|
3926
3926
|
});
|
|
3927
3927
|
}
|
|
3928
3928
|
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,
|
|
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, v = M.toolName), "user" in M && n(28, X = M.user), "visible" in M && n(3, R = M.visible);
|
|
3930
3930
|
}, e.$$.update = () => {
|
|
3931
3931
|
e.$$.dirty[0] & /*toolName*/
|
|
3932
|
-
4 && n(14, { tool: o, opts: i } = fn(
|
|
3932
|
+
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
3933
|
67108864 | e.$$.dirty[1] & /*opts*/
|
|
3934
3934
|
2 && n(13, s = (i == null ? void 0 : i.drawingMode) || _), e.$$.dirty[0] & /*svgEl*/
|
|
3935
3935
|
16 && n(12, r = yi(T)), e.$$.dirty[0] & /*svgEl*/
|
|
3936
3936
|
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((
|
|
3937
|
+
4 && n(9, c = (M) => f.selected.find((k) => k.id === M.id && k.editable)), e.$$.dirty[1] & /*$selection*/
|
|
3938
3938
|
4 && ce(f.selected);
|
|
3939
3939
|
}, [
|
|
3940
3940
|
A,
|
|
3941
3941
|
E,
|
|
3942
|
-
|
|
3942
|
+
v,
|
|
3943
3943
|
R,
|
|
3944
3944
|
T,
|
|
3945
3945
|
V,
|
|
@@ -3968,7 +3968,7 @@ function vi(e, t, n) {
|
|
|
3968
3968
|
X,
|
|
3969
3969
|
Z,
|
|
3970
3970
|
S,
|
|
3971
|
-
|
|
3971
|
+
L,
|
|
3972
3972
|
i,
|
|
3973
3973
|
f,
|
|
3974
3974
|
U,
|
|
@@ -3976,12 +3976,12 @@ function vi(e, t, n) {
|
|
|
3976
3976
|
Ve
|
|
3977
3977
|
];
|
|
3978
3978
|
}
|
|
3979
|
-
class
|
|
3979
|
+
class ki extends ie {
|
|
3980
3980
|
constructor(t) {
|
|
3981
3981
|
super(), oe(
|
|
3982
3982
|
this,
|
|
3983
3983
|
t,
|
|
3984
|
-
|
|
3984
|
+
Li,
|
|
3985
3985
|
Mi,
|
|
3986
3986
|
Q,
|
|
3987
3987
|
{
|
|
@@ -4011,7 +4011,7 @@ class Li extends ie {
|
|
|
4011
4011
|
return this.$$.ctx[31];
|
|
4012
4012
|
}
|
|
4013
4013
|
}
|
|
4014
|
-
function dn(e, t, n = 0, o = e.length - 1, i =
|
|
4014
|
+
function dn(e, t, n = 0, o = e.length - 1, i = vi) {
|
|
4015
4015
|
for (; o > n; ) {
|
|
4016
4016
|
if (o - n > 600) {
|
|
4017
4017
|
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 +4030,7 @@ function Ye(e, t, n) {
|
|
|
4030
4030
|
const o = e[t];
|
|
4031
4031
|
e[t] = e[n], e[n] = o;
|
|
4032
4032
|
}
|
|
4033
|
-
function
|
|
4033
|
+
function vi(e, t) {
|
|
4034
4034
|
return e < t ? -1 : e > t ? 1 : 0;
|
|
4035
4035
|
}
|
|
4036
4036
|
class Ii {
|
|
@@ -4095,7 +4095,7 @@ class Ii {
|
|
|
4095
4095
|
return t && this._insert(t, this.data.height - 1), this;
|
|
4096
4096
|
}
|
|
4097
4097
|
clear() {
|
|
4098
|
-
return this.data =
|
|
4098
|
+
return this.data = Le([]), this;
|
|
4099
4099
|
}
|
|
4100
4100
|
remove(t, n) {
|
|
4101
4101
|
if (!t) return this;
|
|
@@ -4137,8 +4137,8 @@ class Ii {
|
|
|
4137
4137
|
const s = o - n + 1;
|
|
4138
4138
|
let r = this._maxEntries, l;
|
|
4139
4139
|
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 =
|
|
4140
|
+
return l = Le(t.slice(n, o + 1)), Te(l, this.toBBox), l;
|
|
4141
|
+
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
4142
|
const a = Math.ceil(s / r), c = a * Math.ceil(Math.sqrt(r));
|
|
4143
4143
|
Ft(t, n, o, c, this.compareMinX);
|
|
4144
4144
|
for (let u = n; u <= o; u += c) {
|
|
@@ -4172,11 +4172,11 @@ class Ii {
|
|
|
4172
4172
|
_split(t, n) {
|
|
4173
4173
|
const o = t[n], i = o.children.length, s = this._minEntries;
|
|
4174
4174
|
this._chooseSplitAxis(o, s, i);
|
|
4175
|
-
const r = this._chooseSplitIndex(o, s, i), l =
|
|
4175
|
+
const r = this._chooseSplitIndex(o, s, i), l = Le(o.children.splice(r, o.children.length - r));
|
|
4176
4176
|
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
4177
|
}
|
|
4178
4178
|
_splitRoot(t, n) {
|
|
4179
|
-
this.data =
|
|
4179
|
+
this.data = Le([t, n]), this.data.height = t.height + 1, this.data.leaf = !1, Te(this.data, this.toBBox);
|
|
4180
4180
|
}
|
|
4181
4181
|
_chooseSplitIndex(t, n, o) {
|
|
4182
4182
|
let i, s = 1 / 0, r = 1 / 0;
|
|
@@ -4225,7 +4225,7 @@ function Te(e, t) {
|
|
|
4225
4225
|
Ce(e, 0, e.children.length, t, e);
|
|
4226
4226
|
}
|
|
4227
4227
|
function Ce(e, t, n, o, i) {
|
|
4228
|
-
i || (i =
|
|
4228
|
+
i || (i = Le(null)), i.minX = 1 / 0, i.minY = 1 / 0, i.maxX = -1 / 0, i.maxY = -1 / 0;
|
|
4229
4229
|
for (let s = t; s < n; s++) {
|
|
4230
4230
|
const r = e.children[s];
|
|
4231
4231
|
Xe(i, e.leaf ? o(r) : r);
|
|
@@ -4260,7 +4260,7 @@ function ct(e, t) {
|
|
|
4260
4260
|
function ze(e, t) {
|
|
4261
4261
|
return t.minX <= e.maxX && t.minY <= e.maxY && t.maxX >= e.minX && t.maxY >= e.minY;
|
|
4262
4262
|
}
|
|
4263
|
-
function
|
|
4263
|
+
function Le(e) {
|
|
4264
4264
|
return {
|
|
4265
4265
|
children: e,
|
|
4266
4266
|
height: 1,
|
|
@@ -4300,7 +4300,7 @@ const Ci = () => {
|
|
|
4300
4300
|
minY: h,
|
|
4301
4301
|
maxX: f,
|
|
4302
4302
|
maxY: h
|
|
4303
|
-
}).map((m) => m.target).filter((m) => m.selector.type === F.RECTANGLE ||
|
|
4303
|
+
}).map((m) => m.target).filter((m) => m.selector.type === F.RECTANGLE || vn(m.selector, f, h));
|
|
4304
4304
|
if (g.length > 0)
|
|
4305
4305
|
return g.sort((m, A) => ht(m.selector) - ht(A.selector)), g[0];
|
|
4306
4306
|
},
|
|
@@ -4406,7 +4406,7 @@ const Ci = () => {
|
|
|
4406
4406
|
const u = Gi(l);
|
|
4407
4407
|
let f = wo();
|
|
4408
4408
|
Kt(n, c, o.theme);
|
|
4409
|
-
const h = new
|
|
4409
|
+
const h = new ki({
|
|
4410
4410
|
target: c,
|
|
4411
4411
|
props: {
|
|
4412
4412
|
drawingEnabled: !!o.drawingEnabled,
|
|
@@ -4423,7 +4423,7 @@ const Ci = () => {
|
|
|
4423
4423
|
});
|
|
4424
4424
|
const y = ho(i, l, o.adapter), g = () => h.cancelDrawing(), m = () => {
|
|
4425
4425
|
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),
|
|
4426
|
+
}, A = () => h.getDrawingTool(), p = () => f, _ = () => h.isDrawingEnabled(), w = (b, T, Y) => si(b, T, Y), E = (b, T) => zo(b, T), v = (b) => {
|
|
4427
4427
|
if (!fn(b))
|
|
4428
4428
|
throw `No drawing tool named ${b}`;
|
|
4429
4429
|
h.$set({ toolName: b });
|
|
@@ -4431,7 +4431,7 @@ const Ci = () => {
|
|
|
4431
4431
|
console.warn("Filter not implemented yet");
|
|
4432
4432
|
}, V = (b) => h.$set({ style: b }), Z = (b) => Kt(n, c, b), S = (b) => {
|
|
4433
4433
|
f = b, h.$set({ user: b });
|
|
4434
|
-
},
|
|
4434
|
+
}, L = (b) => (
|
|
4435
4435
|
// @ts-ignore
|
|
4436
4436
|
h.$set({ visible: b })
|
|
4437
4437
|
);
|
|
@@ -4448,12 +4448,12 @@ const Ci = () => {
|
|
|
4448
4448
|
registerDrawingTool: w,
|
|
4449
4449
|
registerShapeEditor: E,
|
|
4450
4450
|
setDrawingEnabled: X,
|
|
4451
|
-
setDrawingTool:
|
|
4451
|
+
setDrawingTool: v,
|
|
4452
4452
|
setFilter: R,
|
|
4453
4453
|
setStyle: V,
|
|
4454
4454
|
setTheme: Z,
|
|
4455
4455
|
setUser: S,
|
|
4456
|
-
setVisible:
|
|
4456
|
+
setVisible: L,
|
|
4457
4457
|
element: c,
|
|
4458
4458
|
state: i
|
|
4459
4459
|
};
|
|
@@ -4467,7 +4467,7 @@ export {
|
|
|
4467
4467
|
Go as RectangleEditor,
|
|
4468
4468
|
On as RectangleUtil,
|
|
4469
4469
|
$o as RubberbandRectangle,
|
|
4470
|
-
|
|
4470
|
+
ki as SVGAnnotationLayer,
|
|
4471
4471
|
F as ShapeType,
|
|
4472
4472
|
Qo as ToolMount,
|
|
4473
4473
|
nn as UserSelectAction,
|
|
@@ -4491,7 +4491,7 @@ export {
|
|
|
4491
4491
|
un as getSVGPoint,
|
|
4492
4492
|
fn as getTool,
|
|
4493
4493
|
Gi as initKeyboardCommands,
|
|
4494
|
-
|
|
4494
|
+
vn as intersects,
|
|
4495
4495
|
Je as isImageAnnotation,
|
|
4496
4496
|
Fe as isImageAnnotationTarget,
|
|
4497
4497
|
Wt as isMac,
|