@recogito/text-annotator 4.2.2 → 4.2.3
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/state/spatial-tree.d.ts +5 -5
- package/dist/state/text-annotation-store.d.ts +5 -1
- package/dist/text-annotator-options.d.ts +1 -1
- package/dist/text-annotator.es.js +456 -458
- package/dist/text-annotator.es.js.map +1 -1
- package/dist/text-annotator.umd.js +2 -2
- package/dist/text-annotator.umd.js.map +1 -1
- package/dist/utils/annotation/revive-annotation.d.ts +2 -2
- package/package.json +2 -2
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { v4 as dt } from "uuid";
|
|
2
|
-
import { parseW3CBodies as
|
|
2
|
+
import { parseW3CBodies as Ct, serializeW3CBodies as Tt, parseW3CUser as vt, UserSelectAction as At, createStore as Rt, createSelectionState as wt, createHoverState as xt, createViewportState as Lt, Origin as F, createAnonymousGuest as Nt, createUndoStack as Ot, createLifecycleObserver as kt, createBaseAnnotator as Mt } from "@annotorious/core";
|
|
3
3
|
import { Origin as De, UserSelectAction as He, createBody as Pe } from "@annotorious/core";
|
|
4
4
|
import { createNanoEvents as ut } from "nanoevents";
|
|
5
|
-
import { colord as
|
|
6
|
-
import { dequal as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
5
|
+
import { colord as nt } from "colord";
|
|
6
|
+
import { dequal as _t } from "dequal/lite";
|
|
7
|
+
import Bt from "rbush";
|
|
8
|
+
import It from "debounce";
|
|
9
9
|
import G from "hotkeys-js";
|
|
10
|
-
import { poll as
|
|
11
|
-
const xe = (t) => t.target.selector.every(
|
|
12
|
-
function
|
|
10
|
+
import { poll as Dt } from "poll";
|
|
11
|
+
const xe = (t) => t.target.selector.every(P), Le = (t) => t.selector.every(P);
|
|
12
|
+
function P(t) {
|
|
13
13
|
return Array.isArray(t) ? t.every((e) => "range" in e && e.range instanceof Range && !e.range.collapsed) : "range" in t && t.range instanceof Range && !t.range.collapsed;
|
|
14
14
|
}
|
|
15
|
-
const ft = typeof navigator < "u" && navigator.platform.startsWith("Mac"), gt = "not-annotatable",
|
|
15
|
+
const ft = typeof navigator < "u" && navigator.platform.startsWith("Mac"), gt = "not-annotatable", K = `.${gt}`, Z = (t, e) => t.contains(e) ? !!(e instanceof HTMLElement ? e.closest(K) : e.parentElement?.closest(K)) : !0, mt = (t, e) => {
|
|
16
16
|
const o = e.commonAncestorContainer;
|
|
17
17
|
return !Z(t, o);
|
|
18
|
-
}, pt = /^\s*$/,
|
|
18
|
+
}, pt = /^\s*$/, Ht = (t) => pt.test(t.toString()), Ne = (t) => pt.test(t.textContent || ""), Pt = (t) => {
|
|
19
19
|
if (t.length === 0) return [];
|
|
20
20
|
if (t.length === 1) return [t[0]];
|
|
21
21
|
t.sort((s, n) => {
|
|
@@ -24,22 +24,22 @@ const ft = typeof navigator < "u" && navigator.platform.startsWith("Mac"), gt =
|
|
|
24
24
|
});
|
|
25
25
|
const [e, ...o] = t, i = o.reduce((s, n) => s.current.compareBoundaryPoints(Range.START_TO_END, n) >= 0 ? (s.current.compareBoundaryPoints(Range.END_TO_END, n) < 0 && s.current.setEnd(n.endContainer, n.endOffset), s) : (s.merged.push(s.current), s.current = n.cloneRange(), s), { merged: [], current: e.cloneRange() });
|
|
26
26
|
return [...i.merged, i.current];
|
|
27
|
-
},
|
|
27
|
+
}, Ut = (t) => {
|
|
28
28
|
(!t.hasAttribute("tabindex") || t.tabIndex < -1) && t.setAttribute("tabindex", "-1"), t.classList.add("no-focus-outline");
|
|
29
|
-
},
|
|
29
|
+
}, Ft = function* (t) {
|
|
30
30
|
const e = document.createTreeWalker(
|
|
31
31
|
t.commonAncestorContainer,
|
|
32
32
|
NodeFilter.SHOW_ELEMENT,
|
|
33
|
-
(i) => i instanceof HTMLElement && i.classList.contains(gt) && !i.parentElement?.closest(
|
|
33
|
+
(i) => i instanceof HTMLElement && i.classList.contains(gt) && !i.parentElement?.closest(K) && t.intersectsNode(i) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP
|
|
34
34
|
);
|
|
35
35
|
let o;
|
|
36
36
|
for (; o = e.nextNode(); )
|
|
37
37
|
o instanceof HTMLElement && (yield o);
|
|
38
|
-
},
|
|
38
|
+
}, Kt = (t, e) => {
|
|
39
39
|
if (!mt(t, e)) return [];
|
|
40
40
|
const o = [];
|
|
41
41
|
let i = null;
|
|
42
|
-
for (const s of
|
|
42
|
+
for (const s of Ft(e)) {
|
|
43
43
|
let n;
|
|
44
44
|
i ? (n = document.createRange(), n.setStartAfter(i), n.setEndBefore(s)) : (n = e.cloneRange(), n.setEndBefore(s)), n.collapsed || o.push(n), i = s;
|
|
45
45
|
}
|
|
@@ -48,88 +48,88 @@ const ft = typeof navigator < "u" && navigator.platform.startsWith("Mac"), gt =
|
|
|
48
48
|
s.setStartAfter(i), s.collapsed || o.push(s);
|
|
49
49
|
}
|
|
50
50
|
return o.length > 0 ? o : [e];
|
|
51
|
-
},
|
|
51
|
+
}, ot = (t) => {
|
|
52
52
|
const e = t.cloneContents();
|
|
53
|
-
return e.querySelectorAll(
|
|
54
|
-
},
|
|
53
|
+
return e.querySelectorAll(K).forEach((o) => o.remove()), e;
|
|
54
|
+
}, Wt = (t, e) => {
|
|
55
55
|
const o = t.cloneRange();
|
|
56
56
|
return e.contains(o.startContainer) || o.setStart(e, 0), e.contains(o.endContainer) || o.setEnd(e, e.childNodes.length), o;
|
|
57
|
-
},
|
|
57
|
+
}, rt = new Intl.Segmenter(void 0, { granularity: "grapheme" }), $t = (t, e, o = 10, i) => {
|
|
58
58
|
const s = i ? t.startContainer.parentElement.closest(i) : e, n = document.createRange();
|
|
59
59
|
n.setStart(s, 0), n.setEnd(t.startContainer, t.startOffset);
|
|
60
|
-
const r =
|
|
61
|
-
|
|
62
|
-
const
|
|
60
|
+
const r = ot(n).textContent, c = document.createRange();
|
|
61
|
+
c.setStart(t.endContainer, t.endOffset), s === document.body ? c.setEnd(s, s.childNodes.length) : c.setEndAfter(s);
|
|
62
|
+
const l = ot(c).textContent, h = [...rt.segment(r)], g = [...rt.segment(l)];
|
|
63
63
|
return {
|
|
64
|
-
prefix:
|
|
65
|
-
suffix:
|
|
64
|
+
prefix: h.slice(-o).map((S) => S.segment).join(""),
|
|
65
|
+
suffix: g.slice(0, o).map((S) => S.segment).join("")
|
|
66
66
|
};
|
|
67
|
-
},
|
|
67
|
+
}, Yt = (t, e, o) => {
|
|
68
68
|
const i = document.createRange(), s = o ? t.startContainer.parentElement.closest(o) : e;
|
|
69
69
|
i.setStart(s, 0), i.setEnd(t.startContainer, t.startOffset);
|
|
70
|
-
const n =
|
|
71
|
-
return o ? { quote: r, start:
|
|
72
|
-
},
|
|
73
|
-
if (
|
|
70
|
+
const n = ot(i).textContent, r = t.toString(), c = n.length || 0, l = c + r.length;
|
|
71
|
+
return o ? { quote: r, start: c, end: l, range: t, offsetReference: s } : { quote: r, start: c, end: l, range: t };
|
|
72
|
+
}, Xt = (t, e) => {
|
|
73
|
+
if (P(t)) return t;
|
|
74
74
|
const { start: o, end: i } = t, s = t.offsetReference || e, n = document.createTreeWalker(
|
|
75
75
|
e,
|
|
76
76
|
NodeFilter.SHOW_TEXT,
|
|
77
|
-
(
|
|
77
|
+
(g) => g.parentElement?.closest(K) ? NodeFilter.FILTER_SKIP : NodeFilter.FILTER_ACCEPT
|
|
78
78
|
);
|
|
79
79
|
let r = 0;
|
|
80
|
-
const
|
|
81
|
-
let
|
|
82
|
-
|
|
83
|
-
let
|
|
84
|
-
for (;
|
|
85
|
-
if (
|
|
86
|
-
const
|
|
87
|
-
if (r +
|
|
88
|
-
|
|
80
|
+
const c = document.createRange();
|
|
81
|
+
let l = n.nextNode();
|
|
82
|
+
l === null && console.error("Could not revive annotation target. Content missing.");
|
|
83
|
+
let h = !s;
|
|
84
|
+
for (; l !== null; ) {
|
|
85
|
+
if (h ||= typeof s?.contains == "function" ? s.contains(l) : !1, h) {
|
|
86
|
+
const g = l.textContent?.length || 0;
|
|
87
|
+
if (r + g > o) {
|
|
88
|
+
c.setStart(l, o - r);
|
|
89
89
|
break;
|
|
90
90
|
}
|
|
91
|
-
r +=
|
|
91
|
+
r += g;
|
|
92
92
|
}
|
|
93
|
-
|
|
93
|
+
l = n.nextNode();
|
|
94
94
|
}
|
|
95
|
-
for (;
|
|
96
|
-
const
|
|
97
|
-
if (r +
|
|
98
|
-
|
|
95
|
+
for (; l !== null; ) {
|
|
96
|
+
const g = l.textContent?.length || 0;
|
|
97
|
+
if (r + g >= i) {
|
|
98
|
+
c.setEnd(l, i - r);
|
|
99
99
|
break;
|
|
100
100
|
}
|
|
101
|
-
r +=
|
|
101
|
+
r += g, l = n.nextNode();
|
|
102
102
|
}
|
|
103
103
|
return {
|
|
104
104
|
...t,
|
|
105
|
-
range:
|
|
105
|
+
range: c
|
|
106
106
|
};
|
|
107
|
-
}, J = (t, e, o = (i, s) =>
|
|
107
|
+
}, J = (t, e, o = (i, s) => Xt(i, s)) => ({
|
|
108
108
|
...t,
|
|
109
|
-
selector: t.selector.
|
|
110
|
-
}),
|
|
109
|
+
selector: t.selector.flatMap((i) => o(i, e))
|
|
110
|
+
}), it = (t, e, o) => ({
|
|
111
111
|
...t,
|
|
112
112
|
target: J(t.target, e, o)
|
|
113
|
-
}),
|
|
113
|
+
}), ht = (t) => {
|
|
114
114
|
if (!t)
|
|
115
115
|
return document.scrollingElement;
|
|
116
116
|
const { overflowY: e } = window.getComputedStyle(t);
|
|
117
|
-
return e !== "visible" && e !== "hidden" && t.scrollHeight > t.clientHeight ? t :
|
|
117
|
+
return e !== "visible" && e !== "hidden" && t.scrollHeight > t.clientHeight ? t : ht(t.parentElement);
|
|
118
118
|
}, at = (t, e, o) => {
|
|
119
|
-
const i = o.getBoundingClientRect(), s = o.clientHeight, n = o.clientWidth, r = e.selector[0].range.getBoundingClientRect(), { width:
|
|
120
|
-
o.scroll({ top:
|
|
119
|
+
const i = o.getBoundingClientRect(), s = o.clientHeight, n = o.clientWidth, r = e.selector[0].range.getBoundingClientRect(), { width: c, height: l } = t.getAnnotationBounds(e.annotation), h = r.top - i.top, g = r.left - i.left, S = o.parentElement ? o.scrollTop : 0, m = o.parentElement ? o.scrollLeft : 0, v = h + S - (s - l) / 2, d = g + m - (n - c) / 2;
|
|
120
|
+
o.scroll({ top: v, left: d, behavior: "smooth" });
|
|
121
121
|
}, Vt = (t, e) => (o, i) => {
|
|
122
|
-
const s = typeof o == "string" ? o : o.id, n = i ? typeof i == "string" ? document.getElementById(i) : i :
|
|
122
|
+
const s = typeof o == "string" ? o : o.id, n = i ? typeof i == "string" ? document.getElementById(i) : i : ht(t);
|
|
123
123
|
if (!n)
|
|
124
124
|
return console.warn(`The scroll parent is missing for the annotation: ${s}`, { container: t }), !1;
|
|
125
125
|
const r = e.getAnnotation(s);
|
|
126
126
|
if (!r)
|
|
127
127
|
return console.warn(`The annotation is missing in the store: ${s}`), !1;
|
|
128
|
-
const { range:
|
|
129
|
-
if (
|
|
128
|
+
const { range: c } = r.target.selector[0];
|
|
129
|
+
if (c && !c.collapsed)
|
|
130
130
|
return at(e, r.target, n), !0;
|
|
131
|
-
const
|
|
132
|
-
return
|
|
131
|
+
const l = J(r.target, t), { range: h } = l.selector[0];
|
|
132
|
+
return h && !h.collapsed ? (at(e, l, n), !0) : !1;
|
|
133
133
|
}, Oe = (t, e) => ({
|
|
134
134
|
parse: (o) => jt(o),
|
|
135
135
|
serialize: (o) => Gt(o, t, e)
|
|
@@ -143,7 +143,7 @@ const ft = typeof navigator < "u" && navigator.platform.startsWith("Mac"), gt =
|
|
|
143
143
|
} = t, r = Array.isArray(n) ? n : [n];
|
|
144
144
|
if (r.length === 0)
|
|
145
145
|
return { error: Error(`No targets found for annotation: ${t.id}`) };
|
|
146
|
-
const
|
|
146
|
+
const c = {
|
|
147
147
|
creator: vt(o),
|
|
148
148
|
created: i ? new Date(i) : void 0,
|
|
149
149
|
updated: s ? new Date(s) : void 0,
|
|
@@ -152,36 +152,36 @@ const ft = typeof navigator < "u" && navigator.platform.startsWith("Mac"), gt =
|
|
|
152
152
|
// @ts-expect-error: `styleClass` is not part of the core `TextAnnotationTarget` type
|
|
153
153
|
styleClass: "styleClass" in r[0] ? r[0].styleClass : void 0
|
|
154
154
|
};
|
|
155
|
-
for (const
|
|
156
|
-
const
|
|
157
|
-
switch (
|
|
155
|
+
for (const l of r) {
|
|
156
|
+
const g = (Array.isArray(l.selector) ? l.selector : [l.selector]).reduce((S, m) => {
|
|
157
|
+
switch (m.type) {
|
|
158
158
|
case "TextQuoteSelector":
|
|
159
|
-
|
|
159
|
+
S.quote = m.exact;
|
|
160
160
|
break;
|
|
161
161
|
case "TextPositionSelector":
|
|
162
|
-
|
|
162
|
+
S.start = m.start, S.end = m.end;
|
|
163
163
|
break;
|
|
164
164
|
}
|
|
165
|
-
return
|
|
165
|
+
return S;
|
|
166
166
|
}, {});
|
|
167
|
-
if (zt(
|
|
168
|
-
|
|
167
|
+
if (zt(g))
|
|
168
|
+
c.selector.push(
|
|
169
169
|
{
|
|
170
|
-
...
|
|
171
|
-
id:
|
|
170
|
+
...g,
|
|
171
|
+
id: l.id,
|
|
172
172
|
// @ts-expect-error: `scope` is not part of the core `TextSelector` type
|
|
173
|
-
scope:
|
|
173
|
+
scope: l.scope
|
|
174
174
|
}
|
|
175
175
|
);
|
|
176
176
|
else {
|
|
177
|
-
const
|
|
178
|
-
|
|
179
|
-
|
|
177
|
+
const S = [
|
|
178
|
+
g.start ? void 0 : "TextPositionSelector",
|
|
179
|
+
g.quote ? void 0 : "TextQuoteSelector"
|
|
180
180
|
].filter(Boolean);
|
|
181
|
-
return { error: Error(`Missing selector types: ${
|
|
181
|
+
return { error: Error(`Missing selector types: ${S.join(" and ")} for annotation: ${t.id}`) };
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
|
-
return { parsed:
|
|
184
|
+
return { parsed: c };
|
|
185
185
|
}, jt = (t) => {
|
|
186
186
|
const e = t.id || dt(), {
|
|
187
187
|
creator: o,
|
|
@@ -189,45 +189,45 @@ const ft = typeof navigator < "u" && navigator.platform.startsWith("Mac"), gt =
|
|
|
189
189
|
modified: s,
|
|
190
190
|
body: n,
|
|
191
191
|
...r
|
|
192
|
-
} = t,
|
|
193
|
-
return "error" in
|
|
192
|
+
} = t, c = Ct(n, e), l = qt(t);
|
|
193
|
+
return "error" in l ? { error: l.error } : {
|
|
194
194
|
parsed: {
|
|
195
195
|
...r,
|
|
196
196
|
id: e,
|
|
197
|
-
bodies:
|
|
198
|
-
target:
|
|
197
|
+
bodies: c,
|
|
198
|
+
target: l.parsed
|
|
199
199
|
}
|
|
200
200
|
};
|
|
201
201
|
}, Gt = (t, e, o) => {
|
|
202
202
|
const { bodies: i, target: s, ...n } = t, {
|
|
203
203
|
selector: r,
|
|
204
|
-
creator:
|
|
205
|
-
created:
|
|
206
|
-
updated:
|
|
207
|
-
...
|
|
208
|
-
} = s,
|
|
209
|
-
const { id:
|
|
204
|
+
creator: c,
|
|
205
|
+
created: l,
|
|
206
|
+
updated: h,
|
|
207
|
+
...g
|
|
208
|
+
} = s, S = r.map((m) => {
|
|
209
|
+
const { id: v, quote: d } = m, R = {
|
|
210
210
|
type: "TextQuoteSelector",
|
|
211
|
-
exact:
|
|
211
|
+
exact: d
|
|
212
212
|
};
|
|
213
|
-
if (o && "range" in
|
|
214
|
-
const { prefix:
|
|
215
|
-
|
|
213
|
+
if (o && "range" in m) {
|
|
214
|
+
const { prefix: x, suffix: b } = $t(m.range, o);
|
|
215
|
+
R.prefix = x, R.suffix = b;
|
|
216
216
|
}
|
|
217
|
-
if (!("start" in
|
|
217
|
+
if (!("start" in m))
|
|
218
218
|
throw new Error("W3C serialization requires TextSelector with start/end");
|
|
219
|
-
const { start:
|
|
219
|
+
const { start: w, end: A } = m, N = {
|
|
220
220
|
type: "TextPositionSelector",
|
|
221
|
-
start:
|
|
221
|
+
start: w,
|
|
222
222
|
end: A
|
|
223
223
|
};
|
|
224
224
|
return {
|
|
225
|
-
...
|
|
226
|
-
id:
|
|
225
|
+
...g,
|
|
226
|
+
id: v,
|
|
227
227
|
// @ts-expect-error: `scope` is not part of the core `TextSelector` type
|
|
228
|
-
scope: "scope" in
|
|
228
|
+
scope: "scope" in m ? m.scope : void 0,
|
|
229
229
|
source: e,
|
|
230
|
-
selector: [
|
|
230
|
+
selector: [R, N]
|
|
231
231
|
};
|
|
232
232
|
});
|
|
233
233
|
return {
|
|
@@ -235,16 +235,16 @@ const ft = typeof navigator < "u" && navigator.platform.startsWith("Mac"), gt =
|
|
|
235
235
|
"@context": "http://www.w3.org/ns/anno.jsonld",
|
|
236
236
|
id: t.id,
|
|
237
237
|
type: "Annotation",
|
|
238
|
-
body:
|
|
239
|
-
creator:
|
|
240
|
-
created:
|
|
241
|
-
modified:
|
|
242
|
-
target:
|
|
238
|
+
body: Tt(t.bodies),
|
|
239
|
+
creator: c,
|
|
240
|
+
created: l?.toISOString(),
|
|
241
|
+
modified: h?.toISOString(),
|
|
242
|
+
target: S
|
|
243
243
|
};
|
|
244
244
|
}, Qt = (t) => t.addEventListener("click", (e) => {
|
|
245
245
|
// Allow clicks within not-annotatable elements
|
|
246
|
-
!e.target.closest(
|
|
247
|
-
}),
|
|
246
|
+
!e.target.closest(K) && !e.target.closest("a") && e.preventDefault();
|
|
247
|
+
}), tt = (t) => ({
|
|
248
248
|
...t,
|
|
249
249
|
type: t.type,
|
|
250
250
|
x: t.x,
|
|
@@ -286,76 +286,76 @@ const ft = typeof navigator < "u" && navigator.platform.startsWith("Mac"), gt =
|
|
|
286
286
|
defaultPrevented: t.defaultPrevented,
|
|
287
287
|
detail: t.detail,
|
|
288
288
|
timeStamp: t.timeStamp
|
|
289
|
-
}),
|
|
289
|
+
}), et = (t, e = 10) => {
|
|
290
290
|
let o;
|
|
291
291
|
return ((...i) => {
|
|
292
292
|
clearTimeout(o), o = setTimeout(() => t.apply(void 0, i), e);
|
|
293
293
|
});
|
|
294
|
-
},
|
|
295
|
-
const { store: s, selection: n, hover: r } = o,
|
|
296
|
-
let
|
|
297
|
-
const
|
|
298
|
-
let
|
|
299
|
-
const
|
|
300
|
-
const { x:
|
|
301
|
-
|
|
294
|
+
}, yt = (t, e, o, i) => {
|
|
295
|
+
const { store: s, selection: n, hover: r } = o, c = ut();
|
|
296
|
+
let l;
|
|
297
|
+
const h = /* @__PURE__ */ new Map();
|
|
298
|
+
let g;
|
|
299
|
+
const S = ce(i), m = (y) => {
|
|
300
|
+
const { x: T, y: O } = e.getBoundingClientRect(), _ = s.getAt(y.clientX - T, y.clientY - O, !1, g);
|
|
301
|
+
_ && o.selection.evalSelectAction(_) !== At.NONE ? r.current !== _.id && (e.classList.add("hovered"), r.set(_.id)) : r.current && (e.classList.remove("hovered"), r.set(null));
|
|
302
302
|
};
|
|
303
|
-
e.addEventListener("pointermove",
|
|
304
|
-
const
|
|
305
|
-
const
|
|
306
|
-
const M =
|
|
303
|
+
e.addEventListener("pointermove", m);
|
|
304
|
+
const v = et((y = !1) => requestAnimationFrame(() => {
|
|
305
|
+
const T = ae(e), { minX: O, minY: _, maxX: V, maxY: z } = T, q = g ? s.getIntersecting(O, _, V, z).filter(({ annotation: f }) => g?.(f)) : s.getIntersecting(O, _, V, z), W = n.selected.map(({ id: f }) => f), $ = q.map(({ annotation: f, rects: C }) => {
|
|
306
|
+
const M = W.includes(f.id), I = f.id === r.current;
|
|
307
307
|
return {
|
|
308
|
-
annotation:
|
|
308
|
+
annotation: f,
|
|
309
309
|
rects: C,
|
|
310
|
-
state: { selected: M, hovered:
|
|
310
|
+
state: { selected: M, hovered: I }
|
|
311
311
|
};
|
|
312
312
|
});
|
|
313
|
-
t.redraw(
|
|
314
|
-
|
|
313
|
+
t.redraw($, T, l, h, y), setTimeout(() => {
|
|
314
|
+
S(q.map(({ annotation: f }) => f)), c.emit("onRedraw");
|
|
315
315
|
}, 1);
|
|
316
|
-
}), 10),
|
|
317
|
-
|
|
318
|
-
},
|
|
319
|
-
|
|
320
|
-
},
|
|
321
|
-
|
|
316
|
+
}), 10), d = (y, T) => {
|
|
317
|
+
T ? y ? h.set(T, y) : h.delete(T) : l = y, v(!0);
|
|
318
|
+
}, R = (y) => {
|
|
319
|
+
g = y, v(!1);
|
|
320
|
+
}, w = (y, T) => c.on(y, T), A = () => {
|
|
321
|
+
v();
|
|
322
322
|
};
|
|
323
323
|
s.observe(A);
|
|
324
|
-
const
|
|
325
|
-
|
|
326
|
-
}),
|
|
327
|
-
|
|
328
|
-
}),
|
|
329
|
-
|
|
324
|
+
const N = n.subscribe(() => {
|
|
325
|
+
v();
|
|
326
|
+
}), x = r.subscribe(() => {
|
|
327
|
+
v();
|
|
328
|
+
}), b = () => {
|
|
329
|
+
v(!0);
|
|
330
330
|
};
|
|
331
|
-
document.addEventListener("scroll",
|
|
332
|
-
const
|
|
333
|
-
s.recalculatePositions(),
|
|
331
|
+
document.addEventListener("scroll", b, { capture: !0, passive: !0 });
|
|
332
|
+
const a = et(() => {
|
|
333
|
+
s.recalculatePositions(), v();
|
|
334
334
|
}, 10);
|
|
335
|
-
window.addEventListener("resize",
|
|
336
|
-
const
|
|
337
|
-
|
|
338
|
-
const p = { attributes: !0, childList: !0, subtree: !0 },
|
|
339
|
-
|
|
335
|
+
window.addEventListener("resize", a);
|
|
336
|
+
const u = new ResizeObserver(a);
|
|
337
|
+
u.observe(e);
|
|
338
|
+
const p = { attributes: !0, childList: !0, subtree: !0 }, E = new MutationObserver(et((y) => {
|
|
339
|
+
y.every((O) => O.target === e || e.contains(O.target)) || v(!0);
|
|
340
340
|
}, 150));
|
|
341
|
-
return
|
|
341
|
+
return E.observe(document.body, p), {
|
|
342
342
|
destroy: () => {
|
|
343
|
-
e.removeEventListener("pointermove",
|
|
343
|
+
e.removeEventListener("pointermove", m), t.destroy(), s.unobserve(A), N(), x(), document.removeEventListener("scroll", b), window.removeEventListener("resize", a), u.disconnect(), E.disconnect();
|
|
344
344
|
},
|
|
345
|
-
on:
|
|
346
|
-
redraw:
|
|
347
|
-
setStyle:
|
|
348
|
-
setFilter:
|
|
345
|
+
on: w,
|
|
346
|
+
redraw: v,
|
|
347
|
+
setStyle: d,
|
|
348
|
+
setFilter: R,
|
|
349
349
|
setVisible: t.setVisible.bind(t)
|
|
350
350
|
};
|
|
351
351
|
}, U = {
|
|
352
352
|
fill: "rgb(0, 128, 255)",
|
|
353
353
|
fillOpacity: 0.18
|
|
354
|
-
},
|
|
354
|
+
}, st = {
|
|
355
355
|
fill: "rgb(0, 128, 255)",
|
|
356
356
|
fillOpacity: 0.45
|
|
357
|
-
}, Zt = (t) => t?.fillOpacity !== void 0 ?
|
|
358
|
-
const o = (n, r) => n.x <= r.x + r.width && n.x + n.width >= r.x && n.y <= r.y + r.height && n.y + n.height >= r.y, i = (n) => n.rects.reduce((r,
|
|
357
|
+
}, Zt = (t) => t?.fillOpacity !== void 0 ? nt(t?.fill || U.fill).alpha(t.fillOpacity).toHex() : t?.fill ? t.fill : nt(U.fill).alpha(U.fillOpacity).toHex(), St = (t, e, o) => e ? typeof e == "function" ? e(t.annotation, t.state, o) || (t.state?.selected ? st : U) : e : t.state?.selected ? st : U, Jt = (t, e) => {
|
|
358
|
+
const o = (n, r) => n.x <= r.x + r.width && n.x + n.width >= r.x && n.y <= r.y + r.height && n.y + n.height >= r.y, i = (n) => n.rects.reduce((r, c) => r + c.width, 0), s = e.filter(({ rects: n }) => n.some((r) => o(t, r)));
|
|
359
359
|
return s.sort((n, r) => i(r) - i(n)), s.findIndex((n) => n.rects.includes(t));
|
|
360
360
|
}, te = (t) => {
|
|
361
361
|
const e = [], o = document.createTreeWalker(
|
|
@@ -372,32 +372,32 @@ const ft = typeof navigator < "u" && navigator.platform.startsWith("Mac"), gt =
|
|
|
372
372
|
if (e.length < 2)
|
|
373
373
|
return Array.from(t.getClientRects());
|
|
374
374
|
{
|
|
375
|
-
const n = e[0], r = e[e.length - 1],
|
|
376
|
-
if (
|
|
377
|
-
|
|
375
|
+
const n = e[0], r = e[e.length - 1], c = document.createRange();
|
|
376
|
+
if (c.selectNode(n), t.startContainer.nodeType === Node.TEXT_NODE)
|
|
377
|
+
c.setStart(n, t.startOffset);
|
|
378
378
|
else {
|
|
379
|
-
const
|
|
380
|
-
|
|
379
|
+
const g = t.startContainer.childNodes[t.startOffset];
|
|
380
|
+
g ? c.setStartBefore(g) : c.setStartAfter(t.startContainer);
|
|
381
381
|
}
|
|
382
|
-
const
|
|
383
|
-
if (
|
|
384
|
-
|
|
382
|
+
const l = document.createRange();
|
|
383
|
+
if (l.selectNode(r), t.endContainer.nodeType === Node.TEXT_NODE)
|
|
384
|
+
l.setEnd(r, t.endOffset);
|
|
385
385
|
else {
|
|
386
|
-
const
|
|
387
|
-
|
|
386
|
+
const g = t.endContainer.childNodes[t.endOffset];
|
|
387
|
+
g ? l.setEndBefore(g) : l.setEndAfter(t.endContainer);
|
|
388
388
|
}
|
|
389
|
-
const
|
|
390
|
-
const
|
|
391
|
-
return
|
|
389
|
+
const h = (g) => {
|
|
390
|
+
const S = document.createRange();
|
|
391
|
+
return S.selectNode(g), Array.from(S.getClientRects());
|
|
392
392
|
};
|
|
393
393
|
return [
|
|
394
|
-
...Array.from(
|
|
395
|
-
...e.slice(1, -1).flatMap(
|
|
396
|
-
...Array.from(
|
|
394
|
+
...Array.from(c.getClientRects()),
|
|
395
|
+
...e.slice(1, -1).flatMap(h),
|
|
396
|
+
...Array.from(l.getClientRects())
|
|
397
397
|
];
|
|
398
398
|
}
|
|
399
399
|
}, ee = (t, e, o, i) => {
|
|
400
|
-
const s = (
|
|
400
|
+
const s = (c) => Math.round(c * 10) / 10, n = {
|
|
401
401
|
top: s(t.top),
|
|
402
402
|
bottom: s(t.bottom),
|
|
403
403
|
left: s(t.left),
|
|
@@ -427,19 +427,19 @@ const ft = typeof navigator < "u" && navigator.platform.startsWith("Mac"), gt =
|
|
|
427
427
|
if (s.width === 0 || s.height === 0)
|
|
428
428
|
return i;
|
|
429
429
|
let n = [...i], r = !1;
|
|
430
|
-
for (const
|
|
431
|
-
const
|
|
432
|
-
if (
|
|
433
|
-
n = n.map((
|
|
430
|
+
for (const c of i) {
|
|
431
|
+
const l = ee(s, c, e, o);
|
|
432
|
+
if (l === "inline-adjacent") {
|
|
433
|
+
n = n.map((h) => h === c ? ne(s, c) : h), r = !0;
|
|
434
434
|
break;
|
|
435
|
-
} else if (
|
|
436
|
-
n = n.map((
|
|
435
|
+
} else if (l === "inline-contains") {
|
|
436
|
+
n = n.map((h) => h === c ? s : h), r = !0;
|
|
437
437
|
break;
|
|
438
|
-
} else if (
|
|
438
|
+
} else if (l === "inline-is-contained") {
|
|
439
439
|
r = !0;
|
|
440
440
|
break;
|
|
441
|
-
} else if (
|
|
442
|
-
s.width <
|
|
441
|
+
} else if (l === "block-contains" || l === "block-is-contained") {
|
|
442
|
+
s.width < c.width && (n = n.map((h) => h === c ? s : h)), s.width === c.width && s.height < c.width && (n = n.map((h) => h === c ? s : h)), r = !0;
|
|
443
443
|
break;
|
|
444
444
|
}
|
|
445
445
|
}
|
|
@@ -454,7 +454,7 @@ const ft = typeof navigator < "u" && navigator.platform.startsWith("Mac"), gt =
|
|
|
454
454
|
}), se = (t, e) => {
|
|
455
455
|
const { left: o, top: i, right: s, bottom: n } = t;
|
|
456
456
|
return new DOMRect(o - e.left, i - e.top, s - o, n - i);
|
|
457
|
-
},
|
|
457
|
+
}, Me = (t, e) => {
|
|
458
458
|
const { left: o, top: i, right: s, bottom: n } = t;
|
|
459
459
|
return new DOMRect(o + e.left, i + e.top, s - o, n - i);
|
|
460
460
|
}, re = (t) => {
|
|
@@ -466,16 +466,16 @@ const ft = typeof navigator < "u" && navigator.platform.startsWith("Mac"), gt =
|
|
|
466
466
|
destroy: () => {
|
|
467
467
|
e.remove();
|
|
468
468
|
},
|
|
469
|
-
redraw: (r,
|
|
470
|
-
if (!(!
|
|
471
|
-
e.innerHTML = "", [...r].sort((
|
|
472
|
-
const { annotation: { target: { created:
|
|
473
|
-
return
|
|
474
|
-
}).forEach((
|
|
475
|
-
const
|
|
476
|
-
|
|
477
|
-
const A = Jt(
|
|
478
|
-
|
|
469
|
+
redraw: (r, c, l, h, g) => {
|
|
470
|
+
if (!(!_t(o, r) || g)) return;
|
|
471
|
+
e.innerHTML = "", [...r].sort((d, R) => {
|
|
472
|
+
const { annotation: { target: { created: w } } } = d, { annotation: { target: { created: A } } } = R;
|
|
473
|
+
return w && A ? w.getTime() - A.getTime() : 0;
|
|
474
|
+
}).forEach((d) => {
|
|
475
|
+
const R = h?.get(d.annotation.id) || l;
|
|
476
|
+
d.rects.map((w) => {
|
|
477
|
+
const A = Jt(w, r), N = St(d, R, A), x = document.createElement("span");
|
|
478
|
+
x.className = "r6o-annotation", x.dataset.annotation = d.annotation.id, x.style.left = `${w.x}px`, x.style.top = `${w.y}px`, x.style.width = `${w.width}px`, x.style.height = `${w.height}px`, x.style.backgroundColor = Zt(N), N.underlineStyle && (x.style.borderStyle = N.underlineStyle), N.underlineColor && (x.style.borderColor = N.underlineColor), N.underlineThickness && (x.style.borderBottomWidth = `${N.underlineThickness}px`), N.underlineOffset && (x.style.paddingBottom = `${N.underlineOffset}px`), e.appendChild(x);
|
|
479
479
|
});
|
|
480
480
|
}), o = r;
|
|
481
481
|
},
|
|
@@ -483,314 +483,312 @@ const ft = typeof navigator < "u" && navigator.platform.startsWith("Mac"), gt =
|
|
|
483
483
|
r ? e.classList.remove("hidden") : e.classList.add("hidden");
|
|
484
484
|
}
|
|
485
485
|
};
|
|
486
|
-
}, ie = (t, e, o) =>
|
|
487
|
-
const { top: e, left: o } = t.getBoundingClientRect(), { innerWidth: i, innerHeight: s } = window, n = -o, r = -e,
|
|
488
|
-
return { top: e, left: o, minX: n, minY: r, maxX:
|
|
486
|
+
}, ie = (t, e, o) => yt(re(t), t, e, o), ae = (t) => {
|
|
487
|
+
const { top: e, left: o } = t.getBoundingClientRect(), { innerWidth: i, innerHeight: s } = window, n = -o, r = -e, c = i - o, l = s - e;
|
|
488
|
+
return { top: e, left: o, minX: n, minY: r, maxX: c, maxY: l };
|
|
489
489
|
}, ce = (t) => {
|
|
490
490
|
let e = /* @__PURE__ */ new Set();
|
|
491
491
|
return (i) => {
|
|
492
492
|
const s = i.map((n) => n.id);
|
|
493
493
|
(e.size !== s.length || s.some((n) => !e.has(n))) && t.set(s), e = new Set(s);
|
|
494
494
|
};
|
|
495
|
-
}, le = (t, e, o, i
|
|
496
|
-
const
|
|
497
|
-
const
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
}), O = oe(w, o, i).map((T) => se(T, p));
|
|
501
|
-
return O.map((T) => {
|
|
502
|
-
const { x: b, y: v, width: k, height: F } = T;
|
|
495
|
+
}, le = (t, e, o, i) => {
|
|
496
|
+
const s = new Bt(), n = /* @__PURE__ */ new Map(), r = ut(), c = (a, u) => {
|
|
497
|
+
const p = a.selector.flatMap((L) => te(L.range)), E = oe(p, o, i).map((L) => se(L, u));
|
|
498
|
+
return E.map((L) => {
|
|
499
|
+
const { x: y, y: T, width: O, height: _ } = L;
|
|
503
500
|
return {
|
|
504
|
-
minX:
|
|
505
|
-
minY:
|
|
506
|
-
maxX:
|
|
507
|
-
maxY:
|
|
501
|
+
minX: y,
|
|
502
|
+
minY: T,
|
|
503
|
+
maxX: y + O,
|
|
504
|
+
maxY: T + _,
|
|
508
505
|
annotation: {
|
|
509
|
-
id:
|
|
510
|
-
rects:
|
|
506
|
+
id: a.annotation,
|
|
507
|
+
rects: E
|
|
511
508
|
}
|
|
512
509
|
};
|
|
513
510
|
});
|
|
514
|
-
},
|
|
515
|
-
|
|
516
|
-
},
|
|
517
|
-
const
|
|
518
|
-
|
|
519
|
-
},
|
|
520
|
-
const
|
|
521
|
-
|
|
522
|
-
},
|
|
523
|
-
|
|
524
|
-
},
|
|
525
|
-
|
|
526
|
-
const
|
|
527
|
-
|
|
528
|
-
|
|
511
|
+
}, l = () => [...n.values()], h = () => {
|
|
512
|
+
s.clear(), n.clear();
|
|
513
|
+
}, g = (a) => {
|
|
514
|
+
const u = c(a, e.getBoundingClientRect());
|
|
515
|
+
u.length !== 0 && (u.forEach((p) => s.insert(p)), n.set(a.annotation, u));
|
|
516
|
+
}, S = (a) => {
|
|
517
|
+
const u = n.get(a.annotation);
|
|
518
|
+
u && (u.forEach((p) => s.remove(p)), n.delete(a.annotation));
|
|
519
|
+
}, m = (a) => {
|
|
520
|
+
S(a), g(a);
|
|
521
|
+
}, v = (a, u = !0) => {
|
|
522
|
+
u && h();
|
|
523
|
+
const p = e.getBoundingClientRect(), E = a.map((y) => ({ target: y, rects: c(y, p) }));
|
|
524
|
+
E.forEach(({ target: y, rects: T }) => {
|
|
525
|
+
T.length > 0 && n.set(y.annotation, T);
|
|
529
526
|
});
|
|
530
|
-
const
|
|
531
|
-
|
|
532
|
-
},
|
|
533
|
-
const
|
|
534
|
-
minX:
|
|
535
|
-
minY:
|
|
536
|
-
maxX:
|
|
537
|
-
maxY:
|
|
538
|
-
}),
|
|
539
|
-
return
|
|
540
|
-
},
|
|
541
|
-
const
|
|
542
|
-
if (
|
|
527
|
+
const L = E.flatMap(({ rects: y }) => y);
|
|
528
|
+
s.load(L);
|
|
529
|
+
}, d = (a, u, p = !1) => {
|
|
530
|
+
const E = s.search({
|
|
531
|
+
minX: a,
|
|
532
|
+
minY: u,
|
|
533
|
+
maxX: a,
|
|
534
|
+
maxY: u
|
|
535
|
+
}), L = (y) => y.annotation.rects.reduce((T, O) => T + O.width * O.height, 0);
|
|
536
|
+
return E.length > 0 ? (E.sort((y, T) => L(y) - L(T)), p ? E.map((y) => y.annotation.id) : [E[0].annotation.id]) : [];
|
|
537
|
+
}, R = (a) => {
|
|
538
|
+
const u = w(a);
|
|
539
|
+
if (u.length === 0)
|
|
543
540
|
return;
|
|
544
|
-
let
|
|
545
|
-
for (let
|
|
546
|
-
const
|
|
547
|
-
|
|
541
|
+
let p = u[0].left, E = u[0].top, L = u[0].right, y = u[0].bottom;
|
|
542
|
+
for (let T = 1; T < u.length; T++) {
|
|
543
|
+
const O = u[T];
|
|
544
|
+
p = Math.min(p, O.left), E = Math.min(E, O.top), L = Math.max(L, O.right), y = Math.max(y, O.bottom);
|
|
548
545
|
}
|
|
549
|
-
return new DOMRect(
|
|
550
|
-
},
|
|
551
|
-
const
|
|
552
|
-
return
|
|
546
|
+
return new DOMRect(p, E, L - p, y - E);
|
|
547
|
+
}, w = (a) => {
|
|
548
|
+
const u = n.get(a);
|
|
549
|
+
return u ? u[0].annotation.rects : [];
|
|
553
550
|
};
|
|
554
551
|
return {
|
|
555
|
-
all:
|
|
556
|
-
clear:
|
|
557
|
-
getAt:
|
|
558
|
-
getAnnotationBounds:
|
|
559
|
-
getAnnotationRects:
|
|
560
|
-
getIntersecting: (
|
|
561
|
-
const
|
|
562
|
-
return Array.from(
|
|
563
|
-
annotation: t.getAnnotation(
|
|
564
|
-
rects:
|
|
565
|
-
})).filter((
|
|
552
|
+
all: l,
|
|
553
|
+
clear: h,
|
|
554
|
+
getAt: d,
|
|
555
|
+
getAnnotationBounds: R,
|
|
556
|
+
getAnnotationRects: w,
|
|
557
|
+
getIntersecting: (a, u, p, E) => {
|
|
558
|
+
const L = s.search({ minX: a, minY: u, maxX: p, maxY: E }), y = new Set(L.map((T) => T.annotation.id));
|
|
559
|
+
return Array.from(y).map((T) => ({
|
|
560
|
+
annotation: t.getAnnotation(T),
|
|
561
|
+
rects: w(T)
|
|
562
|
+
})).filter((T) => !!T.annotation);
|
|
566
563
|
},
|
|
567
|
-
insert:
|
|
564
|
+
insert: g,
|
|
568
565
|
recalculate: () => {
|
|
569
|
-
|
|
566
|
+
v(t.all().map((a) => a.target), !0), r.emit("recalculate");
|
|
570
567
|
},
|
|
571
|
-
remove:
|
|
572
|
-
set:
|
|
573
|
-
size: () =>
|
|
574
|
-
update:
|
|
575
|
-
on: (
|
|
568
|
+
remove: S,
|
|
569
|
+
set: v,
|
|
570
|
+
size: () => s.all().length,
|
|
571
|
+
update: m,
|
|
572
|
+
on: (a, u) => r.on(a, u)
|
|
576
573
|
};
|
|
577
574
|
}, de = (t, e) => {
|
|
578
|
-
const o =
|
|
575
|
+
const o = Rt(), i = le(
|
|
579
576
|
o,
|
|
580
577
|
t,
|
|
581
578
|
e.mergeHighlights?.horizontalTolerance,
|
|
582
|
-
e.mergeHighlights?.verticalTolerance
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
},
|
|
596
|
-
const
|
|
597
|
-
o.updateTarget(
|
|
598
|
-
},
|
|
599
|
-
const
|
|
600
|
-
o.bulkUpdateTargets(
|
|
579
|
+
e.mergeHighlights?.verticalTolerance
|
|
580
|
+
), s = wt(o, e.userSelectAction, e.adapter), n = xt(o), r = Lt(), c = (b, a = F.LOCAL) => {
|
|
581
|
+
const u = it(b, t, e.selectorReviveFn), p = P(u.target.selector);
|
|
582
|
+
return p && o.addAnnotation(u, a), p;
|
|
583
|
+
}, l = (b) => {
|
|
584
|
+
const a = b.map((p) => it(p, t, e.selectorReviveFn)), u = a.filter((p) => !P(p.target.selector));
|
|
585
|
+
return { revived: a, couldNotRevive: u };
|
|
586
|
+
}, h = (b, a = F.LOCAL) => {
|
|
587
|
+
const { revived: u, couldNotRevive: p } = l(b);
|
|
588
|
+
return o.syncAnnotations(u, a), p;
|
|
589
|
+
}, g = (b, a = F.LOCAL) => {
|
|
590
|
+
const { revived: u, couldNotRevive: p } = l(b);
|
|
591
|
+
return o.bulkUpsertAnnotations(u, a), p;
|
|
592
|
+
}, S = (b, a = !0, u = F.LOCAL) => a ? h(b, u) : g(b, u), m = (b, a = F.LOCAL) => {
|
|
593
|
+
const u = J(b, t);
|
|
594
|
+
o.updateTarget(u, a);
|
|
595
|
+
}, v = (b, a = F.LOCAL) => {
|
|
596
|
+
const u = b.map((p) => J(p, t));
|
|
597
|
+
o.bulkUpdateTargets(u, a);
|
|
601
598
|
};
|
|
602
|
-
function
|
|
603
|
-
const
|
|
604
|
-
if (
|
|
605
|
-
return
|
|
599
|
+
function d(b, a, u, p) {
|
|
600
|
+
const E = u || !!p, L = i.getAt(b, a, E).map((T) => o.getAnnotation(T)).filter(Boolean), y = p ? L.filter(p) : L;
|
|
601
|
+
if (y.length !== 0)
|
|
602
|
+
return u ? y : y[0];
|
|
606
603
|
}
|
|
607
|
-
const R = (
|
|
608
|
-
return o.observe(({ changes:
|
|
609
|
-
const
|
|
610
|
-
|
|
604
|
+
const R = (b) => i.getAnnotationRects(b).length > 0 ? i.getAnnotationBounds(b) : void 0, w = (b, a, u, p) => i.getIntersecting(b, a, u, p), A = (b) => i.getAnnotationRects(b), N = () => i.recalculate(), x = (b) => i.on("recalculate", b);
|
|
605
|
+
return o.observe(({ changes: b }) => {
|
|
606
|
+
const a = (b.deleted || []).filter((E) => P(E.target.selector)), u = (b.created || []).filter((E) => P(E.target.selector)), p = (b.updated || []).filter((E) => P(E.newValue.target.selector));
|
|
607
|
+
a?.length > 0 && a.forEach((E) => i.remove(E.target)), u.length > 0 && i.set(u.map((E) => E.target), !1), p?.length > 0 && p.forEach(({ newValue: E }) => i.update(E.target));
|
|
611
608
|
}), {
|
|
612
609
|
store: {
|
|
613
610
|
...o,
|
|
614
|
-
addAnnotation:
|
|
615
|
-
bulkAddAnnotations:
|
|
616
|
-
bulkUpdateTargets:
|
|
617
|
-
bulkUpsertAnnotations:
|
|
611
|
+
addAnnotation: c,
|
|
612
|
+
bulkAddAnnotations: S,
|
|
613
|
+
bulkUpdateTargets: v,
|
|
614
|
+
bulkUpsertAnnotations: g,
|
|
618
615
|
getAnnotationBounds: R,
|
|
619
|
-
getAnnotationRects:
|
|
620
|
-
getIntersecting:
|
|
621
|
-
getAt:
|
|
616
|
+
getAnnotationRects: A,
|
|
617
|
+
getIntersecting: w,
|
|
618
|
+
getAt: d,
|
|
622
619
|
recalculatePositions: N,
|
|
623
|
-
onRecalculatePositions:
|
|
624
|
-
|
|
620
|
+
onRecalculatePositions: x,
|
|
621
|
+
syncAnnotations: h,
|
|
622
|
+
updateTarget: m
|
|
625
623
|
},
|
|
626
624
|
selection: s,
|
|
627
625
|
hover: n,
|
|
628
626
|
viewport: r
|
|
629
627
|
};
|
|
630
|
-
}, ct = 300,
|
|
631
|
-
...
|
|
632
|
-
|
|
628
|
+
}, ct = 300, Et = ["up", "down", "left", "right"], bt = ft ? "⌘+a" : "ctrl+a", ue = [
|
|
629
|
+
...Et.map((t) => `shift+${t}`),
|
|
630
|
+
bt
|
|
633
631
|
], fe = (t, e, o, i) => {
|
|
634
632
|
const { store: s, selection: n } = e;
|
|
635
633
|
let r;
|
|
636
634
|
const {
|
|
637
|
-
annotatingEnabled:
|
|
638
|
-
offsetReferenceSelector:
|
|
639
|
-
selectionMode:
|
|
640
|
-
dismissOnNotAnnotatable:
|
|
635
|
+
annotatingEnabled: c,
|
|
636
|
+
offsetReferenceSelector: l,
|
|
637
|
+
selectionMode: h,
|
|
638
|
+
dismissOnNotAnnotatable: g = "NEVER"
|
|
641
639
|
} = i;
|
|
642
|
-
let
|
|
643
|
-
const
|
|
644
|
-
|
|
645
|
-
},
|
|
646
|
-
if (
|
|
640
|
+
let S, m = c, v = "CREATE_NEW", d, R, w, A;
|
|
641
|
+
const N = (f) => {
|
|
642
|
+
m = f, E.clear(), f || (R = void 0, d = void 0, w = void 0, A = void 0);
|
|
643
|
+
}, x = (f) => v = f || "CREATE_NEW", b = (f) => S = f, a = (f) => r = f, u = (f) => {
|
|
644
|
+
if (v === "ADD_TO_CURRENT")
|
|
647
645
|
return !0;
|
|
648
646
|
if (i.allowModifierSelect) {
|
|
649
|
-
const C =
|
|
647
|
+
const C = f;
|
|
650
648
|
return ft ? C.metaKey : C.ctrlKey;
|
|
651
649
|
} else
|
|
652
650
|
return !1;
|
|
653
651
|
}, p = () => {
|
|
654
|
-
if (!
|
|
655
|
-
const { selected:
|
|
656
|
-
if ((
|
|
657
|
-
const M = s.getAnnotation(
|
|
652
|
+
if (!m || w === !1) return;
|
|
653
|
+
const { selected: f } = n;
|
|
654
|
+
if ((u(A) || v === "REPLACE_CURRENT") && f.length === 1 && f[0].editable) {
|
|
655
|
+
const M = s.getAnnotation(f[0].id);
|
|
658
656
|
if (M?.target) {
|
|
659
|
-
|
|
657
|
+
R = M.target, d = {
|
|
660
658
|
annotation: M.id,
|
|
661
659
|
selector: [],
|
|
662
|
-
created:
|
|
663
|
-
creator:
|
|
660
|
+
created: R.created,
|
|
661
|
+
creator: R.creator,
|
|
664
662
|
updated: /* @__PURE__ */ new Date(),
|
|
665
663
|
updatedBy: r
|
|
666
664
|
};
|
|
667
665
|
return;
|
|
668
666
|
}
|
|
669
667
|
}
|
|
670
|
-
|
|
668
|
+
R = void 0, d = {
|
|
671
669
|
annotation: dt(),
|
|
672
670
|
selector: [],
|
|
673
671
|
created: /* @__PURE__ */ new Date(),
|
|
674
672
|
creator: r
|
|
675
673
|
};
|
|
676
|
-
},
|
|
677
|
-
if (!
|
|
674
|
+
}, E = It((f) => {
|
|
675
|
+
if (!m) return;
|
|
678
676
|
const C = document.getSelection();
|
|
679
677
|
if (!C?.anchorNode) return;
|
|
680
|
-
const
|
|
681
|
-
if (
|
|
682
|
-
|
|
678
|
+
const I = W().map((k) => Wt(k, t));
|
|
679
|
+
if (I.every((k) => !mt(t, k))) {
|
|
680
|
+
d = void 0;
|
|
683
681
|
return;
|
|
684
682
|
}
|
|
685
|
-
const
|
|
686
|
-
if (A?.type === "pointerdown" && (
|
|
683
|
+
const D = f.timeStamp - (A?.timeStamp || f.timeStamp);
|
|
684
|
+
if (A?.type === "pointerdown" && (D < 1e3 && !d || C.isCollapsed && D < ct) && p(), !d && (p(), !d))
|
|
687
685
|
return;
|
|
688
686
|
if (C.isCollapsed) {
|
|
689
|
-
s.getAnnotation(
|
|
687
|
+
s.getAnnotation(d.annotation) && !(u(A) || v === "REPLACE_CURRENT") && (n.clear(), s.deleteAnnotation(d.annotation));
|
|
690
688
|
return;
|
|
691
689
|
}
|
|
692
|
-
if (
|
|
693
|
-
const B =
|
|
694
|
-
if (!(B.length > 0 && !
|
|
695
|
-
const j =
|
|
696
|
-
...
|
|
690
|
+
if (I.every((k) => Ht(k))) return;
|
|
691
|
+
const B = I.flatMap((k) => Kt(t, k.cloneRange()));
|
|
692
|
+
if (!(B.length > 0 && !d || B.length !== d.selector.length || B.some((k, Y) => k.toString() !== d?.selector[Y]?.quote))) return;
|
|
693
|
+
const j = u(A) && R ? Pt([
|
|
694
|
+
...R.selector.map((k) => k.range),
|
|
697
695
|
...B
|
|
698
696
|
]) : B;
|
|
699
|
-
|
|
700
|
-
...
|
|
701
|
-
selector: j.map((
|
|
697
|
+
d = {
|
|
698
|
+
...d,
|
|
699
|
+
selector: j.map((k) => Yt(k, t, l)),
|
|
702
700
|
updated: /* @__PURE__ */ new Date()
|
|
703
|
-
}, !(
|
|
704
|
-
}, 10),
|
|
705
|
-
A =
|
|
706
|
-
},
|
|
707
|
-
if (!
|
|
708
|
-
const C =
|
|
709
|
-
const { x:
|
|
701
|
+
}, !(u(A) || v === "REPLACE_CURRENT") && (s.getAnnotation(d.annotation) ? s.updateTarget(d, F.LOCAL) : n.clear());
|
|
702
|
+
}, 10), L = (f) => {
|
|
703
|
+
A = tt(f), w = A.button === 0;
|
|
704
|
+
}, y = async (f) => {
|
|
705
|
+
if (!w) return;
|
|
706
|
+
const C = tt(f), M = () => {
|
|
707
|
+
const { x: D, y: B } = t.getBoundingClientRect();
|
|
710
708
|
if (Z(t, C.target)) {
|
|
711
|
-
(typeof
|
|
709
|
+
(typeof g == "function" ? g(C, t) : g === "ALWAYS") && n.clear();
|
|
712
710
|
return;
|
|
713
711
|
}
|
|
714
|
-
const
|
|
715
|
-
C.clientX -
|
|
712
|
+
const H = C.target instanceof Node && t.contains(C.target) && s.getAt(
|
|
713
|
+
C.clientX - D,
|
|
716
714
|
C.clientY - B,
|
|
717
|
-
|
|
718
|
-
|
|
715
|
+
h === "all",
|
|
716
|
+
S
|
|
719
717
|
);
|
|
720
|
-
if (
|
|
721
|
-
const { selected: j } = n,
|
|
722
|
-
(
|
|
718
|
+
if (H) {
|
|
719
|
+
const { selected: j } = n, k = new Set(j.map((X) => X.id)), Y = Array.isArray(H) ? H.map((X) => X.id) : [H.id];
|
|
720
|
+
(k.size !== Y.length || !Y.every((X) => k.has(X))) && (o.emit("clickAnnotation", H), n.userSelect(Y, C));
|
|
723
721
|
} else
|
|
724
722
|
n.clear();
|
|
725
723
|
};
|
|
726
724
|
if (C.timeStamp - (A?.timeStamp || 0) < ct) {
|
|
727
|
-
await
|
|
728
|
-
const
|
|
729
|
-
if (
|
|
730
|
-
|
|
725
|
+
await T();
|
|
726
|
+
const D = document.getSelection(), B = Z(t, A?.target), H = Z(t, C.target);
|
|
727
|
+
if (D?.isCollapsed || B && H) {
|
|
728
|
+
d = void 0, M();
|
|
731
729
|
return;
|
|
732
730
|
}
|
|
733
731
|
}
|
|
734
|
-
|
|
735
|
-
},
|
|
736
|
-
const
|
|
737
|
-
let C = !1, M =
|
|
738
|
-
const
|
|
739
|
-
return setTimeout(() => C = !0, 50),
|
|
740
|
-
},
|
|
741
|
-
document.getSelection()?.isCollapsed || ((!
|
|
742
|
-
},
|
|
743
|
-
if (
|
|
732
|
+
d && d.selector.length > 0 && ($(), n.userSelect(d.annotation, C));
|
|
733
|
+
}, T = async () => {
|
|
734
|
+
const f = document.getSelection();
|
|
735
|
+
let C = !1, M = f?.isCollapsed;
|
|
736
|
+
const I = () => M || C, D = 1;
|
|
737
|
+
return setTimeout(() => C = !0, 50), Dt(() => M = f?.isCollapsed, D, I);
|
|
738
|
+
}, O = (f) => {
|
|
739
|
+
document.getSelection()?.isCollapsed || ((!d || d.selector.length === 0) && E(f), d && ($(), n.userSelect(d.annotation, tt(f))));
|
|
740
|
+
}, _ = (f) => {
|
|
741
|
+
if (m && !f.repeat && W().length !== 0 && f.key === "Shift" && d) {
|
|
744
742
|
const C = document.getSelection();
|
|
745
|
-
C && !C.isCollapsed && (
|
|
743
|
+
C && !C.isCollapsed && ($(), n.userSelect(d.annotation, Q(f)));
|
|
746
744
|
}
|
|
747
|
-
},
|
|
745
|
+
}, V = (f) => {
|
|
748
746
|
const C = () => setTimeout(() => {
|
|
749
|
-
|
|
750
|
-
id:
|
|
747
|
+
d && (d.selector.length > 0 && (n.clear(), s.addAnnotation({
|
|
748
|
+
id: d.annotation,
|
|
751
749
|
bodies: [],
|
|
752
|
-
target:
|
|
753
|
-
}), n.userSelect(
|
|
750
|
+
target: d
|
|
751
|
+
}), n.userSelect(d.annotation, Q(f))), document.removeEventListener("selectionchange", C));
|
|
754
752
|
}, 100);
|
|
755
753
|
document.addEventListener("selectionchange", C), p();
|
|
756
754
|
};
|
|
757
|
-
G(ue.join(","), { element: t, keydown: !0, keyup: !1 }, (
|
|
758
|
-
|
|
759
|
-
}), G(
|
|
760
|
-
A = Q(
|
|
755
|
+
G(ue.join(","), { element: t, keydown: !0, keyup: !1 }, (f) => {
|
|
756
|
+
f.repeat || (A = Q(f));
|
|
757
|
+
}), G(bt, { keydown: !0, keyup: !1 }, (f) => {
|
|
758
|
+
A = Q(f), V(f);
|
|
761
759
|
});
|
|
762
|
-
const z = (
|
|
763
|
-
|
|
760
|
+
const z = (f) => {
|
|
761
|
+
f.repeat || W().length !== 0 && (d = void 0, n.clear());
|
|
764
762
|
};
|
|
765
|
-
G(
|
|
763
|
+
G(Et.join(","), { keydown: !0, keyup: !1 }, z), document.addEventListener("pointerdown", L), document.addEventListener("pointerup", y), document.addEventListener("contextmenu", O), document.addEventListener("keyup", _), t.addEventListener("selectstart", p), document.addEventListener("selectionchange", E);
|
|
766
764
|
const q = () => {
|
|
767
|
-
|
|
765
|
+
d = void 0, R = void 0, w = void 0, A = void 0, E.clear(), document.removeEventListener("pointerdown", L), document.removeEventListener("pointerup", y), document.removeEventListener("contextmenu", O), document.removeEventListener("keyup", _), t.removeEventListener("selectstart", p), document.removeEventListener("selectionchange", E), G.unbind();
|
|
766
|
+
}, W = () => {
|
|
767
|
+
const f = document.getSelection();
|
|
768
|
+
return f ? Array.from(Array(f.rangeCount).keys()).map((C) => f.getRangeAt(C)).filter((C) => C.intersectsNode(t)) : [];
|
|
768
769
|
}, $ = () => {
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
if (!l) return;
|
|
773
|
-
const u = s.getAnnotation(l.annotation);
|
|
774
|
-
if (!u)
|
|
770
|
+
if (!d) return;
|
|
771
|
+
const f = s.getAnnotation(d.annotation);
|
|
772
|
+
if (!f)
|
|
775
773
|
s.addAnnotation({
|
|
776
|
-
id:
|
|
774
|
+
id: d.annotation,
|
|
777
775
|
bodies: [],
|
|
778
|
-
target:
|
|
776
|
+
target: d
|
|
779
777
|
});
|
|
780
778
|
else {
|
|
781
|
-
const { target: { updated: C } } =
|
|
782
|
-
(!C || !M || C < M) && s.updateTarget(
|
|
779
|
+
const { target: { updated: C } } = f, { updated: M } = d;
|
|
780
|
+
(!C || !M || C < M) && s.updateTarget(d);
|
|
783
781
|
}
|
|
784
782
|
};
|
|
785
783
|
return {
|
|
786
784
|
destroy: q,
|
|
787
|
-
setFilter:
|
|
788
|
-
setUser:
|
|
789
|
-
setAnnotatingEnabled:
|
|
790
|
-
setAnnotatingMode:
|
|
785
|
+
setFilter: b,
|
|
786
|
+
setUser: a,
|
|
787
|
+
setAnnotatingEnabled: N,
|
|
788
|
+
setAnnotatingMode: x
|
|
791
789
|
};
|
|
792
790
|
}, ge = (t) => [
|
|
793
|
-
`background-color:${
|
|
791
|
+
`background-color:${nt(t?.fill || U.fill).alpha(t?.fillOpacity === void 0 ? U.fillOpacity : t.fillOpacity).toHex()}`,
|
|
794
792
|
t?.underlineThickness ? "text-decoration:underline" : void 0,
|
|
795
793
|
t?.underlineColor ? `text-decoration-color:${t.underlineColor}` : void 0,
|
|
796
794
|
t?.underlineOffset ? `text-underline-offset:${t.underlineOffset}px` : void 0,
|
|
@@ -806,139 +804,139 @@ const ft = typeof navigator < "u" && navigator.platform.startsWith("Mac"), gt =
|
|
|
806
804
|
setVisible: (n) => {
|
|
807
805
|
console.log("setVisible not implemented on CSS Custom Highlights renderer");
|
|
808
806
|
},
|
|
809
|
-
redraw: (n, r,
|
|
810
|
-
const
|
|
811
|
-
Array.from(e).filter((
|
|
812
|
-
const
|
|
813
|
-
|
|
814
|
-
const
|
|
815
|
-
return `::highlight(_${
|
|
807
|
+
redraw: (n, r, c, l, h) => {
|
|
808
|
+
const g = new Set(n.map((m) => m.annotation.id));
|
|
809
|
+
Array.from(e).filter((m) => !g.has(m));
|
|
810
|
+
const S = n.map((m) => {
|
|
811
|
+
c ? typeof c == "function" && c(m.annotation, m.state) : m.state?.selected;
|
|
812
|
+
const v = St(m, c);
|
|
813
|
+
return `::highlight(_${m.annotation.id}) { ${ge(v)} }`;
|
|
816
814
|
});
|
|
817
|
-
t.innerHTML =
|
|
818
|
-
`), CSS.highlights.clear(), n.forEach(({ annotation:
|
|
819
|
-
const
|
|
820
|
-
CSS.highlights.set(`_${
|
|
821
|
-
}), e =
|
|
815
|
+
t.innerHTML = S.join(`
|
|
816
|
+
`), CSS.highlights.clear(), n.forEach(({ annotation: m }) => {
|
|
817
|
+
const v = m.target.selector.map((R) => R.range), d = new Highlight(...v);
|
|
818
|
+
CSS.highlights.set(`_${m.id}`, d);
|
|
819
|
+
}), e = g;
|
|
822
820
|
}
|
|
823
821
|
};
|
|
824
|
-
}, pe = (t, e, o) =>
|
|
822
|
+
}, pe = (t, e, o) => yt(me(), t, e, o), he = (t, e) => ({
|
|
825
823
|
...t,
|
|
826
824
|
annotatingEnabled: t.annotatingEnabled ?? e.annotatingEnabled,
|
|
827
825
|
user: t.user || e.user
|
|
828
|
-
}), lt = "SPANS",
|
|
829
|
-
Qt(t),
|
|
826
|
+
}), lt = "SPANS", _e = (t, e = {}) => {
|
|
827
|
+
Qt(t), Ut(t);
|
|
830
828
|
const o = he(e, {
|
|
831
829
|
annotatingEnabled: !0,
|
|
832
|
-
user:
|
|
833
|
-
}), i = de(t, o), { selection: s, viewport: n } = i, r = i.store,
|
|
834
|
-
let
|
|
835
|
-
const
|
|
830
|
+
user: Nt()
|
|
831
|
+
}), i = de(t, o), { selection: s, viewport: n } = i, r = i.store, c = Ot(r), l = kt(i, c, o.adapter);
|
|
832
|
+
let h = o.user;
|
|
833
|
+
const g = typeof o.renderer != "function" ? o.renderer === "CSS_HIGHLIGHTS" ? CSS.highlights ? "CSS_HIGHLIGHTS" : lt : o.renderer || lt : null, S = g === null ? o.renderer(
|
|
836
834
|
t,
|
|
837
835
|
i,
|
|
838
836
|
n
|
|
839
|
-
) :
|
|
837
|
+
) : g === "SPANS" ? ie(
|
|
840
838
|
t,
|
|
841
839
|
i,
|
|
842
840
|
n
|
|
843
|
-
) :
|
|
841
|
+
) : g === "CSS_HIGHLIGHTS" ? pe(
|
|
844
842
|
t,
|
|
845
843
|
i,
|
|
846
844
|
n
|
|
847
845
|
) : void 0;
|
|
848
|
-
if (!
|
|
846
|
+
if (!S)
|
|
849
847
|
throw `Unknown renderer implementation: ${o.renderer}`;
|
|
850
|
-
console.debug(
|
|
851
|
-
const
|
|
848
|
+
console.debug(g ? `Using ${g} renderer` : "Using custom renderer implementation"), o.style && S.setStyle(o.style);
|
|
849
|
+
const m = fe(
|
|
852
850
|
t,
|
|
853
851
|
i,
|
|
854
|
-
|
|
852
|
+
l,
|
|
855
853
|
o
|
|
856
854
|
);
|
|
857
|
-
|
|
858
|
-
const
|
|
859
|
-
|
|
860
|
-
|
|
855
|
+
m.setUser(h);
|
|
856
|
+
const v = Mt(i, c, o.adapter), d = () => h, R = (a) => {
|
|
857
|
+
m.setAnnotatingEnabled(
|
|
858
|
+
a === void 0 ? !0 : a
|
|
861
859
|
);
|
|
862
|
-
},
|
|
863
|
-
|
|
864
|
-
}, A = (
|
|
865
|
-
|
|
866
|
-
},
|
|
867
|
-
|
|
868
|
-
},
|
|
869
|
-
|
|
860
|
+
}, w = (a) => {
|
|
861
|
+
m.setAnnotatingMode(a);
|
|
862
|
+
}, A = (a) => {
|
|
863
|
+
S.setFilter(a), m.setFilter(a);
|
|
864
|
+
}, N = (a) => {
|
|
865
|
+
h = a, m.setUser(a);
|
|
866
|
+
}, x = (a) => {
|
|
867
|
+
a ? s.setSelected(a) : s.clear();
|
|
870
868
|
};
|
|
871
869
|
return {
|
|
872
|
-
...
|
|
870
|
+
...v,
|
|
873
871
|
destroy: () => {
|
|
874
|
-
|
|
872
|
+
S.destroy(), m.destroy(), c.destroy();
|
|
875
873
|
},
|
|
876
874
|
element: t,
|
|
877
|
-
getUser:
|
|
878
|
-
renderer:
|
|
879
|
-
setAnnotatingEnabled:
|
|
880
|
-
setAnnotatingMode:
|
|
875
|
+
getUser: d,
|
|
876
|
+
renderer: S,
|
|
877
|
+
setAnnotatingEnabled: R,
|
|
878
|
+
setAnnotatingMode: w,
|
|
881
879
|
setFilter: A,
|
|
882
|
-
setStyle:
|
|
883
|
-
setUser:
|
|
884
|
-
setSelected:
|
|
885
|
-
setVisible:
|
|
886
|
-
on:
|
|
887
|
-
off:
|
|
880
|
+
setStyle: S.setStyle.bind(S),
|
|
881
|
+
setUser: N,
|
|
882
|
+
setSelected: x,
|
|
883
|
+
setVisible: S.setVisible.bind(S),
|
|
884
|
+
on: l.on,
|
|
885
|
+
off: l.off,
|
|
888
886
|
scrollIntoView: Vt(t, r),
|
|
889
887
|
state: i
|
|
890
888
|
};
|
|
891
889
|
};
|
|
892
890
|
export {
|
|
893
|
-
|
|
891
|
+
st as DEFAULT_SELECTED_STYLE,
|
|
894
892
|
U as DEFAULT_STYLE,
|
|
895
893
|
gt as NOT_ANNOTATABLE_CLASS,
|
|
896
|
-
|
|
894
|
+
K as NOT_ANNOTATABLE_SELECTOR,
|
|
897
895
|
De as Origin,
|
|
898
896
|
He as UserSelectAction,
|
|
899
897
|
Oe as W3CTextFormat,
|
|
900
898
|
Qt as cancelSingleClickEvents,
|
|
901
899
|
Q as cloneKeyboardEvent,
|
|
902
|
-
|
|
903
|
-
|
|
900
|
+
tt as clonePointerEvent,
|
|
901
|
+
St as computeStyle,
|
|
904
902
|
Jt as computeZIndex,
|
|
905
903
|
Pe as createBody,
|
|
906
|
-
|
|
904
|
+
yt as createRenderer,
|
|
907
905
|
fe as createSelectionHandler,
|
|
908
906
|
ie as createSpansRenderer,
|
|
909
|
-
|
|
907
|
+
_e as createTextAnnotator,
|
|
910
908
|
de as createTextAnnotatorState,
|
|
911
|
-
|
|
909
|
+
et as debounce,
|
|
912
910
|
he as fillDefaults,
|
|
913
911
|
Zt as getBackgroundColor,
|
|
914
912
|
te as getHighlightClientRects,
|
|
915
|
-
|
|
916
|
-
|
|
913
|
+
$t as getQuoteContext,
|
|
914
|
+
ot as getRangeAnnotatableContents,
|
|
917
915
|
ae as getViewportBounds,
|
|
918
916
|
ft as isMac,
|
|
919
917
|
Ne as isNodeWhitespaceOrEmpty,
|
|
920
918
|
Z as isNotAnnotatable,
|
|
921
919
|
mt as isRangeAnnotatable,
|
|
922
|
-
|
|
923
|
-
|
|
920
|
+
Ht as isRangeWhitespaceOrEmpty,
|
|
921
|
+
P as isRevived,
|
|
924
922
|
xe as isRevivedAnnotation,
|
|
925
923
|
Le as isRevivedTarget,
|
|
926
924
|
oe as mergeClientRects,
|
|
927
|
-
|
|
925
|
+
Pt as mergeRanges,
|
|
928
926
|
jt as parseW3CTextAnnotation,
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
927
|
+
Ut as programmaticallyFocusable,
|
|
928
|
+
Yt as rangeToSelector,
|
|
929
|
+
it as reviveAnnotation,
|
|
932
930
|
J as reviveTarget,
|
|
933
|
-
|
|
931
|
+
Xt as reviveTextSelector,
|
|
934
932
|
Vt as scrollIntoView,
|
|
935
933
|
Gt as serializeW3CTextAnnotation,
|
|
936
|
-
|
|
934
|
+
Kt as splitAnnotatableRanges,
|
|
937
935
|
ke as toDomRectList,
|
|
938
936
|
se as toParentBounds,
|
|
939
|
-
|
|
937
|
+
Me as toViewportBounds,
|
|
940
938
|
ce as trackViewport,
|
|
941
|
-
|
|
939
|
+
Wt as trimRangeToContainer,
|
|
942
940
|
pt as whitespaceOrEmptyRegex
|
|
943
941
|
};
|
|
944
942
|
//# sourceMappingURL=text-annotator.es.js.map
|