@soomo/react-text-annotator 3.1.0-staging.22 → 3.1.0-staging.24

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.
Files changed (71) hide show
  1. package/dist/TextAnnotationPopup/TextAnnotationPopup.d.ts.map +1 -1
  2. package/dist/hooks/useAnnotationQuoteIdling.d.ts.map +1 -1
  3. package/dist/index.d.ts +1 -1
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/react-text-annotator.css +1 -31
  6. package/dist/react-text-annotator.es.js +245 -21
  7. package/dist/react-text-annotator.es.js.map +1 -1
  8. package/dist/tei/CETEIcean.d.ts +1 -0
  9. package/dist/tei/CETEIcean.d.ts.map +1 -1
  10. package/dist/tei/TEIAnnotator.d.ts.map +1 -1
  11. package/package.json +13 -12
  12. package/dist/react-text-annotator.es11.js +0 -490
  13. package/dist/react-text-annotator.es11.js.map +0 -1
  14. package/dist/react-text-annotator.es12.js +0 -85
  15. package/dist/react-text-annotator.es12.js.map +0 -1
  16. package/dist/react-text-annotator.es13.js +0 -48
  17. package/dist/react-text-annotator.es13.js.map +0 -1
  18. package/dist/react-text-annotator.es14.js +0 -28
  19. package/dist/react-text-annotator.es14.js.map +0 -1
  20. package/dist/react-text-annotator.es15.js +0 -1600
  21. package/dist/react-text-annotator.es15.js.map +0 -1
  22. package/dist/react-text-annotator.es16.js +0 -12
  23. package/dist/react-text-annotator.es16.js.map +0 -1
  24. package/dist/react-text-annotator.es18.js +0 -285
  25. package/dist/react-text-annotator.es18.js.map +0 -1
  26. package/dist/react-text-annotator.es19.js +0 -590
  27. package/dist/react-text-annotator.es19.js.map +0 -1
  28. package/dist/react-text-annotator.es2.js +0 -64
  29. package/dist/react-text-annotator.es2.js.map +0 -1
  30. package/dist/react-text-annotator.es20.js +0 -5
  31. package/dist/react-text-annotator.es20.js.map +0 -1
  32. package/dist/react-text-annotator.es21.js +0 -34
  33. package/dist/react-text-annotator.es21.js.map +0 -1
  34. package/dist/react-text-annotator.es22.js +0 -901
  35. package/dist/react-text-annotator.es22.js.map +0 -1
  36. package/dist/react-text-annotator.es23.js +0 -5
  37. package/dist/react-text-annotator.es23.js.map +0 -1
  38. package/dist/react-text-annotator.es24.js +0 -5
  39. package/dist/react-text-annotator.es24.js.map +0 -1
  40. package/dist/react-text-annotator.es25.js +0 -117
  41. package/dist/react-text-annotator.es25.js.map +0 -1
  42. package/dist/react-text-annotator.es26.js +0 -312
  43. package/dist/react-text-annotator.es26.js.map +0 -1
  44. package/dist/react-text-annotator.es27.js +0 -61
  45. package/dist/react-text-annotator.es27.js.map +0 -1
  46. package/dist/react-text-annotator.es28.js +0 -23
  47. package/dist/react-text-annotator.es28.js.map +0 -1
  48. package/dist/react-text-annotator.es29.js +0 -130
  49. package/dist/react-text-annotator.es29.js.map +0 -1
  50. package/dist/react-text-annotator.es3.js +0 -29
  51. package/dist/react-text-annotator.es3.js.map +0 -1
  52. package/dist/react-text-annotator.es30.js +0 -167
  53. package/dist/react-text-annotator.es30.js.map +0 -1
  54. package/dist/react-text-annotator.es31.js +0 -314
  55. package/dist/react-text-annotator.es31.js.map +0 -1
  56. package/dist/react-text-annotator.es32.js +0 -152
  57. package/dist/react-text-annotator.es32.js.map +0 -1
  58. package/dist/react-text-annotator.es33.js +0 -629
  59. package/dist/react-text-annotator.es33.js.map +0 -1
  60. package/dist/react-text-annotator.es4.js +0 -43
  61. package/dist/react-text-annotator.es4.js.map +0 -1
  62. package/dist/react-text-annotator.es5.js +0 -48
  63. package/dist/react-text-annotator.es5.js.map +0 -1
  64. package/dist/react-text-annotator.es6.js +0 -29
  65. package/dist/react-text-annotator.es6.js.map +0 -1
  66. package/dist/react-text-annotator.es7.js +0 -151
  67. package/dist/react-text-annotator.es7.js.map +0 -1
  68. package/dist/react-text-annotator.es8.js +0 -562
  69. package/dist/react-text-annotator.es8.js.map +0 -1
  70. package/dist/react-text-annotator.es9.js +0 -13
  71. package/dist/react-text-annotator.es9.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"react-text-annotator.es8.js","sources":["../../../node_modules/@recogito/text-annotator/dist/text-annotator.es.js"],"sourcesContent":["const re = \"not-annotatable\", tt = `.${re}`, it = (t) => {\n var n;\n return !!(t instanceof HTMLElement ? t.closest(tt) : (n = t.parentElement) == null ? void 0 : n.closest(tt));\n}, Ce = (t) => {\n const e = t.commonAncestorContainer;\n return !it(e);\n}, Le = (t) => t.addEventListener(\"click\", (e) => {\n // Allow clicks within not-annotatable elements\n !e.target.closest(tt) && !e.target.closest(\"a\") && e.preventDefault();\n}), At = (t) => ({\n ...t,\n type: t.type,\n x: t.x,\n y: t.y,\n clientX: t.clientX,\n clientY: t.clientY,\n offsetX: t.offsetX,\n offsetY: t.offsetY,\n screenX: t.screenX,\n screenY: t.screenY,\n isPrimary: t.isPrimary,\n altKey: t.altKey,\n ctrlKey: t.ctrlKey,\n metaKey: t.metaKey,\n shiftKey: t.shiftKey,\n button: t.button,\n buttons: t.buttons,\n currentTarget: t.currentTarget,\n target: t.target,\n defaultPrevented: t.defaultPrevented,\n detail: t.detail,\n eventPhase: t.eventPhase,\n pointerId: t.pointerId,\n pointerType: t.pointerType,\n timeStamp: t.timeStamp\n}), ft = (t) => ({\n ...t,\n type: t.type,\n key: t.key,\n code: t.code,\n location: t.location,\n repeat: t.repeat,\n altKey: t.altKey,\n ctrlKey: t.ctrlKey,\n metaKey: t.metaKey,\n shiftKey: t.shiftKey,\n currentTarget: t.currentTarget,\n target: t.target,\n defaultPrevented: t.defaultPrevented,\n detail: t.detail,\n timeStamp: t.timeStamp\n}), Te = /mac/i.test(navigator.userAgentData ? navigator.userAgentData.platform : navigator.platform), Oe = (t) => {\n !t.hasAttribute(\"tabindex\") && t.tabIndex < 0 && t.setAttribute(\"tabindex\", \"-1\"), t.classList.add(\"no-focus-outline\");\n}, Yt = (t, e = 10) => {\n let n;\n return (...o) => {\n clearTimeout(n), n = setTimeout(() => t.apply(void 0, o), e);\n };\n}, Me = function* (t) {\n const e = document.createNodeIterator(\n t.commonAncestorContainer,\n NodeFilter.SHOW_ELEMENT,\n (o) => o instanceof HTMLElement && o.classList.contains(re) && !o.parentElement.closest(tt) && t.intersectsNode(o) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP\n );\n let n;\n for (; n = e.nextNode(); )\n n instanceof HTMLElement && (yield n);\n}, Be = (t) => {\n if (!Ce(t)) return [];\n const e = [];\n let n = null;\n for (const o of Me(t)) {\n let i;\n n ? (i = document.createRange(), i.setStartAfter(n), i.setEndBefore(o)) : (i = t.cloneRange(), i.setEndBefore(o)), i.collapsed || e.push(i), n = o;\n }\n if (n) {\n const o = t.cloneRange();\n o.setStartAfter(n), o.collapsed || e.push(o);\n }\n return e.length > 0 ? e : [t];\n}, Nt = (t) => {\n const e = t.cloneContents();\n return e.querySelectorAll(tt).forEach((n) => n.remove()), e;\n}, Re = (t, e, n = 10, o) => {\n const i = o ? t.startContainer.parentElement.closest(o) : e, s = document.createRange();\n s.setStart(i, 0), s.setEnd(t.startContainer, t.startOffset);\n const a = Nt(s).textContent, r = document.createRange();\n r.setStart(t.endContainer, t.endOffset), i === document.body ? r.setEnd(i, i.childNodes.length) : r.setEndAfter(i);\n const l = Nt(r).textContent;\n return {\n prefix: a.substring(a.length - n),\n suffix: l.substring(0, n)\n };\n}, F = (t) => t.every((e) => e.range instanceof Range && !e.range.collapsed), ke = /^\\s*$/, Ie = (t) => ke.test(t.toString()), _e = (t, e) => {\n const n = (s) => Math.round(s * 10) / 10, o = {\n top: n(t.top),\n bottom: n(t.bottom),\n left: n(t.left),\n right: n(t.right)\n }, i = {\n top: n(e.top),\n bottom: n(e.bottom),\n left: n(e.left),\n right: n(e.right)\n };\n if (Math.abs(o.top - i.top) < 0.5 && Math.abs(o.bottom - i.bottom) < 0.5) {\n if (Math.abs(o.left - i.right) < 0.5 || Math.abs(o.right - i.left) < 0.5)\n return \"inline-adjacent\";\n if (o.left >= i.left && o.right <= i.right)\n return \"inline-is-contained\";\n if (o.left <= i.left && o.right >= i.right)\n return \"inline-contains\";\n } else if (o.top <= i.top && o.bottom >= i.bottom) {\n if (o.left <= i.left && o.right >= i.right)\n return \"block-contains\";\n } else if (o.top >= i.top && o.bottom <= i.bottom && o.left >= i.left && o.right <= i.right)\n return \"block-is-contained\";\n}, Ne = (t, e) => {\n const n = Math.min(t.left, e.left), o = Math.max(t.right, e.right), i = Math.min(t.top, e.top), s = Math.max(t.bottom, e.bottom);\n return new DOMRect(n, i, o - n, s - i);\n}, Ue = (t) => t.reduce((e, n) => {\n if (n.width === 0 || n.height === 0)\n return e;\n let o = [...e], i = !1;\n for (const s of e) {\n const a = _e(n, s);\n if (a === \"inline-adjacent\") {\n o = o.map((r) => r === s ? Ne(n, s) : r), i = !0;\n break;\n } else if (a === \"inline-contains\") {\n o = o.map((r) => r === s ? n : r), i = !0;\n break;\n } else if (a === \"inline-is-contained\") {\n i = !0;\n break;\n } else if (a === \"block-contains\" || a === \"block-is-contained\") {\n n.width < s.width && (o = o.map((r) => r === s ? n : r)), i = !0;\n break;\n }\n }\n return i ? o : [...o, n];\n}, []), Ve = (t, e, n) => {\n const o = document.createRange(), i = n ? t.startContainer.parentElement.closest(n) : e;\n o.setStart(i, 0), o.setEnd(t.startContainer, t.startOffset);\n const s = Nt(o).textContent, a = t.toString(), r = s.length || 0, l = r + a.length;\n return n ? { quote: a, start: r, end: l, range: t, offsetReference: i } : { quote: a, start: r, end: l, range: t };\n}, ae = (t, e) => {\n var h, u;\n const { start: n, end: o } = t, i = t.offsetReference || e, s = document.createNodeIterator(\n e,\n NodeFilter.SHOW_TEXT,\n (p) => {\n var g;\n return (g = p.parentElement) != null && g.closest(tt) ? NodeFilter.FILTER_SKIP : NodeFilter.FILTER_ACCEPT;\n }\n );\n let a = 0;\n const r = document.createRange();\n let l = s.nextNode();\n l === null && console.error(\"Could not revive annotation target. Content missing.\");\n let f = !i;\n for (; l !== null; ) {\n if (f || (f = i == null ? void 0 : i.contains(l)), f) {\n const p = ((h = l.textContent) == null ? void 0 : h.length) || 0;\n if (a + p > n) {\n r.setStart(l, n - a);\n break;\n }\n a += p;\n }\n l = s.nextNode();\n }\n for (; l !== null; ) {\n const p = ((u = l.textContent) == null ? void 0 : u.length) || 0;\n if (a + p >= o) {\n r.setEnd(l, o - a);\n break;\n }\n a += p, l = s.nextNode();\n }\n return {\n ...t,\n range: r\n };\n}, bt = (t, e) => F(t.selector) ? t : {\n ...t,\n selector: t.selector.map((n) => n.range instanceof Range && !n.range.collapsed ? n : ae(n, e))\n}, xt = (t, e) => F(t.target.selector) ? t : { ...t, target: bt(t.target, e) }, Ye = (t, e) => {\n const n = t.cloneRange();\n return e.contains(n.startContainer) || n.setStart(e, 0), e.contains(n.endContainer) || n.setEnd(e, e.childNodes.length), n;\n}, ce = (t) => {\n if (t === null)\n return document.scrollingElement;\n const { overflowY: e } = window.getComputedStyle(t);\n return e !== \"visible\" && e !== \"hidden\" && t.scrollHeight > t.clientHeight ? t : ce(t.parentElement);\n}, Ke = (t, e) => (n) => {\n const o = typeof n == \"string\" ? n : n.id, i = (a) => {\n const r = s.getBoundingClientRect(), l = s.clientHeight, f = s.clientWidth, h = a.selector[0].range.getBoundingClientRect(), { width: u, height: p } = e.getAnnotationBounds(o), g = h.top - r.top, b = h.left - r.left, w = s.parentElement ? s.scrollTop : 0, y = s.parentElement ? s.scrollLeft : 0, d = g + w - (l - p) / 2, c = b + y - (f - u) / 2;\n s.scroll({ top: d, left: c, behavior: \"smooth\" });\n }, s = ce(t);\n if (s) {\n const a = e.getAnnotation(o), { range: r } = a.target.selector[0];\n if (r && !r.collapsed)\n return i(a.target), !0;\n {\n const l = bt(a.target, t), { range: f } = l.selector[0];\n if (f && !f.collapsed)\n return i(l), !0;\n }\n }\n return !1;\n}, W = {\n fill: \"rgb(0, 128, 255)\",\n fillOpacity: 0.18\n}, wt = {\n fill: \"rgb(0, 128, 255)\",\n fillOpacity: 0.45\n}, De = (t, e, n, o, i) => {\n var a, r;\n const s = n ? typeof n == \"function\" ? n(t.annotation, t.state, i) || ((a = t.state) != null && a.selected ? wt : W) : n : (r = t.state) != null && r.selected ? wt : W;\n return o && o.paint(t, e) || s;\n}, Xe = (t) => {\n const { top: e, left: n } = t.getBoundingClientRect(), { innerWidth: o, innerHeight: i } = window, s = -n, a = -e, r = o - n, l = i - e;\n return { top: e, left: n, minX: s, minY: a, maxX: r, maxY: l };\n}, Pe = (t) => {\n let e = /* @__PURE__ */ new Set();\n return (o) => {\n const i = o.map((s) => s.id);\n (e.size !== i.length || i.some((s) => !e.has(s))) && t.set(i), e = new Set(i);\n };\n}, Kt = (t, e, n, o) => {\n const { store: i, selection: s, hover: a } = e;\n let r, l, f;\n const h = Pe(n), u = (M) => {\n const { x: L, y: m } = t.getBoundingClientRect(), v = i.getAt(M.clientX - L, M.clientY - m, !1, l);\n v ? a.current !== v.id && (t.classList.add(\"hovered\"), a.set(v.id)) : a.current && (t.classList.remove(\"hovered\"), a.set(null));\n };\n t.addEventListener(\"pointermove\", u);\n const p = (M = !1) => {\n f && f.clear();\n const L = Xe(t), { minX: m, minY: v, maxX: x, maxY: C } = L, B = l ? i.getIntersecting(m, v, x, C).filter(({ annotation: U }) => l(U)) : i.getIntersecting(m, v, x, C), R = s.selected.map(({ id: U }) => U), N = B.map(({ annotation: U, rects: et }) => {\n const q = R.includes(U.id), Se = U.id === a.current;\n return { annotation: U, rects: et, state: { selected: q, hover: Se } };\n });\n o.redraw(N, L, r, f, M), setTimeout(() => h(B.map(({ annotation: U }) => U)), 1);\n }, g = (M) => {\n f = M, p();\n }, b = (M) => {\n r = M, p();\n }, w = (M) => {\n l = M, p(!1);\n }, y = () => p();\n i.observe(y);\n const d = s.subscribe(() => p()), c = () => p(!0);\n document.addEventListener(\"scroll\", c, { capture: !0, passive: !0 });\n const A = Yt(() => {\n i.recalculatePositions(), f && f.reset(), p();\n });\n window.addEventListener(\"resize\", A);\n const E = new ResizeObserver(A);\n E.observe(t);\n const T = { attributes: !0, childList: !0, subtree: !0 }, S = new MutationObserver((M) => {\n M.every((m) => m.target === t || t.contains(m.target)) || p(!0);\n });\n return S.observe(document.body, T), {\n destroy: () => {\n t.removeEventListener(\"pointermove\", u), o.destroy(), i.unobserve(y), d(), document.removeEventListener(\"scroll\", c), window.removeEventListener(\"resize\", A), E.disconnect(), S.disconnect();\n },\n redraw: p,\n setStyle: b,\n setFilter: w,\n setPainter: g,\n setVisible: o.setVisible\n };\n}, $e = () => {\n const t = document.createElement(\"canvas\");\n return t.width = window.innerWidth, t.height = window.innerHeight, t.className = \"r6o-canvas-highlight-layer bg\", t;\n}, He = (t, e) => {\n t.width = window.innerWidth, t.height = window.innerHeight;\n}, je = (t) => {\n t.classList.add(\"r6o-annotatable\");\n const e = $e(), n = e.getContext(\"2d\");\n document.body.appendChild(e);\n const o = (r, l, f, h) => requestAnimationFrame(() => {\n const { width: u, height: p } = e;\n n.clearRect(-0.5, -0.5, u + 1, p + 1), h && h.clear();\n const { top: g, left: b } = l;\n [...r].sort((y, d) => {\n const { annotation: { target: { created: c } } } = y, { annotation: { target: { created: A } } } = d;\n return c.getTime() - A.getTime();\n }).forEach((y) => {\n var E;\n const d = f ? typeof f == \"function\" ? f(y.annotation, y.state) : f : (E = y.state) != null && E.selected ? wt : W, c = h && h.paint(y, l) || d, A = y.rects.map(({ x: T, y: S, width: O, height: M }) => ({\n x: T + b,\n y: S + g,\n width: O,\n height: M\n }));\n if (n.fillStyle = c.fill, n.globalAlpha = c.fillOpacity || 1, A.forEach(\n ({ x: T, y: S, width: O, height: M }) => n.fillRect(T, S, O, M)\n ), c.underlineColor) {\n n.globalAlpha = 1, n.strokeStyle = c.underlineColor, n.lineWidth = c.underlineThickness ?? 1;\n const T = c.underlineOffset ?? 0;\n A.forEach(({ x: S, y: O, width: M, height: L }) => {\n n.beginPath(), n.moveTo(S, O + L + T), n.lineTo(S + M, O + L + T), n.stroke();\n });\n }\n });\n }), i = Yt(() => {\n He(e);\n });\n return window.addEventListener(\"resize\", i), {\n destroy: () => {\n e.remove(), window.removeEventListener(\"resize\", i);\n },\n setVisible: (r) => {\n console.log(\"setVisible not implemented on Canvas renderer\");\n },\n redraw: o\n };\n}, ze = (t, e, n) => Kt(t, e, n, je(t));\nvar Fe = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, j = function(t) {\n return typeof t == \"string\" ? t.length > 0 : typeof t == \"number\";\n}, V = function(t, e, n) {\n return e === void 0 && (e = 0), n === void 0 && (n = Math.pow(10, e)), Math.round(n * t) / n + 0;\n}, X = function(t, e, n) {\n return e === void 0 && (e = 0), n === void 0 && (n = 1), t > n ? n : t > e ? t : e;\n}, le = function(t) {\n return (t = isFinite(t) ? t % 360 : 0) > 0 ? t : t + 360;\n}, Pt = function(t) {\n return { r: X(t.r, 0, 255), g: X(t.g, 0, 255), b: X(t.b, 0, 255), a: X(t.a) };\n}, vt = function(t) {\n return { r: V(t.r), g: V(t.g), b: V(t.b), a: V(t.a, 3) };\n}, We = /^#([0-9a-f]{3,8})$/i, ht = function(t) {\n var e = t.toString(16);\n return e.length < 2 ? \"0\" + e : e;\n}, de = function(t) {\n var e = t.r, n = t.g, o = t.b, i = t.a, s = Math.max(e, n, o), a = s - Math.min(e, n, o), r = a ? s === e ? (n - o) / a : s === n ? 2 + (o - e) / a : 4 + (e - n) / a : 0;\n return { h: 60 * (r < 0 ? r + 6 : r), s: s ? a / s * 100 : 0, v: s / 255 * 100, a: i };\n}, ue = function(t) {\n var e = t.h, n = t.s, o = t.v, i = t.a;\n e = e / 360 * 6, n /= 100, o /= 100;\n var s = Math.floor(e), a = o * (1 - n), r = o * (1 - (e - s) * n), l = o * (1 - (1 - e + s) * n), f = s % 6;\n return { r: 255 * [o, r, a, a, l, o][f], g: 255 * [l, o, o, r, a, a][f], b: 255 * [a, a, l, o, o, r][f], a: i };\n}, $t = function(t) {\n return { h: le(t.h), s: X(t.s, 0, 100), l: X(t.l, 0, 100), a: X(t.a) };\n}, Ht = function(t) {\n return { h: V(t.h), s: V(t.s), l: V(t.l), a: V(t.a, 3) };\n}, jt = function(t) {\n return ue((n = (e = t).s, { h: e.h, s: (n *= ((o = e.l) < 50 ? o : 100 - o) / 100) > 0 ? 2 * n / (o + n) * 100 : 0, v: o + n, a: e.a }));\n var e, n, o;\n}, at = function(t) {\n return { h: (e = de(t)).h, s: (i = (200 - (n = e.s)) * (o = e.v) / 100) > 0 && i < 200 ? n * o / 100 / (i <= 100 ? i : 200 - i) * 100 : 0, l: i / 2, a: e.a };\n var e, n, o, i;\n}, qe = /^hsla?\\(\\s*([+-]?\\d*\\.?\\d+)(deg|rad|grad|turn)?\\s*,\\s*([+-]?\\d*\\.?\\d+)%\\s*,\\s*([+-]?\\d*\\.?\\d+)%\\s*(?:,\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*)?\\)$/i, Ge = /^hsla?\\(\\s*([+-]?\\d*\\.?\\d+)(deg|rad|grad|turn)?\\s+([+-]?\\d*\\.?\\d+)%\\s+([+-]?\\d*\\.?\\d+)%\\s*(?:\\/\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*)?\\)$/i, Qe = /^rgba?\\(\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*,\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*,\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*(?:,\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*)?\\)$/i, Je = /^rgba?\\(\\s*([+-]?\\d*\\.?\\d+)(%)?\\s+([+-]?\\d*\\.?\\d+)(%)?\\s+([+-]?\\d*\\.?\\d+)(%)?\\s*(?:\\/\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*)?\\)$/i, zt = { string: [[function(t) {\n var e = We.exec(t);\n return e ? (t = e[1]).length <= 4 ? { r: parseInt(t[0] + t[0], 16), g: parseInt(t[1] + t[1], 16), b: parseInt(t[2] + t[2], 16), a: t.length === 4 ? V(parseInt(t[3] + t[3], 16) / 255, 2) : 1 } : t.length === 6 || t.length === 8 ? { r: parseInt(t.substr(0, 2), 16), g: parseInt(t.substr(2, 2), 16), b: parseInt(t.substr(4, 2), 16), a: t.length === 8 ? V(parseInt(t.substr(6, 2), 16) / 255, 2) : 1 } : null : null;\n}, \"hex\"], [function(t) {\n var e = Qe.exec(t) || Je.exec(t);\n return e ? e[2] !== e[4] || e[4] !== e[6] ? null : Pt({ r: Number(e[1]) / (e[2] ? 100 / 255 : 1), g: Number(e[3]) / (e[4] ? 100 / 255 : 1), b: Number(e[5]) / (e[6] ? 100 / 255 : 1), a: e[7] === void 0 ? 1 : Number(e[7]) / (e[8] ? 100 : 1) }) : null;\n}, \"rgb\"], [function(t) {\n var e = qe.exec(t) || Ge.exec(t);\n if (!e) return null;\n var n, o, i = $t({ h: (n = e[1], o = e[2], o === void 0 && (o = \"deg\"), Number(n) * (Fe[o] || 1)), s: Number(e[3]), l: Number(e[4]), a: e[5] === void 0 ? 1 : Number(e[5]) / (e[6] ? 100 : 1) });\n return jt(i);\n}, \"hsl\"]], object: [[function(t) {\n var e = t.r, n = t.g, o = t.b, i = t.a, s = i === void 0 ? 1 : i;\n return j(e) && j(n) && j(o) ? Pt({ r: Number(e), g: Number(n), b: Number(o), a: Number(s) }) : null;\n}, \"rgb\"], [function(t) {\n var e = t.h, n = t.s, o = t.l, i = t.a, s = i === void 0 ? 1 : i;\n if (!j(e) || !j(n) || !j(o)) return null;\n var a = $t({ h: Number(e), s: Number(n), l: Number(o), a: Number(s) });\n return jt(a);\n}, \"hsl\"], [function(t) {\n var e = t.h, n = t.s, o = t.v, i = t.a, s = i === void 0 ? 1 : i;\n if (!j(e) || !j(n) || !j(o)) return null;\n var a = function(r) {\n return { h: le(r.h), s: X(r.s, 0, 100), v: X(r.v, 0, 100), a: X(r.a) };\n }({ h: Number(e), s: Number(n), v: Number(o), a: Number(s) });\n return ue(a);\n}, \"hsv\"]] }, Ft = function(t, e) {\n for (var n = 0; n < e.length; n++) {\n var o = e[n][0](t);\n if (o) return [o, e[n][1]];\n }\n return [null, void 0];\n}, Ze = function(t) {\n return typeof t == \"string\" ? Ft(t.trim(), zt.string) : typeof t == \"object\" && t !== null ? Ft(t, zt.object) : [null, void 0];\n}, Et = function(t, e) {\n var n = at(t);\n return { h: n.h, s: X(n.s + 100 * e, 0, 100), l: n.l, a: n.a };\n}, St = function(t) {\n return (299 * t.r + 587 * t.g + 114 * t.b) / 1e3 / 255;\n}, Wt = function(t, e) {\n var n = at(t);\n return { h: n.h, s: n.s, l: X(n.l + 100 * e, 0, 100), a: n.a };\n}, qt = function() {\n function t(e) {\n this.parsed = Ze(e)[0], this.rgba = this.parsed || { r: 0, g: 0, b: 0, a: 1 };\n }\n return t.prototype.isValid = function() {\n return this.parsed !== null;\n }, t.prototype.brightness = function() {\n return V(St(this.rgba), 2);\n }, t.prototype.isDark = function() {\n return St(this.rgba) < 0.5;\n }, t.prototype.isLight = function() {\n return St(this.rgba) >= 0.5;\n }, t.prototype.toHex = function() {\n return e = vt(this.rgba), n = e.r, o = e.g, i = e.b, a = (s = e.a) < 1 ? ht(V(255 * s)) : \"\", \"#\" + ht(n) + ht(o) + ht(i) + a;\n var e, n, o, i, s, a;\n }, t.prototype.toRgb = function() {\n return vt(this.rgba);\n }, t.prototype.toRgbString = function() {\n return e = vt(this.rgba), n = e.r, o = e.g, i = e.b, (s = e.a) < 1 ? \"rgba(\" + n + \", \" + o + \", \" + i + \", \" + s + \")\" : \"rgb(\" + n + \", \" + o + \", \" + i + \")\";\n var e, n, o, i, s;\n }, t.prototype.toHsl = function() {\n return Ht(at(this.rgba));\n }, t.prototype.toHslString = function() {\n return e = Ht(at(this.rgba)), n = e.h, o = e.s, i = e.l, (s = e.a) < 1 ? \"hsla(\" + n + \", \" + o + \"%, \" + i + \"%, \" + s + \")\" : \"hsl(\" + n + \", \" + o + \"%, \" + i + \"%)\";\n var e, n, o, i, s;\n }, t.prototype.toHsv = function() {\n return e = de(this.rgba), { h: V(e.h), s: V(e.s), v: V(e.v), a: V(e.a, 3) };\n var e;\n }, t.prototype.invert = function() {\n return $({ r: 255 - (e = this.rgba).r, g: 255 - e.g, b: 255 - e.b, a: e.a });\n var e;\n }, t.prototype.saturate = function(e) {\n return e === void 0 && (e = 0.1), $(Et(this.rgba, e));\n }, t.prototype.desaturate = function(e) {\n return e === void 0 && (e = 0.1), $(Et(this.rgba, -e));\n }, t.prototype.grayscale = function() {\n return $(Et(this.rgba, -1));\n }, t.prototype.lighten = function(e) {\n return e === void 0 && (e = 0.1), $(Wt(this.rgba, e));\n }, t.prototype.darken = function(e) {\n return e === void 0 && (e = 0.1), $(Wt(this.rgba, -e));\n }, t.prototype.rotate = function(e) {\n return e === void 0 && (e = 15), this.hue(this.hue() + e);\n }, t.prototype.alpha = function(e) {\n return typeof e == \"number\" ? $({ r: (n = this.rgba).r, g: n.g, b: n.b, a: e }) : V(this.rgba.a, 3);\n var n;\n }, t.prototype.hue = function(e) {\n var n = at(this.rgba);\n return typeof e == \"number\" ? $({ h: e, s: n.s, l: n.l, a: n.a }) : V(n.h);\n }, t.prototype.isEqual = function(e) {\n return this.toHex() === $(e).toHex();\n }, t;\n}(), $ = function(t) {\n return t instanceof qt ? t : new qt(t);\n};\nconst tn = (t) => [\n `background-color:${$((t == null ? void 0 : t.fill) || W.fill).alpha((t == null ? void 0 : t.fillOpacity) === void 0 ? W.fillOpacity : t.fillOpacity).toHex()}`,\n t != null && t.underlineThickness ? \"text-decoration:underline\" : void 0,\n t != null && t.underlineColor ? `text-decoration-color:${t.underlineColor}` : void 0,\n t != null && t.underlineOffset ? `text-underline-offset:${t.underlineOffset}px` : void 0,\n t != null && t.underlineThickness ? `text-decoration-thickness:${t.underlineThickness}px` : void 0\n].filter(Boolean).join(\";\"), en = () => {\n const t = document.createElement(\"style\");\n document.getElementsByTagName(\"head\")[0].appendChild(t);\n let e = /* @__PURE__ */ new Set();\n return {\n destroy: () => {\n CSS.highlights.clear(), t.remove();\n },\n setVisible: (s) => {\n console.log(\"setVisible not implemented on CSS Custom Highlights renderer\");\n },\n redraw: (s, a, r, l) => {\n l && l.clear();\n const f = new Set(s.map((u) => u.annotation.id));\n Array.from(e).filter((u) => !f.has(u));\n const h = s.map((u) => {\n var b;\n const p = r ? typeof r == \"function\" ? r(u.annotation, u.state) : r : (b = u.state) != null && b.selected ? wt : W, g = l && l.paint(u, a) || p;\n return `::highlight(_${u.annotation.id}) { ${tn(g)} }`;\n });\n t.innerHTML = h.join(`\n`), CSS.highlights.clear(), s.forEach(({ annotation: u }) => {\n const p = u.target.selector.map((b) => b.range), g = new Highlight(...p);\n CSS.highlights.set(`_${u.id}`, g);\n }), e = f;\n }\n };\n}, nn = (t, e, n) => Kt(t, e, n, en());\nvar Gt = Object.prototype.hasOwnProperty;\nfunction Ut(t, e) {\n var n, o;\n if (t === e) return !0;\n if (t && e && (n = t.constructor) === e.constructor) {\n if (n === Date) return t.getTime() === e.getTime();\n if (n === RegExp) return t.toString() === e.toString();\n if (n === Array) {\n if ((o = t.length) === e.length)\n for (; o-- && Ut(t[o], e[o]); ) ;\n return o === -1;\n }\n if (!n || typeof t == \"object\") {\n o = 0;\n for (n in t)\n if (Gt.call(t, n) && ++o && !Gt.call(e, n) || !(n in e) || !Ut(t[n], e[n])) return !1;\n return Object.keys(e).length === o;\n }\n }\n return t !== t && e !== e;\n}\nconst on = (t, e) => {\n const n = (s, a) => s.x <= a.x + a.width && s.x + s.width >= a.x && s.y <= a.y + a.height && s.y + s.height >= a.y, o = (s) => s.rects.reduce((a, r) => a + r.width, 0), i = e.filter(({ rects: s }) => s.some((a) => n(t, a)));\n return i.sort((s, a) => o(a) - o(s)), i.findIndex((s) => s.rects.includes(t));\n}, sn = (t) => {\n t.classList.add(\"r6o-annotatable\");\n const e = document.createElement(\"div\");\n e.className = \"r6o-span-highlight-layer\", t.insertBefore(e, t.firstChild);\n let n = [];\n return {\n destroy: () => {\n e.remove();\n },\n redraw: (a, r, l, f, h) => {\n const p = !(Ut(n, a) && h);\n if (!f && !p) return;\n p && (e.innerHTML = \"\"), [...a].sort((b, w) => {\n const { annotation: { target: { created: y } } } = b, { annotation: { target: { created: d } } } = w;\n return y && d ? y.getTime() - d.getTime() : 0;\n }).forEach((b) => {\n b.rects.map((w) => {\n const y = on(w, a), d = De(b, r, l, f, y);\n if (p) {\n const c = document.createElement(\"span\");\n c.className = \"r6o-annotation\", c.dataset.annotation = b.annotation.id, c.style.left = `${w.x}px`, c.style.top = `${w.y}px`, c.style.width = `${w.width}px`, c.style.height = `${w.height}px`, c.style.backgroundColor = $((d == null ? void 0 : d.fill) || W.fill).alpha((d == null ? void 0 : d.fillOpacity) === void 0 ? W.fillOpacity : d.fillOpacity).toHex(), d.underlineStyle && (c.style.borderStyle = d.underlineStyle), d.underlineColor && (c.style.borderColor = d.underlineColor), d.underlineThickness && (c.style.borderBottomWidth = `${d.underlineThickness}px`), d.underlineOffset && (c.style.paddingBottom = `${d.underlineOffset}px`), e.appendChild(c);\n }\n });\n }), n = a;\n },\n setVisible: (a) => {\n a ? e.classList.remove(\"hidden\") : e.classList.add(\"hidden\");\n }\n };\n}, rn = (t, e, n) => Kt(t, e, n, sn(t)), Y = [];\nfor (let t = 0; t < 256; ++t)\n Y.push((t + 256).toString(16).slice(1));\nfunction an(t, e = 0) {\n return (Y[t[e + 0]] + Y[t[e + 1]] + Y[t[e + 2]] + Y[t[e + 3]] + \"-\" + Y[t[e + 4]] + Y[t[e + 5]] + \"-\" + Y[t[e + 6]] + Y[t[e + 7]] + \"-\" + Y[t[e + 8]] + Y[t[e + 9]] + \"-\" + Y[t[e + 10]] + Y[t[e + 11]] + Y[t[e + 12]] + Y[t[e + 13]] + Y[t[e + 14]] + Y[t[e + 15]]).toLowerCase();\n}\nlet Ct;\nconst cn = new Uint8Array(16);\nfunction ln() {\n if (!Ct) {\n if (typeof crypto > \"u\" || !crypto.getRandomValues)\n throw new Error(\"crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported\");\n Ct = crypto.getRandomValues.bind(crypto);\n }\n return Ct(cn);\n}\nconst dn = typeof crypto < \"u\" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Qt = { randomUUID: dn };\nfunction fe(t, e, n) {\n if (Qt.randomUUID && !e && !t)\n return Qt.randomUUID();\n t = t || {};\n const o = t.random || (t.rng || ln)();\n return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, an(o);\n}\nvar Jt = Object.prototype.hasOwnProperty;\nfunction G(t, e) {\n var n, o;\n if (t === e) return !0;\n if (t && e && (n = t.constructor) === e.constructor) {\n if (n === Date) return t.getTime() === e.getTime();\n if (n === RegExp) return t.toString() === e.toString();\n if (n === Array) {\n if ((o = t.length) === e.length)\n for (; o-- && G(t[o], e[o]); ) ;\n return o === -1;\n }\n if (!n || typeof t == \"object\") {\n o = 0;\n for (n in t)\n if (Jt.call(t, n) && ++o && !Jt.call(e, n) || !(n in e) || !G(t[n], e[n])) return !1;\n return Object.keys(e).length === o;\n }\n }\n return t !== t && e !== e;\n}\nfunction Lt() {\n}\nfunction un(t, e) {\n return t != t ? e == e : t !== e || t && typeof t == \"object\" || typeof t == \"function\";\n}\nconst Q = [];\nfunction Dt(t, e = Lt) {\n let n;\n const o = /* @__PURE__ */ new Set();\n function i(r) {\n if (un(t, r) && (t = r, n)) {\n const l = !Q.length;\n for (const f of o)\n f[1](), Q.push(f, t);\n if (l) {\n for (let f = 0; f < Q.length; f += 2)\n Q[f][0](Q[f + 1]);\n Q.length = 0;\n }\n }\n }\n function s(r) {\n i(r(t));\n }\n function a(r, l = Lt) {\n const f = [r, l];\n return o.add(f), o.size === 1 && (n = e(i, s) || Lt), r(t), () => {\n o.delete(f), o.size === 0 && n && (n(), n = null);\n };\n }\n return { set: i, update: s, subscribe: a };\n}\nconst fn = (t) => {\n const { subscribe: e, set: n } = Dt();\n let o;\n return e((i) => o = i), t.observe(({ changes: i }) => {\n if (o) {\n (i.deleted || []).some((a) => a.id === o) && n(void 0);\n const s = (i.updated || []).find(({ oldValue: a }) => a.id === o);\n s && n(s.newValue.id);\n }\n }), {\n get current() {\n return o;\n },\n subscribe: e,\n set: n\n };\n};\nvar hn = /* @__PURE__ */ ((t) => (t.EDIT = \"EDIT\", t.SELECT = \"SELECT\", t.NONE = \"NONE\", t))(hn || {});\nconst pt = { selected: [] }, pn = (t, e, n) => {\n const { subscribe: o, set: i } = Dt(pt);\n let s = e, a = pt;\n o((b) => a = b);\n const r = () => {\n G(a, pt) || i(pt);\n }, l = () => {\n var b;\n return ((b = a.selected) == null ? void 0 : b.length) === 0;\n }, f = (b) => {\n if (l())\n return !1;\n const w = typeof b == \"string\" ? b : b.id;\n return a.selected.some((y) => y.id === w);\n }, h = (b, w) => {\n let y;\n if (Array.isArray(b)) {\n if (y = b.map((c) => t.getAnnotation(c)).filter(Boolean), y.length < b.length) {\n console.warn(\"Invalid selection: \" + b.filter((c) => !y.some((A) => A.id === c)));\n return;\n }\n } else {\n const c = t.getAnnotation(b);\n if (!c) {\n console.warn(\"Invalid selection: \" + b);\n return;\n }\n y = [c];\n }\n const d = y.reduce((c, A) => {\n const E = Zt(A, s);\n return E === \"EDIT\" ? [...c, { id: A.id, editable: !0 }] : E === \"SELECT\" ? [...c, { id: A.id }] : c;\n }, []);\n i({ selected: d, event: w });\n }, u = (b, w) => {\n const y = Array.isArray(b) ? b : [b], d = y.map((c) => t.getAnnotation(c)).filter((c) => !!c);\n i({\n selected: d.map((c) => {\n const A = w === void 0 ? Zt(c, s) === \"EDIT\" : w;\n return { id: c.id, editable: A };\n })\n }), d.length !== y.length && console.warn(\"Invalid selection\", b);\n }, p = (b) => {\n if (l())\n return !1;\n const { selected: w } = a;\n w.some(({ id: y }) => b.includes(y)) && i({ selected: w.filter(({ id: y }) => !b.includes(y)) });\n }, g = (b) => s = b;\n return t.observe(\n ({ changes: b }) => p((b.deleted || []).map((w) => w.id))\n ), {\n get event() {\n return a ? a.event : null;\n },\n get selected() {\n return a ? [...a.selected] : null;\n },\n get userSelectAction() {\n return s;\n },\n clear: r,\n isEmpty: l,\n isSelected: f,\n setSelected: u,\n setUserSelectAction: g,\n subscribe: o,\n userSelect: h\n };\n}, Zt = (t, e, n) => typeof e == \"function\" ? e(t) : e || \"EDIT\", K = [];\nfor (let t = 0; t < 256; ++t)\n K.push((t + 256).toString(16).slice(1));\nfunction gn(t, e = 0) {\n return (K[t[e + 0]] + K[t[e + 1]] + K[t[e + 2]] + K[t[e + 3]] + \"-\" + K[t[e + 4]] + K[t[e + 5]] + \"-\" + K[t[e + 6]] + K[t[e + 7]] + \"-\" + K[t[e + 8]] + K[t[e + 9]] + \"-\" + K[t[e + 10]] + K[t[e + 11]] + K[t[e + 12]] + K[t[e + 13]] + K[t[e + 14]] + K[t[e + 15]]).toLowerCase();\n}\nlet Tt;\nconst mn = new Uint8Array(16);\nfunction yn() {\n if (!Tt) {\n if (typeof crypto > \"u\" || !crypto.getRandomValues)\n throw new Error(\"crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported\");\n Tt = crypto.getRandomValues.bind(crypto);\n }\n return Tt(mn);\n}\nconst bn = typeof crypto < \"u\" && crypto.randomUUID && crypto.randomUUID.bind(crypto), te = { randomUUID: bn };\nfunction he(t, e, n) {\n if (te.randomUUID && !e && !t)\n return te.randomUUID();\n t = t || {};\n const o = t.random || (t.rng || yn)();\n return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, gn(o);\n}\nconst Ot = (t) => {\n const e = (n) => {\n const o = { ...n };\n return n.created && typeof n.created == \"string\" && (o.created = new Date(n.created)), n.updated && typeof n.updated == \"string\" && (o.updated = new Date(n.updated)), o;\n };\n return {\n ...t,\n bodies: (t.bodies || []).map(e),\n target: e(t.target)\n };\n}, wo = (t, e, n, o) => ({\n id: he(),\n annotation: typeof t == \"string\" ? t : t.id,\n created: n || /* @__PURE__ */ new Date(),\n creator: o,\n ...e\n}), wn = (t, e) => {\n const n = new Set(t.bodies.map((o) => o.id));\n return e.bodies.filter((o) => !n.has(o.id));\n}, An = (t, e) => {\n const n = new Set(e.bodies.map((o) => o.id));\n return t.bodies.filter((o) => !n.has(o.id));\n}, xn = (t, e) => e.bodies.map((n) => {\n const o = t.bodies.find((i) => i.id === n.id);\n return { newBody: n, oldBody: o && !G(o, n) ? o : void 0 };\n}).filter(({ oldBody: n }) => n).map(({ oldBody: n, newBody: o }) => ({ oldBody: n, newBody: o })), vn = (t, e) => !G(t.target, e.target), pe = (t, e) => {\n const n = wn(t, e), o = An(t, e), i = xn(t, e);\n return {\n oldValue: t,\n newValue: e,\n bodiesCreated: n.length > 0 ? n : void 0,\n bodiesDeleted: o.length > 0 ? o : void 0,\n bodiesUpdated: i.length > 0 ? i : void 0,\n targetUpdated: vn(t, e) ? { oldTarget: t.target, newTarget: e.target } : void 0\n };\n};\nvar k = /* @__PURE__ */ ((t) => (t.LOCAL = \"LOCAL\", t.REMOTE = \"REMOTE\", t.SILENT = \"SILENT\", t))(k || {});\nconst En = (t, e) => {\n var n, o;\n const { changes: i, origin: s } = e;\n if (!(t.options.origin ? t.options.origin === s : s !== \"SILENT\"))\n return !1;\n if (t.options.ignore) {\n const { ignore: a } = t.options, r = (l) => l && l.length > 0;\n if (!(r(i.created) || r(i.deleted))) {\n const l = (n = i.updated) == null ? void 0 : n.some((h) => r(h.bodiesCreated) || r(h.bodiesDeleted) || r(h.bodiesUpdated)), f = (o = i.updated) == null ? void 0 : o.some((h) => h.targetUpdated);\n if (a === \"BODY_ONLY\" && l && !f || a === \"TARGET_ONLY\" && f && !l)\n return !1;\n }\n }\n if (t.options.annotations) {\n const a = /* @__PURE__ */ new Set([\n ...(i.created || []).map((r) => r.id),\n ...(i.deleted || []).map((r) => r.id),\n ...(i.updated || []).map(({ oldValue: r }) => r.id)\n ]);\n return !!(Array.isArray(t.options.annotations) ? t.options.annotations : [t.options.annotations]).find((r) => a.has(r));\n } else\n return !0;\n}, Sn = (t, e) => {\n const n = new Set((t.created || []).map((u) => u.id)), o = new Set((t.updated || []).map(({ newValue: u }) => u.id)), i = new Set((e.created || []).map((u) => u.id)), s = new Set((e.deleted || []).map((u) => u.id)), a = new Set((e.updated || []).map(({ oldValue: u }) => u.id)), r = new Set((e.updated || []).filter(({ oldValue: u }) => n.has(u.id) || o.has(u.id)).map(({ oldValue: u }) => u.id)), l = [\n ...(t.created || []).filter((u) => !s.has(u.id)).map((u) => a.has(u.id) ? e.updated.find(({ oldValue: p }) => p.id === u.id).newValue : u),\n ...e.created || []\n ], f = [\n ...(t.deleted || []).filter((u) => !i.has(u.id)),\n ...(e.deleted || []).filter((u) => !n.has(u.id))\n ], h = [\n ...(t.updated || []).filter(({ newValue: u }) => !s.has(u.id)).map((u) => {\n const { oldValue: p, newValue: g } = u;\n if (a.has(g.id)) {\n const b = e.updated.find((w) => w.oldValue.id === g.id).newValue;\n return pe(p, b);\n } else\n return u;\n }),\n ...(e.updated || []).filter(({ oldValue: u }) => !r.has(u.id))\n ];\n return { created: l, deleted: f, updated: h };\n}, Mt = (t) => {\n const e = t.id === void 0 ? he() : t.id;\n return {\n ...t,\n id: e,\n bodies: t.bodies === void 0 ? [] : t.bodies.map((n) => ({\n ...n,\n annotation: e\n })),\n target: {\n ...t.target,\n annotation: e\n }\n };\n}, Cn = (t) => t.id !== void 0, Ln = () => {\n const t = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Map(), n = [], o = (m, v = {}) => {\n n.push({ onChange: m, options: v });\n }, i = (m) => {\n const v = n.findIndex((x) => x.onChange == m);\n v > -1 && n.splice(v, 1);\n }, s = (m, v) => {\n const x = {\n origin: m,\n changes: {\n created: v.created || [],\n updated: v.updated || [],\n deleted: v.deleted || []\n },\n state: [...t.values()]\n };\n n.forEach((C) => {\n En(C, x) && C.onChange(x);\n });\n }, a = (m, v = k.LOCAL) => {\n if (m.id && t.get(m.id))\n throw Error(`Cannot add annotation ${m.id} - exists already`);\n {\n const x = Mt(m);\n t.set(x.id, x), x.bodies.forEach((C) => e.set(C.id, x.id)), s(v, { created: [x] });\n }\n }, r = (m, v) => {\n const x = Mt(typeof m == \"string\" ? v : m), C = typeof m == \"string\" ? m : m.id, B = C && t.get(C);\n if (B) {\n const R = pe(B, x);\n return C === x.id ? t.set(C, x) : (t.delete(C), t.set(x.id, x)), B.bodies.forEach((N) => e.delete(N.id)), x.bodies.forEach((N) => e.set(N.id, x.id)), R;\n } else\n console.warn(`Cannot update annotation ${C} - does not exist`);\n }, l = (m, v = k.LOCAL, x = k.LOCAL) => {\n const C = Cn(v) ? x : v, B = r(m, v);\n B && s(C, { updated: [B] });\n }, f = (m, v = k.LOCAL) => {\n const x = m.reduce((C, B) => {\n const R = r(B);\n return R ? [...C, R] : C;\n }, []);\n x.length > 0 && s(v, { updated: x });\n }, h = (m, v = k.LOCAL) => {\n const x = t.get(m.annotation);\n if (x) {\n const C = {\n ...x,\n bodies: [...x.bodies, m]\n };\n t.set(x.id, C), e.set(m.id, C.id), s(v, { updated: [{\n oldValue: x,\n newValue: C,\n bodiesCreated: [m]\n }] });\n } else\n console.warn(`Attempt to add body to missing annotation: ${m.annotation}`);\n }, u = () => [...t.values()], p = (m = k.LOCAL) => {\n const v = [...t.values()];\n t.clear(), e.clear(), s(m, { deleted: v });\n }, g = (m, v = !0, x = k.LOCAL) => {\n const C = m.map(Mt);\n if (v) {\n const B = [...t.values()];\n t.clear(), e.clear(), C.forEach((R) => {\n t.set(R.id, R), R.bodies.forEach((N) => e.set(N.id, R.id));\n }), s(x, { created: C, deleted: B });\n } else {\n const B = m.reduce((R, N) => {\n const U = N.id && t.get(N.id);\n return U ? [...R, U] : R;\n }, []);\n if (B.length > 0)\n throw Error(`Bulk insert would overwrite the following annotations: ${B.map((R) => R.id).join(\", \")}`);\n C.forEach((R) => {\n t.set(R.id, R), R.bodies.forEach((N) => e.set(N.id, R.id));\n }), s(x, { created: C });\n }\n }, b = (m) => {\n const v = typeof m == \"string\" ? m : m.id, x = t.get(v);\n if (x)\n return t.delete(v), x.bodies.forEach((C) => e.delete(C.id)), x;\n console.warn(`Attempt to delete missing annotation: ${v}`);\n }, w = (m, v = k.LOCAL) => {\n const x = b(m);\n x && s(v, { deleted: [x] });\n }, y = (m, v = k.LOCAL) => {\n const x = m.reduce((C, B) => {\n const R = b(B);\n return R ? [...C, R] : C;\n }, []);\n x.length > 0 && s(v, { deleted: x });\n }, d = (m) => {\n const v = t.get(m.annotation);\n if (v) {\n const x = v.bodies.find((C) => C.id === m.id);\n if (x) {\n e.delete(x.id);\n const C = {\n ...v,\n bodies: v.bodies.filter((B) => B.id !== m.id)\n };\n return t.set(v.id, C), {\n oldValue: v,\n newValue: C,\n bodiesDeleted: [x]\n };\n } else\n console.warn(`Attempt to delete missing body ${m.id} from annotation ${m.annotation}`);\n } else\n console.warn(`Attempt to delete body from missing annotation ${m.annotation}`);\n }, c = (m, v = k.LOCAL) => {\n const x = d(m);\n x && s(v, { updated: [x] });\n }, A = (m, v = k.LOCAL) => {\n const x = m.map((C) => d(C)).filter(Boolean);\n x.length > 0 && s(v, { updated: x });\n }, E = (m) => {\n const v = t.get(m);\n return v ? { ...v } : void 0;\n }, T = (m) => {\n const v = e.get(m);\n if (v) {\n const x = E(v).bodies.find((C) => C.id === m);\n if (x)\n return x;\n console.error(`Store integrity error: body ${m} in index, but not in annotation`);\n } else\n console.warn(`Attempt to retrieve missing body: ${m}`);\n }, S = (m, v) => {\n if (m.annotation !== v.annotation)\n throw \"Annotation integrity violation: annotation ID must be the same when updating bodies\";\n const x = t.get(m.annotation);\n if (x) {\n const C = x.bodies.find((R) => R.id === m.id), B = {\n ...x,\n bodies: x.bodies.map((R) => R.id === C.id ? v : R)\n };\n return t.set(x.id, B), C.id !== v.id && (e.delete(C.id), e.set(v.id, B.id)), {\n oldValue: x,\n newValue: B,\n bodiesUpdated: [{ oldBody: C, newBody: v }]\n };\n } else\n console.warn(`Attempt to add body to missing annotation ${m.annotation}`);\n }, O = (m, v, x = k.LOCAL) => {\n const C = S(m, v);\n C && s(x, { updated: [C] });\n }, M = (m, v = k.LOCAL) => {\n const x = m.map((C) => S({ id: C.id, annotation: C.annotation }, C)).filter(Boolean);\n s(v, { updated: x });\n }, L = (m) => {\n const v = t.get(m.annotation);\n if (v) {\n const x = {\n ...v,\n target: {\n ...v.target,\n ...m\n }\n };\n return t.set(v.id, x), {\n oldValue: v,\n newValue: x,\n targetUpdated: {\n oldTarget: v.target,\n newTarget: m\n }\n };\n } else\n console.warn(`Attempt to update target on missing annotation: ${m.annotation}`);\n };\n return {\n addAnnotation: a,\n addBody: h,\n all: u,\n bulkAddAnnotation: g,\n bulkDeleteAnnotation: y,\n bulkDeleteBodies: A,\n bulkUpdateAnnotation: f,\n bulkUpdateBodies: M,\n bulkUpdateTargets: (m, v = k.LOCAL) => {\n const x = m.map((C) => L(C)).filter(Boolean);\n x.length > 0 && s(v, { updated: x });\n },\n clear: p,\n deleteAnnotation: w,\n deleteBody: c,\n getAnnotation: E,\n getBody: T,\n observe: o,\n unobserve: i,\n updateAnnotation: l,\n updateBody: O,\n updateTarget: (m, v = k.LOCAL) => {\n const x = L(m);\n x && s(v, { updated: [x] });\n }\n };\n};\nlet Tn = () => ({\n emit(t, ...e) {\n for (let n = this.events[t] || [], o = 0, i = n.length; o < i; o++)\n n[o](...e);\n },\n events: {},\n on(t, e) {\n var n;\n return ((n = this.events)[t] || (n[t] = [])).push(e), () => {\n var o;\n this.events[t] = (o = this.events[t]) == null ? void 0 : o.filter((i) => e !== i);\n };\n }\n});\nconst On = 250, Mn = (t) => {\n const e = Tn(), n = [];\n let o = -1, i = !1, s = 0;\n const a = (g) => {\n if (!i) {\n const { changes: b } = g, w = performance.now();\n if (w - s > On)\n n.splice(o + 1), n.push(b), o = n.length - 1;\n else {\n const y = n.length - 1;\n n[y] = Sn(n[y], b);\n }\n s = w;\n }\n i = !1;\n };\n t.observe(a, { origin: k.LOCAL });\n const r = (g) => g && g.length > 0 && t.bulkDeleteAnnotation(g), l = (g) => g && g.length > 0 && t.bulkAddAnnotation(g, !1), f = (g) => g && g.length > 0 && t.bulkUpdateAnnotation(g.map(({ oldValue: b }) => b)), h = (g) => g && g.length > 0 && t.bulkUpdateAnnotation(g.map(({ newValue: b }) => b)), u = (g) => g && g.length > 0 && t.bulkAddAnnotation(g, !1), p = (g) => g && g.length > 0 && t.bulkDeleteAnnotation(g);\n return {\n canRedo: () => n.length - 1 > o,\n canUndo: () => o > -1,\n destroy: () => t.unobserve(a),\n on: (g, b) => e.on(g, b),\n redo: () => {\n if (n.length - 1 > o) {\n i = !0;\n const { created: g, updated: b, deleted: w } = n[o + 1];\n l(g), h(b), p(w), e.emit(\"redo\", n[o + 1]), o += 1;\n }\n },\n undo: () => {\n if (o > -1) {\n i = !0;\n const { created: g, updated: b, deleted: w } = n[o];\n r(g), f(b), u(w), e.emit(\"undo\", n[o]), o -= 1;\n }\n }\n };\n}, Bn = () => {\n const { subscribe: t, set: e } = Dt([]);\n return {\n subscribe: t,\n set: e\n };\n}, Rn = (t, e, n, o) => {\n const { hover: i, selection: s, store: a, viewport: r } = t, l = /* @__PURE__ */ new Map();\n let f = [], h;\n const u = (w, y) => {\n l.has(w) ? l.get(w).push(y) : l.set(w, [y]);\n }, p = (w, y) => {\n const d = l.get(w);\n if (d) {\n const c = d.indexOf(y);\n c !== -1 && d.splice(c, 1);\n }\n }, g = (w, y, d) => {\n l.has(w) && setTimeout(() => {\n l.get(w).forEach((c) => {\n if (n) {\n const A = Array.isArray(y) ? y.map((T) => n.serialize(T)) : n.serialize(y), E = d ? d instanceof PointerEvent ? d : n.serialize(d) : void 0;\n c(A, E);\n } else\n c(y, d);\n });\n }, 1);\n };\n s.subscribe(({ selected: w }) => {\n if (!(f.length === 0 && w.length === 0)) {\n if (f.length === 0 && w.length > 0)\n f = w.map(({ id: y }) => a.getAnnotation(y));\n else if (f.length > 0 && w.length === 0)\n f.forEach((y) => {\n const d = a.getAnnotation(y.id);\n d && !G(d, y) && g(\"updateAnnotation\", d, y);\n }), f = [];\n else {\n const y = new Set(f.map((c) => c.id)), d = new Set(w.map(({ id: c }) => c));\n f.filter((c) => !d.has(c.id)).forEach((c) => {\n const A = a.getAnnotation(c.id);\n A && !G(A, c) && g(\"updateAnnotation\", A, c);\n }), f = [\n // Remove annotations that were deselected\n ...f.filter((c) => d.has(c.id)),\n // Add editable annotations that were selected\n ...w.filter(({ id: c }) => !y.has(c)).map(({ id: c }) => a.getAnnotation(c))\n ];\n }\n g(\"selectionChanged\", f);\n }\n }), i.subscribe((w) => {\n !h && w ? g(\"mouseEnterAnnotation\", a.getAnnotation(w)) : h && !w ? g(\"mouseLeaveAnnotation\", a.getAnnotation(h)) : h && w && (g(\"mouseLeaveAnnotation\", a.getAnnotation(h)), g(\"mouseEnterAnnotation\", a.getAnnotation(w))), h = w;\n }), r == null || r.subscribe((w) => g(\"viewportIntersect\", w.map((y) => a.getAnnotation(y)))), a.observe((w) => {\n const { created: y, deleted: d } = w.changes;\n (y || []).forEach((c) => g(\"createAnnotation\", c)), (d || []).forEach((c) => g(\"deleteAnnotation\", c)), (w.changes.updated || []).filter((c) => [\n ...c.bodiesCreated || [],\n ...c.bodiesDeleted || [],\n ...c.bodiesUpdated || []\n ].length > 0).forEach(({ oldValue: c, newValue: A }) => {\n const E = f.find((T) => T.id === c.id) || c;\n f = f.map((T) => T.id === c.id ? A : T), g(\"updateAnnotation\", A, E);\n });\n }, { origin: k.LOCAL }), a.observe((w) => {\n if (f) {\n const y = new Set(f.map((c) => c.id)), d = (w.changes.updated || []).filter(({ newValue: c }) => y.has(c.id)).map(({ newValue: c }) => c);\n d.length > 0 && (f = f.map((c) => d.find((E) => E.id === c.id) || c));\n }\n }, { origin: k.REMOTE });\n const b = (w) => (y) => {\n const { updated: d } = y;\n w ? (d || []).forEach((c) => g(\"updateAnnotation\", c.oldValue, c.newValue)) : (d || []).forEach((c) => g(\"updateAnnotation\", c.newValue, c.oldValue));\n };\n return e.on(\"undo\", b(!0)), e.on(\"redo\", b(!1)), { on: u, off: p, emit: g };\n}, kn = (t) => (e) => e.reduce((n, o) => {\n const { parsed: i, error: s } = t.parse(o);\n return s ? {\n parsed: n.parsed,\n failed: [...n.failed, o]\n } : i ? {\n parsed: [...n.parsed, i],\n failed: n.failed\n } : {\n ...n\n };\n}, { parsed: [], failed: [] }), In = (t, e, n) => {\n const { store: o, selection: i } = t, s = (d) => {\n if (n) {\n const { parsed: c, error: A } = n.parse(d);\n c ? o.addAnnotation(c, k.REMOTE) : console.error(A);\n } else\n o.addAnnotation(Ot(d), k.REMOTE);\n }, a = () => i.clear(), r = () => o.clear(), l = (d) => {\n const c = o.getAnnotation(d);\n return n && c ? n.serialize(c) : c;\n }, f = () => n ? o.all().map(n.serialize) : o.all(), h = () => {\n var d;\n const c = (((d = i.selected) == null ? void 0 : d.map((A) => A.id)) || []).map((A) => o.getAnnotation(A)).filter(Boolean);\n return n ? c.map(n.serialize) : c;\n }, u = (d, c = !0) => fetch(d).then((A) => A.json()).then((A) => (g(A, c), A)), p = (d) => {\n if (typeof d == \"string\") {\n const c = o.getAnnotation(d);\n if (o.deleteAnnotation(d), c)\n return n ? n.serialize(c) : c;\n } else {\n const c = n ? n.parse(d).parsed : d;\n if (c)\n return o.deleteAnnotation(c), d;\n }\n }, g = (d, c = !0) => {\n if (n) {\n const A = n.parseAll || kn(n), { parsed: E, failed: T } = A(d);\n T.length > 0 && console.warn(`Discarded ${T.length} invalid annotations`, T), o.bulkAddAnnotation(E, c, k.REMOTE);\n } else\n o.bulkAddAnnotation(d.map(Ot), c, k.REMOTE);\n }, b = (d, c) => {\n d ? i.setSelected(d, c) : i.clear();\n }, w = (d) => {\n i.clear(), i.setUserSelectAction(d);\n }, y = (d) => {\n if (n) {\n const c = n.parse(d).parsed, A = n.serialize(o.getAnnotation(c.id));\n return o.updateAnnotation(c), A;\n } else {\n const c = o.getAnnotation(d.id);\n return o.updateAnnotation(Ot(d)), c;\n }\n };\n return {\n addAnnotation: s,\n cancelSelected: a,\n canRedo: e.canRedo,\n canUndo: e.canUndo,\n clearAnnotations: r,\n getAnnotationById: l,\n getAnnotations: f,\n getSelected: h,\n loadAnnotations: u,\n redo: e.redo,\n removeAnnotation: p,\n setAnnotations: g,\n setSelected: b,\n setUserSelectAction: w,\n undo: e.undo,\n updateAnnotation: y\n };\n}, _n = \"useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict\";\nlet Nn = (t) => crypto.getRandomValues(new Uint8Array(t)), Un = (t, e, n) => {\n let o = (2 << Math.log2(t.length - 1)) - 1, i = -~(1.6 * o * e / t.length);\n return (s = e) => {\n let a = \"\";\n for (; ; ) {\n let r = n(i), l = i;\n for (; l--; )\n if (a += t[r[l] & o] || \"\", a.length === s) return a;\n }\n };\n}, Vn = (t, e = 21) => Un(t, e, Nn), Yn = (t = 21) => {\n let e = \"\", n = crypto.getRandomValues(new Uint8Array(t));\n for (; t--; )\n e += _n[n[t] & 63];\n return e;\n};\nconst Kn = () => ({ isGuest: !0, id: Vn(\"1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_\", 20)() }), Dn = (t) => {\n const e = JSON.stringify(t);\n let n = 0;\n for (let o = 0, i = e.length; o < i; o++) {\n let s = e.charCodeAt(o);\n n = (n << 5) - n + s, n |= 0;\n }\n return `${n}`;\n}, ge = (t) => t ? typeof t == \"object\" ? { ...t } : t : void 0, Xn = (t, e) => (Array.isArray(t) ? t : [t]).map((n) => {\n const { id: o, type: i, purpose: s, value: a, created: r, modified: l, creator: f, ...h } = n;\n return {\n id: o || `temp-${Dn(n)}`,\n annotation: e,\n type: i,\n purpose: s,\n value: a,\n creator: ge(f),\n created: r ? new Date(r) : void 0,\n updated: l ? new Date(l) : void 0,\n ...h\n };\n}), Pn = (t) => t.map((e) => {\n var n;\n const { annotation: o, created: i, updated: s, ...a } = e, r = {\n ...a,\n created: i == null ? void 0 : i.toISOString(),\n modified: s == null ? void 0 : s.toISOString()\n };\n return (n = r.id) != null && n.startsWith(\"temp-\") && delete r.id, r;\n});\nYn();\nconst Ao = (t, e) => ({\n parse: (n) => jn(n),\n serialize: (n) => zn(n, t, e)\n}), $n = (t) => t.quote !== void 0 && t.start !== void 0 && t.end !== void 0, Hn = (t) => {\n const {\n id: e,\n creator: n,\n created: o,\n modified: i,\n target: s\n } = t, a = Array.isArray(s) ? s : [s];\n if (a.length === 0)\n return { error: Error(`No targets found for annotation: ${t.id}`) };\n const r = {\n creator: ge(n),\n created: o ? new Date(o) : void 0,\n updated: i ? new Date(i) : void 0,\n annotation: e,\n selector: [],\n // @ts-expect-error: `styleClass` is not part of the core `TextAnnotationTarget` type\n styleClass: \"styleClass\" in a[0] ? a[0].styleClass : void 0\n };\n for (const l of a) {\n const h = (Array.isArray(l.selector) ? l.selector : [l.selector]).reduce((u, p) => {\n switch (p.type) {\n case \"TextQuoteSelector\":\n u.quote = p.exact;\n break;\n case \"TextPositionSelector\":\n u.start = p.start, u.end = p.end;\n break;\n }\n return u;\n }, {});\n if ($n(h))\n r.selector.push(\n {\n ...h,\n id: l.id,\n // @ts-expect-error: `scope` is not part of the core `TextSelector` type\n scope: l.scope\n }\n );\n else {\n const u = [\n h.start ? void 0 : \"TextPositionSelector\",\n h.quote ? void 0 : \"TextQuoteSelector\"\n ].filter(Boolean);\n return { error: Error(`Missing selector types: ${u.join(\" and \")} for annotation: ${t.id}`) };\n }\n }\n return { parsed: r };\n}, jn = (t) => {\n const e = t.id || fe(), {\n creator: n,\n created: o,\n modified: i,\n body: s,\n ...a\n } = t, r = Xn(s, e), l = Hn(t);\n return \"error\" in l ? { error: l.error } : {\n parsed: {\n ...a,\n id: e,\n bodies: r,\n target: l.parsed\n }\n };\n}, zn = (t, e, n) => {\n const { bodies: o, target: i, ...s } = t, {\n selector: a,\n creator: r,\n created: l,\n updated: f,\n ...h\n } = i, u = a.map((p) => {\n const { id: g, quote: b, start: w, end: y, range: d } = p, { prefix: c, suffix: A } = Re(d, n), E = [{\n type: \"TextQuoteSelector\",\n exact: b,\n prefix: c,\n suffix: A\n }, {\n type: \"TextPositionSelector\",\n start: w,\n end: y\n }];\n return {\n ...h,\n id: g,\n // @ts-expect-error: `scope` is not part of the core `TextSelector` type\n scope: \"scope\" in p ? p.scope : void 0,\n source: e,\n selector: E\n };\n });\n return {\n ...s,\n \"@context\": \"http://www.w3.org/ns/anno.jsonld\",\n id: t.id,\n type: \"Annotation\",\n body: Pn(t.bodies),\n creator: r,\n created: l == null ? void 0 : l.toISOString(),\n modified: f == null ? void 0 : f.toISOString(),\n target: u\n };\n};\nfunction me(t, e, n = 0, o = t.length - 1, i = Fn) {\n for (; o > n; ) {\n if (o - n > 600) {\n const l = o - n + 1, f = e - n + 1, h = Math.log(l), u = 0.5 * Math.exp(2 * h / 3), p = 0.5 * Math.sqrt(h * u * (l - u) / l) * (f - l / 2 < 0 ? -1 : 1), g = Math.max(n, Math.floor(e - f * u / l + p)), b = Math.min(o, Math.floor(e + (l - f) * u / l + p));\n me(t, e, g, b, i);\n }\n const s = t[e];\n let a = n, r = o;\n for (nt(t, n, e), i(t[o], s) > 0 && nt(t, n, o); a < r; ) {\n for (nt(t, a, r), a++, r--; i(t[a], s) < 0; ) a++;\n for (; i(t[r], s) > 0; ) r--;\n }\n i(t[n], s) === 0 ? nt(t, n, r) : (r++, nt(t, r, o)), r <= e && (n = r + 1), e <= r && (o = r - 1);\n }\n}\nfunction nt(t, e, n) {\n const o = t[e];\n t[e] = t[n], t[n] = o;\n}\nfunction Fn(t, e) {\n return t < e ? -1 : t > e ? 1 : 0;\n}\nclass Wn {\n constructor(e = 9) {\n this._maxEntries = Math.max(4, e), this._minEntries = Math.max(2, Math.ceil(this._maxEntries * 0.4)), this.clear();\n }\n all() {\n return this._all(this.data, []);\n }\n search(e) {\n let n = this.data;\n const o = [];\n if (!mt(e, n)) return o;\n const i = this.toBBox, s = [];\n for (; n; ) {\n for (let a = 0; a < n.children.length; a++) {\n const r = n.children[a], l = n.leaf ? i(r) : r;\n mt(e, l) && (n.leaf ? o.push(r) : Rt(e, l) ? this._all(r, o) : s.push(r));\n }\n n = s.pop();\n }\n return o;\n }\n collides(e) {\n let n = this.data;\n if (!mt(e, n)) return !1;\n const o = [];\n for (; n; ) {\n for (let i = 0; i < n.children.length; i++) {\n const s = n.children[i], a = n.leaf ? this.toBBox(s) : s;\n if (mt(e, a)) {\n if (n.leaf || Rt(e, a)) return !0;\n o.push(s);\n }\n }\n n = o.pop();\n }\n return !1;\n }\n load(e) {\n if (!(e && e.length)) return this;\n if (e.length < this._minEntries) {\n for (let o = 0; o < e.length; o++)\n this.insert(e[o]);\n return this;\n }\n let n = this._build(e.slice(), 0, e.length - 1, 0);\n if (!this.data.children.length)\n this.data = n;\n else if (this.data.height === n.height)\n this._splitRoot(this.data, n);\n else {\n if (this.data.height < n.height) {\n const o = this.data;\n this.data = n, n = o;\n }\n this._insert(n, this.data.height - n.height - 1, !0);\n }\n return this;\n }\n insert(e) {\n return e && this._insert(e, this.data.height - 1), this;\n }\n clear() {\n return this.data = Z([]), this;\n }\n remove(e, n) {\n if (!e) return this;\n let o = this.data;\n const i = this.toBBox(e), s = [], a = [];\n let r, l, f;\n for (; o || s.length; ) {\n if (o || (o = s.pop(), l = s[s.length - 1], r = a.pop(), f = !0), o.leaf) {\n const h = qn(e, o.children, n);\n if (h !== -1)\n return o.children.splice(h, 1), s.push(o), this._condense(s), this;\n }\n !f && !o.leaf && Rt(o, i) ? (s.push(o), a.push(r), r = 0, l = o, o = o.children[0]) : l ? (r++, o = l.children[r], f = !1) : o = null;\n }\n return this;\n }\n toBBox(e) {\n return e;\n }\n compareMinX(e, n) {\n return e.minX - n.minX;\n }\n compareMinY(e, n) {\n return e.minY - n.minY;\n }\n toJSON() {\n return this.data;\n }\n fromJSON(e) {\n return this.data = e, this;\n }\n _all(e, n) {\n const o = [];\n for (; e; )\n e.leaf ? n.push(...e.children) : o.push(...e.children), e = o.pop();\n return n;\n }\n _build(e, n, o, i) {\n const s = o - n + 1;\n let a = this._maxEntries, r;\n if (s <= a)\n return r = Z(e.slice(n, o + 1)), J(r, this.toBBox), r;\n i || (i = Math.ceil(Math.log(s) / Math.log(a)), a = Math.ceil(s / Math.pow(a, i - 1))), r = Z([]), r.leaf = !1, r.height = i;\n const l = Math.ceil(s / a), f = l * Math.ceil(Math.sqrt(a));\n ee(e, n, o, f, this.compareMinX);\n for (let h = n; h <= o; h += f) {\n const u = Math.min(h + f - 1, o);\n ee(e, h, u, l, this.compareMinY);\n for (let p = h; p <= u; p += l) {\n const g = Math.min(p + l - 1, u);\n r.children.push(this._build(e, p, g, i - 1));\n }\n }\n return J(r, this.toBBox), r;\n }\n _chooseSubtree(e, n, o, i) {\n for (; i.push(n), !(n.leaf || i.length - 1 === o); ) {\n let s = 1 / 0, a = 1 / 0, r;\n for (let l = 0; l < n.children.length; l++) {\n const f = n.children[l], h = Bt(f), u = Jn(e, f) - h;\n u < a ? (a = u, s = h < s ? h : s, r = f) : u === a && h < s && (s = h, r = f);\n }\n n = r || n.children[0];\n }\n return n;\n }\n _insert(e, n, o) {\n const i = o ? e : this.toBBox(e), s = [], a = this._chooseSubtree(i, this.data, n, s);\n for (a.children.push(e), rt(a, i); n >= 0 && s[n].children.length > this._maxEntries; )\n this._split(s, n), n--;\n this._adjustParentBBoxes(i, s, n);\n }\n // split overflowed node into two\n _split(e, n) {\n const o = e[n], i = o.children.length, s = this._minEntries;\n this._chooseSplitAxis(o, s, i);\n const a = this._chooseSplitIndex(o, s, i), r = Z(o.children.splice(a, o.children.length - a));\n r.height = o.height, r.leaf = o.leaf, J(o, this.toBBox), J(r, this.toBBox), n ? e[n - 1].children.push(r) : this._splitRoot(o, r);\n }\n _splitRoot(e, n) {\n this.data = Z([e, n]), this.data.height = e.height + 1, this.data.leaf = !1, J(this.data, this.toBBox);\n }\n _chooseSplitIndex(e, n, o) {\n let i, s = 1 / 0, a = 1 / 0;\n for (let r = n; r <= o - n; r++) {\n const l = st(e, 0, r, this.toBBox), f = st(e, r, o, this.toBBox), h = Zn(l, f), u = Bt(l) + Bt(f);\n h < s ? (s = h, i = r, a = u < a ? u : a) : h === s && u < a && (a = u, i = r);\n }\n return i || o - n;\n }\n // sorts node children by the best axis for split\n _chooseSplitAxis(e, n, o) {\n const i = e.leaf ? this.compareMinX : Gn, s = e.leaf ? this.compareMinY : Qn, a = this._allDistMargin(e, n, o, i), r = this._allDistMargin(e, n, o, s);\n a < r && e.children.sort(i);\n }\n // total margin of all possible split distributions where each node is at least m full\n _allDistMargin(e, n, o, i) {\n e.children.sort(i);\n const s = this.toBBox, a = st(e, 0, n, s), r = st(e, o - n, o, s);\n let l = gt(a) + gt(r);\n for (let f = n; f < o - n; f++) {\n const h = e.children[f];\n rt(a, e.leaf ? s(h) : h), l += gt(a);\n }\n for (let f = o - n - 1; f >= n; f--) {\n const h = e.children[f];\n rt(r, e.leaf ? s(h) : h), l += gt(r);\n }\n return l;\n }\n _adjustParentBBoxes(e, n, o) {\n for (let i = o; i >= 0; i--)\n rt(n[i], e);\n }\n _condense(e) {\n for (let n = e.length - 1, o; n >= 0; n--)\n e[n].children.length === 0 ? n > 0 ? (o = e[n - 1].children, o.splice(o.indexOf(e[n]), 1)) : this.clear() : J(e[n], this.toBBox);\n }\n}\nfunction qn(t, e, n) {\n if (!n) return e.indexOf(t);\n for (let o = 0; o < e.length; o++)\n if (n(t, e[o])) return o;\n return -1;\n}\nfunction J(t, e) {\n st(t, 0, t.children.length, e, t);\n}\nfunction st(t, e, n, o, i) {\n i || (i = Z(null)), i.minX = 1 / 0, i.minY = 1 / 0, i.maxX = -1 / 0, i.maxY = -1 / 0;\n for (let s = e; s < n; s++) {\n const a = t.children[s];\n rt(i, t.leaf ? o(a) : a);\n }\n return i;\n}\nfunction rt(t, e) {\n return t.minX = Math.min(t.minX, e.minX), t.minY = Math.min(t.minY, e.minY), t.maxX = Math.max(t.maxX, e.maxX), t.maxY = Math.max(t.maxY, e.maxY), t;\n}\nfunction Gn(t, e) {\n return t.minX - e.minX;\n}\nfunction Qn(t, e) {\n return t.minY - e.minY;\n}\nfunction Bt(t) {\n return (t.maxX - t.minX) * (t.maxY - t.minY);\n}\nfunction gt(t) {\n return t.maxX - t.minX + (t.maxY - t.minY);\n}\nfunction Jn(t, e) {\n return (Math.max(e.maxX, t.maxX) - Math.min(e.minX, t.minX)) * (Math.max(e.maxY, t.maxY) - Math.min(e.minY, t.minY));\n}\nfunction Zn(t, e) {\n const n = Math.max(t.minX, e.minX), o = Math.max(t.minY, e.minY), i = Math.min(t.maxX, e.maxX), s = Math.min(t.maxY, e.maxY);\n return Math.max(0, i - n) * Math.max(0, s - o);\n}\nfunction Rt(t, e) {\n return t.minX <= e.minX && t.minY <= e.minY && e.maxX <= t.maxX && e.maxY <= t.maxY;\n}\nfunction mt(t, e) {\n return e.minX <= t.maxX && e.minY <= t.maxY && e.maxX >= t.minX && e.maxY >= t.minY;\n}\nfunction Z(t) {\n return {\n children: t,\n height: 1,\n leaf: !0,\n minX: 1 / 0,\n minY: 1 / 0,\n maxX: -1 / 0,\n maxY: -1 / 0\n };\n}\nfunction ee(t, e, n, o, i) {\n const s = [e, n];\n for (; s.length; ) {\n if (n = s.pop(), e = s.pop(), n - e <= o) continue;\n const a = e + Math.ceil((n - e) / o / 2) * o;\n me(t, a, e, n, i), s.push(e, a, a, n);\n }\n}\nconst to = (t, e) => {\n const n = new Wn(), o = /* @__PURE__ */ new Map(), i = (d, c) => {\n const A = d.selector.flatMap((T) => {\n const S = F([T]) ? T.range : ae(T, e).range;\n return Array.from(S.getClientRects());\n }), E = Ue(A).map(({ left: T, top: S, right: O, bottom: M }) => new DOMRect(T - c.left, S - c.top, O - T, M - S));\n return E.map((T) => {\n const { x: S, y: O, width: M, height: L } = T;\n return {\n minX: S,\n minY: O,\n maxX: S + M,\n maxY: O + L,\n annotation: {\n id: d.annotation,\n rects: E\n }\n };\n });\n }, s = () => [...o.values()], a = () => {\n n.clear(), o.clear();\n }, r = (d) => {\n const c = i(d, e.getBoundingClientRect());\n c.forEach((A) => n.insert(A)), o.set(d.annotation, c);\n }, l = (d) => {\n const c = o.get(d.annotation);\n c && (c.forEach((A) => n.remove(A)), o.delete(d.annotation));\n }, f = (d) => {\n l(d), r(d);\n }, h = (d, c = !0) => {\n c && a();\n const A = e.getBoundingClientRect(), E = d.map((S) => ({ target: S, rects: i(S, A) }));\n E.forEach(({ target: S, rects: O }) => o.set(S.annotation, O));\n const T = E.flatMap(({ rects: S }) => S);\n n.load(T);\n }, u = (d, c, A = !1) => {\n const E = n.search({\n minX: d,\n minY: c,\n maxX: d,\n maxY: c\n }), T = (S) => S.annotation.rects.reduce((O, M) => O + M.width * M.height, 0);\n return E.length > 0 ? (E.sort((S, O) => T(S) - T(O)), A ? E.map((S) => S.annotation.id) : [E[0].annotation.id]) : [];\n }, p = (d) => {\n const c = g(d);\n if (c.length === 0)\n return;\n let A = c[0].left, E = c[0].top, T = c[0].right, S = c[0].bottom;\n for (let O = 1; O < c.length; O++) {\n const M = c[O];\n A = Math.min(A, M.left), E = Math.min(E, M.top), T = Math.max(T, M.right), S = Math.max(S, M.bottom);\n }\n return new DOMRect(A, E, T - A, S - E);\n }, g = (d) => {\n const c = o.get(d);\n return c ? c[0].annotation.rects : [];\n };\n return {\n all: s,\n clear: a,\n getAt: u,\n getAnnotationBounds: p,\n getAnnotationRects: g,\n getIntersecting: (d, c, A, E) => {\n const T = n.search({ minX: d, minY: c, maxX: A, maxY: E }), S = new Set(T.map((O) => O.annotation.id));\n return Array.from(S).map((O) => ({\n annotation: t.getAnnotation(O),\n rects: g(O)\n })).filter((O) => !!O.annotation);\n },\n insert: r,\n recalculate: () => h(t.all().map((d) => d.target), !0),\n remove: l,\n set: h,\n size: () => n.all().length,\n update: f\n };\n}, eo = (t, e) => {\n const n = Ln(), o = to(n, t), i = pn(n);\n i.setUserSelectAction(e);\n const s = fn(n), a = Bn(), r = (y, d = k.LOCAL) => {\n const c = xt(y, t), A = F(c.target.selector);\n return A && n.addAnnotation(c, d), A;\n }, l = (y, d = !0, c = k.LOCAL) => {\n const A = y.map((T) => xt(T, t)), E = A.filter((T) => !F(T.target.selector));\n return n.bulkAddAnnotation(A, d, c), E;\n }, f = (y, d = k.LOCAL) => {\n const c = y.map((E) => xt(E, t)), A = c.filter((E) => !F(E.target.selector));\n return c.forEach((E) => {\n n.getAnnotation(E.id) ? n.updateAnnotation(E, d) : n.addAnnotation(E, d);\n }), A;\n }, h = (y, d = k.LOCAL) => {\n const c = bt(y, t);\n n.updateTarget(c, d);\n }, u = (y, d = k.LOCAL) => {\n const c = y.map((A) => bt(A, t));\n n.bulkUpdateTargets(c, d);\n };\n function p(y, d, c, A) {\n const E = c || !!A, T = o.getAt(y, d, E).map((O) => n.getAnnotation(O)), S = A ? T.filter(A) : T;\n if (S.length !== 0)\n return c ? S : S[0];\n }\n const g = (y, d, c, A = 5) => {\n const E = o.getAnnotationRects(y);\n if (E.length !== 0) {\n if (d && c) {\n const T = E.find(({ top: S, right: O, bottom: M, left: L }) => d >= L - A && d <= O + A && c >= S - A && c <= M + A);\n if (T) return T;\n }\n return o.getAnnotationBounds(y);\n }\n }, b = (y) => o.getAnnotationRects(y), w = () => o.recalculate();\n return n.observe(({ changes: y }) => {\n const d = (y.deleted || []).filter((E) => F(E.target.selector)), c = (y.created || []).filter((E) => F(E.target.selector)), A = (y.updated || []).filter((E) => F(E.newValue.target.selector));\n (d == null ? void 0 : d.length) > 0 && d.forEach((E) => o.remove(E.target)), c.length > 0 && o.set(c.map((E) => E.target), !1), (A == null ? void 0 : A.length) > 0 && A.forEach(({ newValue: E }) => o.update(E.target));\n }), {\n store: {\n ...n,\n addAnnotation: r,\n bulkAddAnnotation: l,\n bulkUpdateTargets: u,\n bulkUpsertAnnotations: f,\n getAnnotationBounds: g,\n getAnnotationRects: b,\n getAt: p,\n getIntersecting: o.getIntersecting,\n recalculatePositions: w,\n updateTarget: h\n },\n selection: i,\n hover: s,\n viewport: a\n };\n}, no = () => {\n const t = document.createElement(\"canvas\");\n t.width = 2 * window.innerWidth, t.height = 2 * window.innerHeight, t.className = \"r6o-presence-layer\";\n const e = t.getContext(\"2d\");\n return e.scale(2, 2), e.translate(0.5, 0.5), t;\n}, oo = (t, e = {}) => {\n const n = no(), o = n.getContext(\"2d\");\n document.body.appendChild(n);\n const i = /* @__PURE__ */ new Map(), s = (h) => Array.from(i.entries()).filter(([u, p]) => p.presenceKey === h.presenceKey).map(([u, p]) => u);\n return t.on(\"selectionChange\", (h, u) => {\n s(h).forEach((g) => i.delete(g)), u && u.forEach((g) => i.set(g, h));\n }), {\n clear: () => {\n const { width: h, height: u } = n;\n o.clearRect(-0.5, -0.5, h + 1, u + 1);\n },\n destroy: () => {\n n.remove();\n },\n paint: (h, u, p) => {\n e.font && (o.font = e.font);\n const g = i.get(h.annotation.id);\n if (g) {\n const { height: b } = h.rects[0], w = h.rects[0].x + u.left, y = h.rects[0].y + u.top;\n o.fillStyle = g.appearance.color, o.fillRect(w - 2, y - 2.5, 2, b + 5);\n const d = o.measureText(g.appearance.label), c = d.width + 6, A = d.actualBoundingBoxAscent + d.actualBoundingBoxDescent + 8, E = d.fontBoundingBoxAscent ? 8 : 6.5;\n return o.fillRect(w - 2, y - 2.5 - A, c, A), o.fillStyle = \"#fff\", o.fillText(g.appearance.label, w + 1, y - E), {\n fill: g.appearance.color,\n fillOpacity: p ? 0.45 : 0.18\n };\n }\n },\n reset: () => {\n n.width = 2 * window.innerWidth, n.height = 2 * window.innerHeight;\n const h = n.getContext(\"2d\");\n h.scale(2, 2), h.translate(0.5, 0.5);\n }\n };\n}, kt = typeof navigator < \"u\" ? navigator.userAgent.toLowerCase().indexOf(\"firefox\") > 0 : !1;\nfunction It(t, e, n, o) {\n t.addEventListener ? t.addEventListener(e, n, o) : t.attachEvent && t.attachEvent(\"on\".concat(e), n);\n}\nfunction ot(t, e, n, o) {\n t.removeEventListener ? t.removeEventListener(e, n, o) : t.detachEvent && t.detachEvent(\"on\".concat(e), n);\n}\nfunction ye(t, e) {\n const n = e.slice(0, e.length - 1);\n for (let o = 0; o < n.length; o++) n[o] = t[n[o].toLowerCase()];\n return n;\n}\nfunction be(t) {\n typeof t != \"string\" && (t = \"\"), t = t.replace(/\\s/g, \"\");\n const e = t.split(\",\");\n let n = e.lastIndexOf(\"\");\n for (; n >= 0; )\n e[n - 1] += \",\", e.splice(n, 1), n = e.lastIndexOf(\"\");\n return e;\n}\nfunction io(t, e) {\n const n = t.length >= e.length ? t : e, o = t.length >= e.length ? e : t;\n let i = !0;\n for (let s = 0; s < n.length; s++)\n o.indexOf(n[s]) === -1 && (i = !1);\n return i;\n}\nconst lt = {\n backspace: 8,\n \"⌫\": 8,\n tab: 9,\n clear: 12,\n enter: 13,\n \"↩\": 13,\n return: 13,\n esc: 27,\n escape: 27,\n space: 32,\n left: 37,\n up: 38,\n right: 39,\n down: 40,\n del: 46,\n delete: 46,\n ins: 45,\n insert: 45,\n home: 36,\n end: 35,\n pageup: 33,\n pagedown: 34,\n capslock: 20,\n num_0: 96,\n num_1: 97,\n num_2: 98,\n num_3: 99,\n num_4: 100,\n num_5: 101,\n num_6: 102,\n num_7: 103,\n num_8: 104,\n num_9: 105,\n num_multiply: 106,\n num_add: 107,\n num_enter: 108,\n num_subtract: 109,\n num_decimal: 110,\n num_divide: 111,\n \"⇪\": 20,\n \",\": 188,\n \".\": 190,\n \"/\": 191,\n \"`\": 192,\n \"-\": kt ? 173 : 189,\n \"=\": kt ? 61 : 187,\n \";\": kt ? 59 : 186,\n \"'\": 222,\n \"[\": 219,\n \"]\": 221,\n \"\\\\\": 220\n}, H = {\n // shiftKey\n \"⇧\": 16,\n shift: 16,\n // altKey\n \"⌥\": 18,\n alt: 18,\n option: 18,\n // ctrlKey\n \"⌃\": 17,\n ctrl: 17,\n control: 17,\n // metaKey\n \"⌘\": 91,\n cmd: 91,\n command: 91\n}, Vt = {\n 16: \"shiftKey\",\n 18: \"altKey\",\n 17: \"ctrlKey\",\n 91: \"metaKey\",\n shiftKey: 16,\n ctrlKey: 17,\n altKey: 18,\n metaKey: 91\n}, D = {\n 16: !1,\n 18: !1,\n 17: !1,\n 91: !1\n}, _ = {};\nfor (let t = 1; t < 20; t++)\n lt[\"f\".concat(t)] = 111 + t;\nlet I = [], ct = null, we = \"all\";\nconst z = /* @__PURE__ */ new Map(), ut = (t) => lt[t.toLowerCase()] || H[t.toLowerCase()] || t.toUpperCase().charCodeAt(0), so = (t) => Object.keys(lt).find((e) => lt[e] === t), ro = (t) => Object.keys(H).find((e) => H[e] === t);\nfunction Ae(t) {\n we = t || \"all\";\n}\nfunction dt() {\n return we || \"all\";\n}\nfunction ao() {\n return I.slice(0);\n}\nfunction co() {\n return I.map((t) => so(t) || ro(t) || String.fromCharCode(t));\n}\nfunction lo() {\n const t = [];\n return Object.keys(_).forEach((e) => {\n _[e].forEach((n) => {\n let {\n key: o,\n scope: i,\n mods: s,\n shortcut: a\n } = n;\n t.push({\n scope: i,\n shortcut: a,\n mods: s,\n keys: o.split(\"+\").map((r) => ut(r))\n });\n });\n }), t;\n}\nfunction uo(t) {\n const e = t.target || t.srcElement, {\n tagName: n\n } = e;\n let o = !0;\n const i = n === \"INPUT\" && ![\"checkbox\", \"radio\", \"range\", \"button\", \"file\", \"reset\", \"submit\", \"color\"].includes(e.type);\n return (e.isContentEditable || (i || n === \"TEXTAREA\" || n === \"SELECT\") && !e.readOnly) && (o = !1), o;\n}\nfunction fo(t) {\n return typeof t == \"string\" && (t = ut(t)), I.indexOf(t) !== -1;\n}\nfunction ho(t, e) {\n let n, o;\n t || (t = dt());\n for (const i in _)\n if (Object.prototype.hasOwnProperty.call(_, i))\n for (n = _[i], o = 0; o < n.length; )\n n[o].scope === t ? n.splice(o, 1).forEach((a) => {\n let {\n element: r\n } = a;\n return Xt(r);\n }) : o++;\n dt() === t && Ae(e || \"all\");\n}\nfunction po(t) {\n let e = t.keyCode || t.which || t.charCode;\n const n = I.indexOf(e);\n if (n >= 0 && I.splice(n, 1), t.key && t.key.toLowerCase() === \"meta\" && I.splice(0, I.length), (e === 93 || e === 224) && (e = 91), e in D) {\n D[e] = !1;\n for (const o in H) H[o] === e && (P[o] = !1);\n }\n}\nfunction xe(t) {\n if (typeof t > \"u\")\n Object.keys(_).forEach((i) => {\n Array.isArray(_[i]) && _[i].forEach((s) => yt(s)), delete _[i];\n }), Xt(null);\n else if (Array.isArray(t))\n t.forEach((i) => {\n i.key && yt(i);\n });\n else if (typeof t == \"object\")\n t.key && yt(t);\n else if (typeof t == \"string\") {\n for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), o = 1; o < e; o++)\n n[o - 1] = arguments[o];\n let [i, s] = n;\n typeof i == \"function\" && (s = i, i = \"\"), yt({\n key: t,\n scope: i,\n method: s,\n splitKey: \"+\"\n });\n }\n}\nconst yt = (t) => {\n let {\n key: e,\n scope: n,\n method: o,\n splitKey: i = \"+\"\n } = t;\n be(e).forEach((a) => {\n const r = a.split(i), l = r.length, f = r[l - 1], h = f === \"*\" ? \"*\" : ut(f);\n if (!_[h]) return;\n n || (n = dt());\n const u = l > 1 ? ye(H, r) : [], p = [];\n _[h] = _[h].filter((g) => {\n const w = (o ? g.method === o : !0) && g.scope === n && io(g.mods, u);\n return w && p.push(g.element), !w;\n }), p.forEach((g) => Xt(g));\n });\n};\nfunction ne(t, e, n, o) {\n if (e.element !== o)\n return;\n let i;\n if (e.scope === n || e.scope === \"all\") {\n i = e.mods.length > 0;\n for (const s in D)\n Object.prototype.hasOwnProperty.call(D, s) && (!D[s] && e.mods.indexOf(+s) > -1 || D[s] && e.mods.indexOf(+s) === -1) && (i = !1);\n (e.mods.length === 0 && !D[16] && !D[18] && !D[17] && !D[91] || i || e.shortcut === \"*\") && (e.keys = [], e.keys = e.keys.concat(I), e.method(t, e) === !1 && (t.preventDefault ? t.preventDefault() : t.returnValue = !1, t.stopPropagation && t.stopPropagation(), t.cancelBubble && (t.cancelBubble = !0)));\n }\n}\nfunction oe(t, e) {\n const n = _[\"*\"];\n let o = t.keyCode || t.which || t.charCode;\n if (!P.filter.call(this, t)) return;\n if ((o === 93 || o === 224) && (o = 91), I.indexOf(o) === -1 && o !== 229 && I.push(o), [\"ctrlKey\", \"altKey\", \"shiftKey\", \"metaKey\"].forEach((r) => {\n const l = Vt[r];\n t[r] && I.indexOf(l) === -1 ? I.push(l) : !t[r] && I.indexOf(l) > -1 ? I.splice(I.indexOf(l), 1) : r === \"metaKey\" && t[r] && I.length === 3 && (t.ctrlKey || t.shiftKey || t.altKey || (I = I.slice(I.indexOf(l))));\n }), o in D) {\n D[o] = !0;\n for (const r in H)\n H[r] === o && (P[r] = !0);\n if (!n) return;\n }\n for (const r in D)\n Object.prototype.hasOwnProperty.call(D, r) && (D[r] = t[Vt[r]]);\n t.getModifierState && !(t.altKey && !t.ctrlKey) && t.getModifierState(\"AltGraph\") && (I.indexOf(17) === -1 && I.push(17), I.indexOf(18) === -1 && I.push(18), D[17] = !0, D[18] = !0);\n const i = dt();\n if (n)\n for (let r = 0; r < n.length; r++)\n n[r].scope === i && (t.type === \"keydown\" && n[r].keydown || t.type === \"keyup\" && n[r].keyup) && ne(t, n[r], i, e);\n if (!(o in _)) return;\n const s = _[o], a = s.length;\n for (let r = 0; r < a; r++)\n if ((t.type === \"keydown\" && s[r].keydown || t.type === \"keyup\" && s[r].keyup) && s[r].key) {\n const l = s[r], {\n splitKey: f\n } = l, h = l.key.split(f), u = [];\n for (let p = 0; p < h.length; p++)\n u.push(ut(h[p]));\n u.sort().join(\"\") === I.sort().join(\"\") && ne(t, l, i, e);\n }\n}\nfunction P(t, e, n) {\n I = [];\n const o = be(t);\n let i = [], s = \"all\", a = document, r = 0, l = !1, f = !0, h = \"+\", u = !1, p = !1;\n for (n === void 0 && typeof e == \"function\" && (n = e), Object.prototype.toString.call(e) === \"[object Object]\" && (e.scope && (s = e.scope), e.element && (a = e.element), e.keyup && (l = e.keyup), e.keydown !== void 0 && (f = e.keydown), e.capture !== void 0 && (u = e.capture), typeof e.splitKey == \"string\" && (h = e.splitKey), e.single === !0 && (p = !0)), typeof e == \"string\" && (s = e), p && xe(t, s); r < o.length; r++)\n t = o[r].split(h), i = [], t.length > 1 && (i = ye(H, t)), t = t[t.length - 1], t = t === \"*\" ? \"*\" : ut(t), t in _ || (_[t] = []), _[t].push({\n keyup: l,\n keydown: f,\n scope: s,\n mods: i,\n shortcut: o[r],\n method: n,\n key: o[r],\n splitKey: h,\n element: a\n });\n if (typeof a < \"u\" && window) {\n if (!z.has(a)) {\n const g = function() {\n let w = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : window.event;\n return oe(w, a);\n }, b = function() {\n let w = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : window.event;\n oe(w, a), po(w);\n };\n z.set(a, {\n keydownListener: g,\n keyupListenr: b,\n capture: u\n }), It(a, \"keydown\", g, u), It(a, \"keyup\", b, u);\n }\n if (!ct) {\n const g = () => {\n I = [];\n };\n ct = {\n listener: g,\n capture: u\n }, It(window, \"focus\", g, u);\n }\n }\n}\nfunction go(t) {\n let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : \"all\";\n Object.keys(_).forEach((n) => {\n _[n].filter((i) => i.scope === e && i.shortcut === t).forEach((i) => {\n i && i.method && i.method();\n });\n });\n}\nfunction Xt(t) {\n const e = Object.values(_).flat();\n if (e.findIndex((o) => {\n let {\n element: i\n } = o;\n return i === t;\n }) < 0) {\n const {\n keydownListener: o,\n keyupListenr: i,\n capture: s\n } = z.get(t) || {};\n o && i && (ot(t, \"keyup\", i, s), ot(t, \"keydown\", o, s), z.delete(t));\n }\n if ((e.length <= 0 || z.size <= 0) && (Object.keys(z).forEach((i) => {\n const {\n keydownListener: s,\n keyupListenr: a,\n capture: r\n } = z.get(i) || {};\n s && a && (ot(i, \"keyup\", a, r), ot(i, \"keydown\", s, r), z.delete(i));\n }), z.clear(), Object.keys(_).forEach((i) => delete _[i]), ct)) {\n const {\n listener: i,\n capture: s\n } = ct;\n ot(window, \"focus\", i, s), ct = null;\n }\n}\nconst _t = {\n getPressedKeyString: co,\n setScope: Ae,\n getScope: dt,\n deleteScope: ho,\n getPressedKeyCodes: ao,\n getAllKeyCodes: lo,\n isPressed: fo,\n filter: uo,\n trigger: go,\n unbind: xe,\n keyMap: lt,\n modifier: H,\n modifierMap: Vt\n};\nfor (const t in _t)\n Object.prototype.hasOwnProperty.call(_t, t) && (P[t] = _t[t]);\nif (typeof window < \"u\") {\n const t = window.hotkeys;\n P.noConflict = (e) => (e && window.hotkeys === P && (window.hotkeys = t), P), window.hotkeys = P;\n}\nconst ie = 300, ve = [\"up\", \"down\", \"left\", \"right\"], Ee = Te ? \"⌘+a\" : \"ctrl+a\", mo = [\n ...ve.map((t) => `shift+${t}`),\n Ee\n], yo = (t, e, n) => {\n let o;\n const { annotatingEnabled: i, offsetReferenceSelector: s, selectionMode: a } = n, r = (L) => o = L;\n let l;\n const f = (L) => l = L, { store: h, selection: u } = e;\n let p, g, b;\n const w = (L) => {\n g !== !1 && (p = it(L.target) ? void 0 : {\n annotation: fe(),\n selector: [],\n creator: o,\n created: /* @__PURE__ */ new Date()\n });\n }, y = Yt((L) => {\n const m = document.getSelection();\n if (it(m.anchorNode)) {\n p = void 0;\n return;\n }\n const v = L.timeStamp - ((b == null ? void 0 : b.timeStamp) || L.timeStamp);\n if ((b == null ? void 0 : b.type) === \"pointerdown\" && (v < 1e3 && !p || m.isCollapsed && v < ie) && w(b || L), !p) return;\n if (m.isCollapsed) {\n h.getAnnotation(p.annotation) && (u.clear(), h.deleteAnnotation(p.annotation));\n return;\n }\n const x = m.getRangeAt(0), C = Ye(x, t);\n if (Ie(C)) return;\n const B = Be(C.cloneRange());\n (B.length !== p.selector.length || B.some((N, U) => {\n var et;\n return N.toString() !== ((et = p.selector[U]) == null ? void 0 : et.quote);\n })) && (p = {\n ...p,\n selector: B.map((N) => Ve(N, t, s)),\n updated: /* @__PURE__ */ new Date()\n }, h.getAnnotation(p.annotation) ? h.updateTarget(p, k.LOCAL) : u.clear());\n }), d = (L) => {\n it(L.target) || (b = At(L), g = b.button === 0);\n }, c = (L) => {\n if (it(L.target) || !g) return;\n const m = () => {\n const { x, y: C } = t.getBoundingClientRect(), B = L.target instanceof Node && t.contains(L.target) && h.getAt(L.clientX - x, L.clientY - C, a === \"all\", l);\n if (B) {\n const { selected: R } = u, N = new Set(R.map((q) => q.id)), U = Array.isArray(B) ? B.map((q) => q.id) : [B.id];\n (N.size !== U.length || !U.every((q) => N.has(q))) && u.userSelect(U, L);\n } else\n u.clear();\n }, v = L.timeStamp - b.timeStamp;\n setTimeout(() => {\n const x = document.getSelection();\n x != null && x.isCollapsed && v < ie ? (p = void 0, m()) : p && p.selector.length > 0 && (u.clear(), O(), u.userSelect(p.annotation, At(L)));\n });\n }, A = (L) => {\n const m = document.getSelection();\n m != null && m.isCollapsed || ((!p || p.selector.length === 0) && y(L), O(), u.userSelect(p.annotation, At(L)));\n }, E = (L) => {\n L.key === \"Shift\" && p && (document.getSelection().isCollapsed || (u.clear(), O(), u.userSelect(p.annotation, ft(L))));\n }, T = (L) => {\n const m = () => setTimeout(() => {\n (p == null ? void 0 : p.selector.length) > 0 && (u.clear(), h.addAnnotation({\n id: p.annotation,\n bodies: [],\n target: p\n }), u.userSelect(p.annotation, ft(L))), document.removeEventListener(\"selectionchange\", m);\n }, 100);\n document.addEventListener(\"selectionchange\", m), w(L);\n };\n P(mo.join(\",\"), { element: t, keydown: !0, keyup: !1 }, (L) => {\n L.repeat || (b = ft(L));\n }), P(Ee, { keydown: !0, keyup: !1 }, (L) => {\n b = ft(L), T(L);\n });\n const S = (L) => {\n L.repeat || L.target !== t && L.target !== document.body || (p = void 0, u.clear());\n };\n P(ve.join(\",\"), { keydown: !0, keyup: !1 }, S);\n const O = () => {\n const L = h.getAnnotation(p.annotation);\n if (!L) {\n h.addAnnotation({\n id: p.annotation,\n bodies: [],\n target: p\n });\n return;\n }\n const { target: { updated: m } } = L, { updated: v } = p;\n (!m || !v || m < v) && h.updateTarget(p);\n };\n return t.addEventListener(\"pointerdown\", d), document.addEventListener(\"pointerup\", c), document.addEventListener(\"contextmenu\", A), i && (t.addEventListener(\"keyup\", E), t.addEventListener(\"selectstart\", w), document.addEventListener(\"selectionchange\", y)), {\n destroy: () => {\n t.removeEventListener(\"pointerdown\", d), document.removeEventListener(\"pointerup\", c), document.removeEventListener(\"contextmenu\", A), t.removeEventListener(\"keyup\", E), t.removeEventListener(\"selectstart\", w), document.removeEventListener(\"selectionchange\", y), P.unbind();\n },\n setFilter: f,\n setUser: r\n };\n}, bo = (t, e) => ({\n ...t,\n annotatingEnabled: t.annotatingEnabled ?? e.annotatingEnabled,\n user: t.user || e.user\n}), se = \"SPANS\", xo = (t, e = {}) => {\n Le(t), Oe(t);\n const n = bo(e, {\n annotatingEnabled: !0,\n user: Kn()\n }), o = eo(t, n.userSelectAction), { selection: i, viewport: s } = o, a = o.store, r = Mn(a), l = Rn(o, r, n.adapter);\n let f = n.user;\n const h = n.renderer === \"CSS_HIGHLIGHTS\" ? CSS.highlights ? \"CSS_HIGHLIGHTS\" : se : n.renderer || se, u = h === \"SPANS\" ? rn(t, o, s) : h === \"CSS_HIGHLIGHTS\" ? nn(t, o, s) : h === \"CANVAS\" ? ze(t, o, s) : void 0;\n if (!u)\n throw `Unknown renderer implementation: ${h}`;\n console.debug(`Using ${h} renderer`), n.style && u.setStyle(n.style);\n const p = yo(t, o, n);\n return p.setUser(f), {\n ...In(o, r, n.adapter),\n destroy: () => {\n u.destroy(), p.destroy(), r.destroy();\n },\n element: t,\n getUser: () => f,\n setFilter: (S) => {\n u.setFilter(S), p.setFilter(S);\n },\n setStyle: (S) => u.setStyle(S),\n setUser: (S) => {\n f = S, p.setUser(S);\n },\n setSelected: (S) => {\n S ? i.setSelected(S) : i.clear();\n },\n setPresenceProvider: (S) => {\n S && (u.setPainter(oo(S, n.presence)), S.on(\"selectionChange\", () => u.redraw()));\n },\n setVisible: (S) => u.setVisible(S),\n on: l.on,\n off: l.off,\n scrollIntoView: Ke(t, a),\n state: o\n };\n};\nexport {\n wt as DEFAULT_SELECTED_STYLE,\n W as DEFAULT_STYLE,\n re as NOT_ANNOTATABLE_CLASS,\n tt as NOT_ANNOTATABLE_SELECTOR,\n k as Origin,\n yo as SelectionHandler,\n hn as UserSelectAction,\n Ao as W3CTextFormat,\n Le as cancelSingleClickEvents,\n ft as cloneKeyboardEvent,\n At as clonePointerEvent,\n wo as createBody,\n ze as createCanvasRenderer,\n nn as createHighlightsRenderer,\n oo as createPresencePainter,\n en as createRenderer,\n rn as createSpansRenderer,\n xo as createTextAnnotator,\n eo as createTextAnnotatorState,\n Yt as debounce,\n bo as fillDefaults,\n Re as getQuoteContext,\n Nt as getRangeAnnotatableContents,\n Te as isMac,\n it as isNotAnnotatable,\n Ce as isRangeAnnotatable,\n F as isRevived,\n Ie as isWhitespaceOrEmpty,\n Ue as mergeClientRects,\n De as paint,\n jn as parseW3CTextAnnotation,\n Oe as programmaticallyFocusable,\n Ve as rangeToSelector,\n xt as reviveAnnotation,\n ae as reviveSelector,\n bt as reviveTarget,\n Ke as scrollIntoView,\n zn as serializeW3CTextAnnotation,\n Be as splitAnnotatableRanges,\n Ye as trimRangeToContainer,\n ke as whitespaceOrEmptyRegex\n};\n//# sourceMappingURL=text-annotator.es.js.map\n"],"names":[],"mappings":"AAAK,MAAC,KAAK,mBAAmB,KAAK,IAAI,EAAE;AAmDhC,OAAO,KAAK,UAAU,gBAAgB,UAAU,cAAc,WAAW,UAAU,QAAQ;AAAE,MA6BnG,KAAK,CAAC,MAAM;AACb,QAAM,IAAI,EAAE,cAAe;AAC3B,SAAO,EAAE,iBAAiB,EAAE,EAAE,QAAQ,CAAC,MAAM,EAAE,OAAQ,CAAA,GAAG;AAC5D,GAAG,KAAK,CAAC,GAAG,GAAG,IAAI,IAAI,MAAM;AAC3B,QAAM,IAAoD,GAAG,IAAI,SAAS,YAAa;AACvF,IAAE,SAAS,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW;AAC1D,QAAM,IAAI,GAAG,CAAC,EAAE,aAAa,IAAI,SAAS,YAAa;AACvD,IAAE,SAAS,EAAE,cAAc,EAAE,SAAS,GAAG,MAAM,SAAS,OAAO,EAAE,OAAO,GAAG,EAAE,WA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AAS;AAAA,IACf,IAAQ;AACJ,OAAG,QAAQ,SAAS,GAAG,CAAC,GAAG,KAAK;AAAA,EACpC;AACA;AACA,MAAM,KAAK;AAAA,EACT,qBAAqB;AAAA,EACrB,UAAU;AAAA,EACV,UAAU;AAAA,EACV,aAAa;AAAA,EACb,oBAAoB;AAAA,EACpB,gBAAgB;AAAA,EAChB,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,aAAa;AACf;AACA,WAAW,KAAK;AACd,SAAO,UAAU,eAAe,KAAK,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,GAAG,CAAC;AAC7D,IAAI,OAAO,SAAS,KAAK;AACvB,QAAM,IAAI,OAAO;AACjB,IAAE,aAAa,CAAC,OAAO,KAAK,OAAO,YAAY,MAAM,OAAO,UAAU,IAAI,IAAI,OAAO,UAAU;AACjG;","x_google_ignoreList":[0]}
@@ -1,13 +0,0 @@
1
- import { __module as jsxRuntime } from "./react-text-annotator.es20.js";
2
- import { __require as requireReactJsxRuntime_production_min } from "./react-text-annotator.es21.js";
3
- import { __require as requireReactJsxRuntime_development } from "./react-text-annotator.es22.js";
4
- if (process.env.NODE_ENV === "production") {
5
- jsxRuntime.exports = requireReactJsxRuntime_production_min();
6
- } else {
7
- jsxRuntime.exports = requireReactJsxRuntime_development();
8
- }
9
- var jsxRuntimeExports = jsxRuntime.exports;
10
- export {
11
- jsxRuntimeExports as j
12
- };
13
- //# sourceMappingURL=react-text-annotator.es9.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"react-text-annotator.es9.js","sources":["../../../node_modules/react/jsx-runtime.js"],"sourcesContent":["'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n"],"names":["jsxRuntimeModule","require$$0","require$$1"],"mappings":";;;AAEA,IAAI,QAAQ,IAAI,aAAa,cAAc;AACzCA,aAAA,UAAiBC,sCAAoD;AACvE,OAAO;AACLD,aAAA,UAAiBE,mCAAiD;AACpE;;","x_google_ignoreList":[0]}